Commit 754db751 authored by gonciarz's avatar gonciarz

Stack Overlay fixed

parent a5c3f860
......@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
......@@ -19,5 +24,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
......@@ -7,6 +7,8 @@ import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import ij.IJ;
import ij.ImageJ;
import ij.ImagePlus;
import ij.gui.GenericDialog;
import ij.plugin.PlugIn;
import ij.plugin.PlugInInterpreter;
......@@ -48,7 +50,7 @@ public class JythonLauncher implements PlugIn {
@Override
public void run(String arg) {
InputStream stream = getClass().getResourceAsStream(arg);
InputStream stream = getClass().getClassLoader().getResourceAsStream(arg);
String theString = null;
try {
theString = IOUtils.toString(stream);
......@@ -64,4 +66,30 @@ public class JythonLauncher implements PlugIn {
e.printStackTrace();
}
}
/**
* Main method for debugging.
*
* For debugging, it is convenient to have a method that starts ImageJ, loads an
* image and calls the plugin, e.g. after setting breakpoints.
*
* @param args unused
*/
public static void main(String[] args) {
// set the plugins.dir property to make the plugin appear in the Plugins menu
Class<?> clazz = JythonLauncher.class;
String url = clazz.getResource("/" + clazz.getName().replace('.', '/') + ".class").toString();
String pluginsDir = url.substring("file:".length(), url.length() - clazz.getName().length() - ".class".length());
System.setProperty("plugins.dir", pluginsDir);
// start ImageJ
new ImageJ();
// open the Clown sample
ImagePlus image = IJ.openImage("http://imagej.net/images/clown.jpg");
image.show();
// run the plugin
IJ.runPlugIn(clazz.getName(), "");
}
}
......@@ -3,7 +3,7 @@ from java.awt import Color, GridLayout
from javax.swing import JPanel, JComboBox, JLabel, JFrame, JScrollPane, JColorChooser, JButton, JSeparator, SwingConstants, SpinnerNumberModel, JSpinner, BorderFactory, JCheckBox
from net.miginfocom.swing import MigLayout
from ij import IJ, WindowManager, ImagePlus, ImageStack
from ij import IJ, WindowManager, ImagePlus, ImageStack, VirtualStack
from ij.process import Blitter
from script.imglib.math import Multiply, Difference, Subtract, Xor, Add, Or, Min
from script.imglib.color import Red, Green, Blue, RGBA
......@@ -183,4 +183,3 @@ class OverlayVirtualStack(VirtualStack):
stackOverlay = StackOverlay()
print "Done."
......@@ -20,7 +20,7 @@ Plugins>Mosaic>Utility, "Insert Poisson noise", mosaic.plugins.Poisson_Noise("ru
Plugins>Mosaic>Utility, "Convolve with 2D Bessel function", mosaic.plugins.BesselPSF_Convolver("run")
Plugins>Mosaic>Utility, "Region creator", mosaic.plugins.RegionCreator("run")
Plugins>Mosaic>Utility, "Color substitution", mosaic.plugins.ColorSubstitution("run")
Plugins>Mosaic>Utility, "Stack Overlay", mosaic.plugins.JythonLauncher("/src/mosaic/plugins/scripts/Stack_Overlay.py")
Plugins>Mosaic>Utility, "Stack Overlay", mosaic.plugins.JythonLauncher("Stack_Overlay.py")
Plugins>Mosaic>Utility>Cluster, "Merge jobs", mosaic.plugins.MergeJobs("run")
Plugins>Mosaic>Utility>Cluster, "New cluster profile", mosaic.plugins.NewClusterProfile("run")
......
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 to comment