Difference between revisions of "ImageJ1-ImageJ2 cheat sheet"

(Created page with "This page summarizes translation of basic operations of ImageJ1 and ImageJ2 API. Based on the work of Robert Hasse, Scientific Computing Facility, MPI CBG Dresden. {| class="...")
 
Line 19: Line 19:
 
|Convert image types
 
|Convert image types
 
|<source lang="java">ImagePlus imp = ImageJFunctions.wrap(img,"Title");</source>
 
|<source lang="java">ImagePlus imp = ImageJFunctions.wrap(img,"Title");</source>
|<source lang="java">Img<T> realImg = ImageJFunctions.wrapReal(imp);<source>
+
|<source lang="java">Img<T> realImg = ImageJFunctions.wrapReal(imp);</source>
 
<source lang="java">Img<FloatType> floatImg = ImageJFunctions.convertFloat(imp);</source>
 
<source lang="java">Img<FloatType> floatImg = ImageJFunctions.convertFloat(imp);</source>
 
<source lang="java">Img<FloatType> realImg2 = ImageJFunctions.wrap(imp);</source>
 
<source lang="java">Img<FloatType> realImg2 = ImageJFunctions.wrap(imp);</source>

Revision as of 06:56, 30 June 2018

This page summarizes translation of basic operations of ImageJ1 and ImageJ2 API. Based on the work of Robert Hasse, Scientific Computing Facility, MPI CBG Dresden.

Item ImageJ1 ImageJ2
Starting ImageJ
ij.ImageJ
ImageJ ij = new net.imagej.ImageJ();
ij.ui().showUI();
Show images
imagePlus.show()
ij.ui().show(testImg);
ImageJFunctions.show(testImg);
ImageJFunctions.wrap(testImg,"testImg").show();
Convert image types
ImagePlus imp = ImageJFunctions.wrap(img,"Title");
Img<T> realImg = ImageJFunctions.wrapReal(imp);
Img<FloatType> floatImg = ImageJFunctions.convertFloat(imp);
Img<FloatType> realImg2 = ImageJFunctions.wrap(imp);


See also

https://github.com/mpicbg-scicomp/ij2course-images/blob/master/slides/ij_legacy_cheetsheet.pdf