-
- All Superinterfaces:
Comparable<org.scijava.Prioritized>,org.scijava.Contextual,org.scijava.Disposable,org.scijava.plugin.HasPluginInfo,org.scijava.Identifiable,org.scijava.Initializable,org.scijava.Locatable,org.scijava.log.Logged,org.scijava.Prioritized,org.scijava.plugin.RichPlugin,SCIFIOService,org.scijava.plugin.SciJavaPlugin,org.scijava.service.Service,org.scijava.Versioned
- All Known Implementing Classes:
DefaultImgUtilityService
public interface ImgUtilityService extends SCIFIOService
Helper methods for converting between SCIFIO and ImgLib2 data structures.- Author:
- Stephan Preibisch, Stephan Saalfeld, Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doubledecodeWord(byte[] plane, int index, int pixelType, boolean little)net.imglib2.img.array.ArrayImg<?,?>getArrayAccess(net.imagej.ImgPlus<?> img)Obtains array access instance backing the given img, if any.long[]getConstrainedLengths(Metadata m, int imageIndex, SCIFIOConfig config)Returns an N-dimensional list of axis lengths from the given Metadata, constrained by the provided SubRegion (if present)long[]getDimLengths(Metadata m, int imageIndex, SCIFIOConfig config)Compiles an N-dimensional list of axis lengths from the given Metadata.intgetImageCount(org.scijava.io.location.Location source)net.imglib2.img.basictypeaccess.PlanarAccess<net.imglib2.img.basictypeaccess.array.ArrayDataAccess<?>>getPlanarAccess(net.imagej.ImgPlus<?> img)Obtains planar access instance backing the given img, if any.StringguessDimOrder(net.imagej.axis.CalibratedAxis[] axes, long[] dimLengths, long[] newLengths)The ImgLib axes structure can contain multiple unknown axes.<T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>>
booleanisCompressible(net.imagej.ImgPlus<T> img)Currently there are limits as to what types of Images can be saved.<T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>>
booleanisCompressible(net.imglib2.img.Img<T> img)net.imglib2.img.basictypeaccess.array.ArrayDataAccess<?>makeArray(Object array)Wraps raw primitive array in ImgLib2 Array object.<T> SCIFIOImgPlus<T>makeSCIFIOImgPlus(net.imglib2.img.Img<T> img)Convenience method for wrapping anImgas aSCIFIOImgPlus.net.imglib2.type.Type<?>makeType(int pixelType)Converts SCIFIO pixel type to ImgLib2 Type object.intmakeType(Object type)Converts ImgLib2 Type object to SCIFIO pixel type.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
getPlanarAccess
net.imglib2.img.basictypeaccess.PlanarAccess<net.imglib2.img.basictypeaccess.array.ArrayDataAccess<?>> getPlanarAccess(net.imagej.ImgPlus<?> img)
Obtains planar access instance backing the given img, if any.
-
getArrayAccess
net.imglib2.img.array.ArrayImg<?,?> getArrayAccess(net.imagej.ImgPlus<?> img)
Obtains array access instance backing the given img, if any.
-
makeType
net.imglib2.type.Type<?> makeType(int pixelType)
Converts SCIFIO pixel type to ImgLib2 Type object.
-
makeType
int makeType(Object type) throws ImgIOException
Converts ImgLib2 Type object to SCIFIO pixel type.- Throws:
ImgIOException
-
makeArray
net.imglib2.img.basictypeaccess.array.ArrayDataAccess<?> makeArray(Object array)
Wraps raw primitive array in ImgLib2 Array object.
-
getDimLengths
long[] getDimLengths(Metadata m, int imageIndex, SCIFIOConfig config)
Compiles an N-dimensional list of axis lengths from the given Metadata.
-
getConstrainedLengths
long[] getConstrainedLengths(Metadata m, int imageIndex, SCIFIOConfig config)
Returns an N-dimensional list of axis lengths from the given Metadata, constrained by the provided SubRegion (if present)
-
getImageCount
int getImageCount(org.scijava.io.location.Location source) throws ImgIOException
- Parameters:
source- - the location of the dataset to assess- Returns:
- The number of images in the specified dataset.
- Throws:
ImgIOException
-
isCompressible
<T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> boolean isCompressible(net.imglib2.img.Img<T> img)
-
isCompressible
<T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> boolean isCompressible(net.imagej.ImgPlus<T> img)
Currently there are limits as to what types of Images can be saved. All images must ultimately adhere to an, at most, five-dimensional structure using the known axes X, Y, Z, Channel and Time. Unknown axes (U) can potentially be handled by coercing to the Channel axis. For example, X Y Z U C U T would be valid, as would X Y Z U T. But X Y C Z U T would not, as the unknown axis can not be compressed with Channel. This method will return true if the axes of the provided image can be represented with a valid 5D String, and false otherwise.
-
guessDimOrder
String guessDimOrder(net.imagej.axis.CalibratedAxis[] axes, long[] dimLengths, long[] newLengths)
The ImgLib axes structure can contain multiple unknown axes. This method will determine if the provided dimension order, obtained from an ImgLib AxisType array, can be converted to a 5-dimensional sequence compatible with SCIFIO, and returns that sequence if it exists and null otherwise.- Parameters:
newLengths- - updated to hold the lengths of the newly ordered axes
-
decodeWord
double decodeWord(byte[] plane, int index, int pixelType, boolean little)- Parameters:
plane- - byte array from the desired planeindex- - pixel index into the plane (NOT an array index)pixelType- - base pixel type of the plane's datalittle- - endianness of the plane's bytes- Returns:
- A double value for the specified pixel.
-
makeSCIFIOImgPlus
<T> SCIFIOImgPlus<T> makeSCIFIOImgPlus(net.imglib2.img.Img<T> img)
Convenience method for wrapping anImgas aSCIFIOImgPlus.- Parameters:
img- Img to wrap- Returns:
- SCIFIOImgPlus wrapping the provided Img, or if the provided Img is a SCIFIOImgPlus, casts and returns.
-
-