Login  Register

How to call Z-functions from a plugin on ImageJ

Posted by Danae on Sep 27, 2016; 10:27am
URL: http://imagej.273.s1.nabble.com/How-to-call-Z-functions-from-a-plugin-on-ImageJ-tp5017246.html

Good morning

I'm currently doing a plugin on JAVA for imagej that needs to call the function "Maximum Intensity Z-projection" which I know it's already in imagej if you go for "Image/Stacks/Z Project...".
Documentation here: Maximum Intensity Z-projection

I tried to call it like if I was running a plugin from another plugin but it didn't work (now I'm showing you the code I'm trying)

public class MaximumIntensity_ implements PlugIn{
        ImagePlus img = WindowManager.getCurrentImage();

        @Override
        public void run(String arg0) {
                // TODO Auto-generated method stub
                Object zProjector = null;
                zProjector = IJ.runPlugIn(img , "ZProjector", arg0);
               
                if(zProjector==null){
                        String arg = "Error";
                        IJ.showMessage(arg);

                }
        }
}

Thank you so much.