- java.lang.Object
-
- net.imglib2.imagej.ImagePlusToImg
-
public class ImagePlusToImg extends Object
Provides convenience functions to wrap ImageJ 1.x data structures as ImgLib2 ones.- Author:
- Stephan Preibisch, Stephan Saalfeld, Matthias Arzt, Gabriel Selzer
-
-
Constructor Summary
Constructors Constructor Description ImagePlusToImg()
-
Method Summary
-
-
-
Method Detail
-
wrapDirect
public static net.imglib2.img.planar.PlanarImg<?,?> wrapDirect(ij.ImagePlus imp)
Wraps anImagePlusinto aPlanarImg.Under the hood, each
ImageProcessor's backing array is wrapped into anArrayDataAccess. The resultingListofArrayDataAccesses is used to form aPlanarImg.- Parameters:
imp- theImagePlusto wrap- Returns:
- a
PlanarImgdirectly wrappingimp
-
wrapByteDirect
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.integer.UnsignedByteType,?> wrapByteDirect(ij.ImagePlus imp)
Wraps anImagePlusinto aPlanarImgof unsigned bytes.Under the hood, each
ImageProcessor's backing array is wrapped into anByteArray. The resultingListofArrayDataAccesses is used to form aPlanarImg.- Parameters:
imp- theImagePlusto wrap- Returns:
- a
PlanarImgof unsigned bytes directly wrappingimp
-
wrapShortDirect
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.integer.UnsignedShortType,?> wrapShortDirect(ij.ImagePlus imp)
Wraps anImagePlusinto aPlanarImgof unsigned shorts.Under the hood, each
ImageProcessor's backing array is wrapped into anShortArray. The resultingListofArrayDataAccesses is used to form aPlanarImg.- Parameters:
imp- theImagePlusto wrap- Returns:
- a
PlanarImgof unsigned shorts directly wrappingimp
-
wrapRGBADirect
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.ARGBType,?> wrapRGBADirect(ij.ImagePlus imp)
Wraps anImagePlusinto aPlanarImgof RGBA tuples.Under the hood, each
ImageProcessor's backing array is wrapped into anIntArray. The resultingListofArrayDataAccesses is used to form aPlanarImg.- Parameters:
imp- theImagePlusto wrap- Returns:
- a
PlanarImgof ARGB tuples directly wrappingimp
-
wrapFloatDirect
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.real.FloatType,?> wrapFloatDirect(ij.ImagePlus imp)
Wraps anImagePlusinto aPlanarImgof floats.Under the hood, each
ImageProcessor's backing array is wrapped into anFloatArray. The resultingListofArrayDataAccesses is used to form aPlanarImg.- Parameters:
imp- theImagePlusto wrap- Returns:
- a
PlanarImgof floats directly wrappingimp
-
wrapByteCached
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.integer.UnsignedByteType,net.imglib2.img.basictypeaccess.array.ByteArray> wrapByteCached(ij.ImagePlus image)
Wraps an 8 bitImagePlus, into anPlanarImg, that is backed by aPlanarImg. ThePlanarImgloads the planes only if needed, and caches them.- Parameters:
image- theImagePlusto wrap. Must contain unsigned bytes.- Returns:
- a
PlanarImgwrappingimage.
-
wrapShortCached
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.integer.UnsignedShortType,net.imglib2.img.basictypeaccess.array.ShortArray> wrapShortCached(ij.ImagePlus image)
Wraps a 16 bitImagePlus, into anPlanarImg, that is backed by aPlanarImg. ThePlanarImgloads the planes only if needed, and caches them.- Parameters:
image- theImagePlusto wrap. Must contain unsigned shorts.- Returns:
- a
PlanarImgwrappingimage.
-
wrapFloatCached
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.real.FloatType,net.imglib2.img.basictypeaccess.array.FloatArray> wrapFloatCached(ij.ImagePlus image)
Wraps a 32 bitImagePlus, into anPlanarImg, that is backed by aPlanarImg. ThePlanarImgloads the planes only if needed, and caches them.- Parameters:
image- theImagePlusto wrap. Must contain floats.- Returns:
- a
PlanarImgwrappingimage.
-
wrapRGBACached
public static net.imglib2.img.planar.PlanarImg<net.imglib2.type.numeric.ARGBType,net.imglib2.img.basictypeaccess.array.IntArray> wrapRGBACached(ij.ImagePlus image)
Wraps a 24 bitImagePlus, into anPlanarImg, that is backed by aPlanarImg. ThePlanarImgloads the planes only if needed, and caches them.- Parameters:
image- theImagePlusto wrap. Must contain RGB tuples.- Returns:
- a
PlanarImgwrappingimage.
-
wrapCached
public static net.imglib2.img.planar.PlanarImg<?,?> wrapCached(ij.ImagePlus image)
Wraps anImagePlus, into anPlanarImg, that is backed by aPlanarImg. ThePlanarImgloads the planes only if needed, and caches them. The pixel type of the returned image depends on the type of the ImagePlus.- Parameters:
image- theImagePlusto wrap- Returns:
- a
PlanarImgwrappingimage.
-
-