This page summarizes translation of basic operations of ImageJ 1.x and ImageJ2 API. Based on the work of Robert Haase, Scientific Computing Facility, MPI-CBG Dresden.
Task
ImageJ
ImageJ2
Starting ImageJ
Show images
imp is an ImagePlus object
Retrieve an active image object
Script parameter (the same for Dataset, ImagePlus, etc.):
In Java code:
Using ImageDisplayService:
Open an image file
IJ.openImage() returns an ImagePlus object without showing.
IJ.open() automatically shows the image without returning ImagePlus.
Using IOService:
Using DatasetIOService (for type safety):
Save an image file
Using IOService:
Using DatasetIOService:
Convert image types
Convert from ImgLib2 Img object to ImageJ ImagePlus object:
Convert from ImageJ ImagePlus object to ImgLib2 Img object: