Commit ec002db1 by Chris Coughlin

Updated to Myriad 2.0 Snapshot

parent 7542d425
......@@ -28,7 +28,7 @@ We've prepared a [bundle](http://myrdocs.azurewebsites.net/myriad_samples.zip) t
When you're ready to create your own ROI models, have a look at the companion tool [Myriad Trainer](trainer.md).
## Licensing
Copyright 2016 Emphysic, LLC.
Copyright 2017 Emphysic, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.emphysic.myriad.ui</groupId>
<artifactId>desktop</artifactId>
<version>1.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -98,19 +98,19 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
<version>1.16.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.emphysic.myriad</groupId>
<artifactId>core</artifactId>
<version>1.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
......@@ -125,7 +125,7 @@
<dependency>
<groupId>com.emphysic.myriad</groupId>
<artifactId>network</artifactId>
<version>1.0-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
......@@ -140,22 +140,17 @@
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-plot</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-core</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.jdesktop</groupId>
<artifactId>beansbinding</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.10</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/*
* com.emphysic.myriad.ui.desktop.DatasetPanel
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.MyriadDesktop
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -188,13 +188,23 @@ public final class MyriadDesktop extends javax.swing.JFrame {
public void mouseClicked(MouseEvent evt) {
if (evt.getClickCount() == 2) {
if (!roiLB.isSelectionEmpty()) {
PlotDialog plot = new PlotDialog(
(JFrame) SwingUtilities.getWindowAncestor(roiLB),
false);
plot.setTitle(roiLB.getSelectedValue().getMetadata());
plot.setIconImage(getIconImage());
plot.plot(roiLB.getSelectedValue().getDataset());
plot.setVisible(true);
Dataset toPlot = roiLB.getSelectedValue().getDataset();
try {
PlotDialog plot = new PlotDialog(
(JFrame) SwingUtilities.getWindowAncestor(roiLB),
false);
plot.setTitle(roiLB.getSelectedValue().getMetadata());
plot.setIconImage(getIconImage());
plot.plot(toPlot);
plot.setVisible(true);
} catch (Exception e) {
// Dataset has invalid dims e.g. if preprocessor forces dim change
JOptionPane.showMessageDialog(
(JFrame) SwingUtilities.getWindowAncestor(roiLB),
"Unable to plot specified Dataset, error was: " + e.getMessage(),
"Unable To Plot Dataset",
JOptionPane.OK_OPTION);
}
}
}
}
......@@ -262,6 +272,22 @@ public final class MyriadDesktop extends javax.swing.JFrame {
return fallbackValue;
}
}
/**
* Reports whether the Normalize Data option is selected.
* @return true if data should be normalized
*/
public boolean normalizeData() {
return normDataCB.isSelected();
}
/**
* Specify whether data should be normalized or not
* @param normalize true if data should be normalized
*/
public void normalizeData(boolean normalize) {
normDataCB.setSelected(normalize);
}
/**
* This method is called from within the constructor to initialize the form.
......
/*
* com.emphysic.myriad.ui.desktop.ReorderListener
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.controllers.ListenerActor
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.controllers.MyriadDesktopController
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -40,9 +40,9 @@ import com.emphysic.myriad.core.data.ops.ScalingOperation;
import com.emphysic.myriad.core.data.ops.ScharrOperation;
import com.emphysic.myriad.core.data.ops.SobelOperation;
import com.emphysic.myriad.core.data.roi.ExternalROIFinder;
import com.emphysic.myriad.core.data.roi.MLROIFinder;
import com.emphysic.myriad.core.data.roi.RESTROIFinder;
import com.emphysic.myriad.core.data.roi.ROI;
import com.emphysic.myriad.core.data.roi.ROIBundle;
import com.emphysic.myriad.core.data.roi.ROIFinder;
import com.emphysic.myriad.core.data.util.FileSniffer;
import com.emphysic.myriad.network.DataIngestorPool;
......@@ -68,7 +68,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
......@@ -76,7 +75,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import scala.concurrent.Await;
import org.reflections.Reflections;
/**
......@@ -433,17 +431,20 @@ public class MyriadDesktopController {
switch (appType) {
case INTERNAL:
File modelFile = new File(roiApp);
Reflections reflections = new Reflections("com.emphysic.myriad");
Set<Class<? extends MLROIFinder>> subTypes = reflections.getSubTypesOf(MLROIFinder.class);
for (Class<? extends MLROIFinder> clz: subTypes) {
try {
roiFinder = (MLROIFinder) ROIFinder.fromFile(modelFile, clz);
log.info("Read " + modelFile + " as " + clz);
break;
} catch (Exception e) {
log.info("Couldn't read " + modelFile + " as " + clz + ": " + e.getMessage());
ROIBundle bundle = new ROIBundle();
try {
bundle.load(modelFile);
roiFinder = bundle;
// If the model was created with Trainer set normalization accordingly
if (bundle.getMetadataEntry("normalized_samples") != null) {
frame.normalizeData(
Boolean.parseBoolean(bundle.getMetadataEntry("normalized_samples"))
);
}
};
log.info("Successfully read " + modelFile);
} catch (IOException e) {
log.info("Couldn't read " + modelFile + ": " + e.getMessage());
}
app = modelFile.toString();
break;
case EXTERNAL:
......
/*
* com.emphysic.myriad.ui.desktop.controllers.ROIResultGenerator
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.controllers.RelayActor
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.AboutDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -22,8 +22,6 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.SwingWorker;
......@@ -120,7 +118,7 @@ public class AboutDialog extends javax.swing.JDialog {
copyright = new String(b);
} catch (IOException ioe) {
log.warn("Unable to fetch copyright file, error was: " + ioe.getMessage());
copyright = "Copyright (C) 2016 Emphysic LLC.";
copyright = "Copyright (C) 2017 Emphysic LLC.";
}
return copyright;
}
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.AboutEmphysicDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.ClientDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.IProgressDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.LicenseDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.LogDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.dialogs.PlotDialog
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* com.emphysic.myriad.ui.desktop.util.WorkerWaiter
*
* Copyright (c) 2016 Emphysic LLC.
* Copyright (c) 2017 Emphysic LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
Copyright 2016 Emphysic LLC.
Copyright 2017 Emphysic LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment