public ImagePlus process(ImagePlus image, Operation op, Strel3D strel) { // Check validity of parameters if (image == null) return null; // extract the input stack ImageStack inputStack = image.getStack(); // apply morphological operation ImageStack resultStack = op.apply(inputStack, strel); // create the new image plus from the processor ImagePlus resultPlus = new ImagePlus(op.toString(), resultStack); resultPlus.copyScale(image); // return the created array return resultPlus; }
/** * Called at the beginning of the process to know if the plugin can be run * with current image, and at the end to finalize. */ public int setup(String arg, ImagePlus imp) { // Special case of plugin called to finalize the process if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // Create a new ImagePlus with the filter result String newName = createResultImageName(imagePlus); ImagePlus resPlus = new ImagePlus(newName, result); resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } return flags; }
@Override public int setup(String arg, ImagePlus imp) { // Called at the end for cleaning up the results if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // Create a new ImagePlus with the result String newName = imagePlus.getShortTitle() + "-directional"; ImagePlus resPlus = new ImagePlus(newName, result); // calibrate result image and display resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } // return flags indicating which image can be processed return flags; }
/** * Called at the beginning of the process to know if the plugin can be run * with current image, and at the end to finalize. */ public int setup(String arg, ImagePlus imp) { // Special case of plugin called to finalize the process if ( arg.equals("final") ) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // Create a new ImagePlus with the filter result String newName = createResultImageName(imagePlus); ImagePlus resPlus = new ImagePlus(newName, result); resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } return flags; }
/** * Setup function is called in the beginning of the process, but also at the * end. It is also used for displaying "about" frame. */ public int setup(String arg, ImagePlus imp) { // about... if (arg.equals("about")) { showAbout(); return DONE; } // Called at the end for cleaning the results if (arg.equals("final")) { // replace the preview image by the original image resetPreview(); imagePlus.updateAndDraw(); // Create a new ImagePlus with the filter result String newName = createResultImageName(imagePlus); ImagePlus resPlus = new ImagePlus(newName, result); resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } return flags; }
/** */ public int setup(String arg, ImagePlus imp) { // about... if (arg.equals("about")) { showAbout(); return DONE; } // Called at the end for cleaning up the results if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // as result is binary, choose inverted LUT result.invertLut(); // Create a new ImagePlus with the result String newName = createResultImageName(imagePlus); ImagePlus resPlus = new ImagePlus(newName, result); resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } return flags; }
/** */ public int setup(String arg, ImagePlus imp) { // about... if (arg.equals("about")) { showAbout(); return DONE; } // Called at the end for cleaning the results if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // as result is binary, choose inverted LUT result.invertLut(); // Create a new ImagePlus with the result String newName = createResultImageName(imagePlus); ImagePlus resPlus = new ImagePlus(newName, result); resPlus.copyScale(imagePlus); resPlus.show(); return DONE; } return flags; }
public ImagePlus process(ImagePlus image, Operation op, Strel3D strel) { // Check validity of parameters if (image == null) return null; // extract the input stack ImageStack inputStack = image.getStack(); // apply morphological operation ImageStack resultStack = op.apply(inputStack, strel); // create the new image plus from the processor String newName = image.getShortTitle() + "-" + op.toString(); ImagePlus resultPlus = new ImagePlus(newName, resultStack); resultPlus.copyScale(image); // return the created array return resultPlus; } }
/** * Called at the beginning of the process to know if the plugin can be run * with current image, and at the end to finalize. */ public int setup( String arg, ImagePlus imp ) { if( null == imp ) return DONE; // Special case of plugin called to finalize the process if ( arg.equals("final") ) { // replace the preview image by the original image imagePlus.setProcessor( baseImage ); imagePlus.draw(); if( null != result ) { // Create a new ImagePlus with the filter result String newName = createResultImageName( imagePlus ); ImagePlus resPlus = new ImagePlus( newName, result ); resPlus.copyScale( imagePlus ); resPlus.show(); } Roi.removeRoiListener( listener ); return DONE; } return flags; }
public static final ImagePlus geodesicDistanceMap(ImagePlus markerPlus, ImagePlus maskPlus) { ImagePlus result = null; String newName = markerPlus.getShortTitle() + "-distMap"; if (markerPlus.getStackSize() == 1 && maskPlus.getStackSize() == 1) { ImageProcessor distMap = geodesicDistanceMap(markerPlus.getProcessor(), maskPlus.getProcessor()); result = new ImagePlus(newName, distMap); } result.copyScale(markerPlus); return result; }
@Override public int setup(String arg, ImagePlus imp) { this.imagePlus = imp; // Called at the end for cleaning up the results if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // Create a new ImagePlus with the result String newName = imagePlus.getShortTitle() + "-boxDiagOpen"; ImagePlus resPlus = new ImagePlus(newName, result); // copy spatial calibration and display settings resPlus.copyScale(imagePlus); result.setColorModel(baseImage.getColorModel()); resPlus.show(); return DONE; } // Normal setup this.baseImage = imp.getProcessor().duplicate(); return flags; }
@Override public int setup(String arg, ImagePlus imp) { this.imagePlus = imp; // Called at the end for cleaning up the results if (arg.equals("final")) { // replace the preview image by the original image imagePlus.setProcessor(baseImage); imagePlus.draw(); // Create a new ImagePlus with the result String newName = imagePlus.getShortTitle() + "-areaOpen"; ImagePlus resPlus = new ImagePlus(newName, result); // copy spatial calibration and display settings resPlus.copyScale(imagePlus); result.setColorModel(baseImage.getColorModel()); resPlus.show(); return DONE; } // Normal setup this.baseImage = imp.getProcessor().duplicate(); return flags; }
resultImage.copyScale(image);
@Override public int setup(String arg, ImagePlus imp) { // Called at the end for cleaning up the results if (arg.equals("final")) { // replace the preview image by the original image resetPreview(); imagePlus.updateAndDraw(); // Create a new ImagePlus with the result String newName = imagePlus.getShortTitle() + "-attrFilt"; ImagePlus resPlus = new ImagePlus(newName, result); // copy spatial calibration and display settings resPlus.copyScale(imagePlus); result.setColorModel(baseImage.getColorModel()); resPlus.show(); return DONE; } // Normal setup this.imagePlus = imp; this.baseImage = imp.getProcessor().duplicate(); return flags; }
resultPlus.copyScale(imagePlus);
resultPlus.copyScale(imagePlus); return resultPlus;
resultPlus.copyScale(imagePlus); return resultPlus;
private void initResultImage() { if (this.labelImagePlus.getStackSize() == 1) { ImageProcessor labelImage = this.labelImagePlus.getProcessor(); int sizeX = labelImage.getWidth(); int sizeY = labelImage.getHeight(); ImageProcessor resultImage = new FloatProcessor(sizeX, sizeY); this.resultPlus = new ImagePlus("Result", resultImage); } else { ImageStack labelImage = this.labelImagePlus.getStack(); int sizeX = labelImage.getWidth(); int sizeY = labelImage.getHeight(); int sizeZ = labelImage.getSize(); ImageStack resultImage = ImageStack.create(sizeX, sizeY, sizeZ, 32); this.resultPlus = new ImagePlus("Result", resultImage); } this.resultPlus.copyScale(this.labelImagePlus); }
resultPlus.copyScale(imagePlus);
selectedPlus.copyScale(imagePlus); selectedPlus.setDisplayRange(imagePlus.getDisplayRangeMin(), imagePlus.getDisplayRangeMax()); selectedPlus.setLut( imagePlus.getProcessor().getLut() );