/** Opens an image using a file open dialog and returns it as an ImagePlus object. */ public static ImagePlus openImage() { return openImage(null); }
public ImagePlus getImage(String path) { if (!path.equals(currentImagePath)) { File f = new File(path); if (!f.exists()) return null; // give the garbage collector a chance currentImage = null; currentImagePath = path; currentImage = IJ.openImage(currentImagePath); } return currentImage; }
public ImagePlus getTemplateLabels() { if (templateLabels == null) templateLabels = IJ.openImage(getResampledPath(-1, -1)); // TODO: check if the dimensions are really borked return templateLabels; }
public ImagePlus getTemplate() { if (templ == null) { String path = getResampledPath(options.refChannel - 1, -1); templ = IJ.openImage(path); } // TODO: check if the dimensions are really borked return templ; }
/** * Opens an image using ImageJ 1.x. * * @param path the image file to open * @return the image */ public Object openImage(final String path, final boolean show) { final ImagePlus imp = IJ.openImage(path); if (show && imp != null) imp.show(); return imp; }
protected void loadFileIfNecessary(File file) { if (raiMap.containsKey( file )) return; final ImagePlus imp = IJ.openImage( file.getAbsolutePath() ); final RandomAccessibleInterval< FloatType > img = ImageJFunctions.convertFloat( imp ).copy(); raiMap.put( file, img ); }
public static Iterable<ImagePlus> getIterable(final File file) { if (!file.isDirectory()) { return HyperStackIterator.getIterable(IJ.openImage(file .getAbsolutePath())); } return new FileIterator(file); }
@Override public void run(String arg) { ImagePlus imp1 = IJ.openImage("/Users/dan/Documents/Dresden/ipf/colocPluginDesign/red.tif"); img1 = ImagePlusAdapter.wrap(imp1); ImagePlus imp2 = IJ.openImage("/Users/dan/Documents/Dresden/ipf/colocPluginDesign/green.tif"); img2 = ImagePlusAdapter.wrap(imp2); double pearson = calculatePearson(); Img<T> ranImg = generateRandomImageStack(img1, new int[] {2,2,1}); }
/** * Returns an ImageProcessor for the specified slice. * @param n The slice index, where 1 <= n <= nSlices. * @return null if the stack is empty. */ public ImageProcessor getProcessor(int n) { ImagePlus imp = IJ.openImage(dir + "/" + getFileName(n)); if (imp != null) return imp.getProcessor(); return null; }
/** Opens and displays the nth image in the specified tiff stack. */ public static void open(String path, int n) { if (ij==null && Menus.getCommands()==null) init(); ImagePlus imp = openImage(path, n); if (imp!=null) imp.show(); }
/** Opens and displays the nth image in the specified tiff stack. */ public static void open(String path, int n) { if (ij==null && Menus.getCommands()==null) init(); ImagePlus imp = openImage(path, n); if (imp!=null) imp.show(); }
private ImageProcessor getLeafImage() { String fileName = getClass().getResource("/files/CA_QK_004_H1.tif").getFile(); ImagePlus imagePlus = IJ.openImage(fileName); assertNotNull(imagePlus); ImageProcessor image = imagePlus.getProcessor(); return image; }
@Test public final void testOpenImage() { String fileName = getClass().getResource("/files/peppers-crop.png").getFile(); assertNotNull(fileName); ImagePlus imagePlus = IJ.openImage(fileName); assertNotNull(imagePlus); }
@SuppressWarnings("unused") static public final void main(String[] args) { final ShortProcessor sp = (ShortProcessor) IJ.openImage("/home/albert/Desktop/t2/bridge-16bit.tif").getProcessor(); final ShortProcessor filtered = median(sp, 64, 0, 65535, 100); new ImageJ(); new ImagePlus("median", filtered).show(); } }
/** * Test method for {@link inra.ijpb.label.geodesic.GeodesicDiameter#analyzeRegions(ij.process.ImageProcessor)}. */ @Test public void testGeodesicDiameter_Circle_ChessKnight() { ImagePlus imagePlus = IJ.openImage(getClass().getResource("/files/circles.tif").getFile()); ImageProcessor image = imagePlus.getProcessor(); GeodesicDiameter algo = new GeodesicDiameter(ChamferWeights.CHESSKNIGHT); Map<Integer, GeodesicDiameter.Result> geodDiams = algo.analyzeRegions(image); assertEquals(1, geodDiams.size()); }
public static void main(String[] args) { new ij.ImageJ(); ImagePlus img = IJ.openImage("/home/bene/PhD/brains/template.tif"); img = new ImagePlus("Slice 20", img.getStack().getProcessor(20)); img.show(); ij.IJ.runPlugIn("textureByRef.Texture_By_Ref", ""); }
/** * Test method for {@link inra.ijpb.binary.geodesic.GeodesicDiameterFloat#analyzeImage(ij.process.ImageProcessor)}. */ @Test public void testAnalyzeImage_Circle() { ImagePlus imagePlus = IJ.openImage(getClass().getResource("/files/circles.tif").getFile()); ImageProcessor image = imagePlus.getProcessor(); GeodesicDiameterFloat algo = new GeodesicDiameterFloat(ChamferWeights.CHESSKNIGHT); ResultsTable table = algo.analyzeImage(image); assertEquals(1, table.getCounter()); }
/** * Test method for {@link inra.ijpb.binary.geodesic.GeodesicDiameterShort#analyzeImage(ij.process.ImageProcessor)}. */ @Test public void testAnalyzeImage_Circle() { ImagePlus imagePlus = IJ.openImage(getClass().getResource("/files/circles.tif").getFile()); ImageProcessor image = imagePlus.getProcessor(); GeodesicDiameterShort algo = new GeodesicDiameterShort(ChamferWeights.CHESSKNIGHT); ResultsTable table = algo.analyzeImage(image); assertEquals(1, table.getCounter()); }
public static void main(String[] args) { new ij.ImageJ(); ImagePlus img = IJ.openImage("/home/bene/PhD/brains/template.tif"); img = new ImagePlus("Slice 20", img.getStack().getProcessor(20)); new ImageConverter(img).convertToRGB(); img.show(); ij.IJ.runPlugIn("textureByRef.Texture_By_Ref_col", ""); }
@Test @Deprecated public final void testInertiaEllipsoid_A30_B20_C10_T00_P00() { String fileName = getClass().getResource("/files/ellipsoid_A30_B20_C10_T00_P00.tif").getFile(); ImagePlus imagePlus = IJ.openImage(fileName); assertNotNull(imagePlus); ImageStack image = imagePlus.getStack(); ResultsTable table = GeometricMeasures3D.inertiaEllipsoid(image); assertEquals(30, table.getValueAsDouble(3, 0), .1); assertEquals(20, table.getValueAsDouble(4, 0), .1); assertEquals(10, table.getValueAsDouble(5, 0), .1); }