-
- All Implemented Interfaces:
Filter,Groupable,HasFormat,HasSource,Reader,SCIFIOPlugin,Comparable<org.scijava.Prioritized>,org.scijava.Contextual,org.scijava.Identifiable,org.scijava.Locatable,org.scijava.log.Logged,org.scijava.plugin.HasPluginInfo,org.scijava.plugin.RichPlugin,org.scijava.plugin.SciJavaPlugin,org.scijava.Prioritized,org.scijava.Versioned
public class DimensionSwapper extends AbstractReaderFilter
Handles swapping the dimension order of an image series. This class is useful for both reassigning ZCT sizes (the input dimension order), and shuffling around the resultant planar order (the output dimension order).
-
-
Constructor Summary
Constructors Constructor Description DimensionSwapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<net.imagej.axis.AxisType>getDimensionOrder(int imageIndex)Returns the (potentially swapped) output order of the AxisTypes.List<net.imagej.axis.AxisType>getInputOrder(int imageIndex)Returns the order for reading AxisTypes from disk.MetadatagetMetadata()Gets the type-specific Metadata for this ReaderdoublegetPriority()PlaneopenPlane(int imageIndex, long planeIndex)Creates aPlanerepresentation of the pixels at the specified indices.PlaneopenPlane(int imageIndex, long planeIndex, SCIFIOConfig config)AsReader.openPlane(int, long)with configuration options.PlaneopenPlane(int imageIndex, long planeIndex, Plane plane)Allows a singlePlaneobject to be reused by reference when opening complete planes.PlaneopenPlane(int imageIndex, long planeIndex, Plane plane, SCIFIOConfig config)Allows a singlePlaneobject to be reused by reference when opening complete planes.PlaneopenPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds)Allows a singlePlaneobject to be reused by reference when opening sub-regions of planes.PlaneopenPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds, SCIFIOConfig config)Allows a singlePlaneobject to be reused by reference when opening sub-regions of planes.PlaneopenPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds)Creates aPlanerepresentation of a desired sub-region from the pixels at the specified indices.PlaneopenPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds, SCIFIOConfig config)AsReader.openPlane(int, long, Interval)with configuration options.voidsetOutputOrder(int imageIndex, List<net.imagej.axis.AxisType> outputOrder)Sets the output dimension order according to the given string (e.g., "XYZCT").protected voidsetSourceHelper(org.scijava.io.location.Location source, SCIFIOConfig config)Allows code to be executed regardless of whichAbstractReaderFilter.setSource(org.scijava.io.location.Location)signature is called.voidswapDimensions(int imageIndex, net.imagej.axis.AxisType... newOrder)Sets the input dimension order according to the given string (e.g., "XYZCT").-
Methods inherited from class io.scif.filters.AbstractReaderFilter
castToTypedPlane, cleanUp, close, close, createPlane, createPlane, fileGroupOption, getContext, getCurrentLocation, getDomains, getFormat, getFormatName, getHandle, getImageCount, getOptimalTileHeight, getOptimalTileWidth, getParentMeta, getPlaneCount, hasCompanionFiles, isCompatible, isNormalized, isSingleFile, metaCheck, openPlaneHelper, planarBounds, readPlane, readPlane, readPlaneHelper, setContext, setMetadata, setNormalized, setParent, setSource, setSource, setSource, setSource, target
-
Methods inherited from class io.scif.filters.AbstractFilter
enabledDefault, getParent, reset
-
Methods inherited from class io.scif.AbstractSCIFIOPlugin
getVersion, log
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context
-
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, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier
-
Methods inherited from interface io.scif.SCIFIOPlugin
getVersion, log
-
-
-
-
Method Detail
-
swapDimensions
public void swapDimensions(int imageIndex, net.imagej.axis.AxisType... newOrder)Sets the input dimension order according to the given string (e.g., "XYZCT"). This string indicates the planar rasterization order from the source, overriding the detected order. It may result in the dimensional axis sizes changing. If the given order is identical to the file's native order, then nothing happens. Note that this method will throw an exception if X and Y do not appear in positions 0 and 1 (although X and Y can be reversed).
-
setOutputOrder
public void setOutputOrder(int imageIndex, List<net.imagej.axis.AxisType> outputOrder)Sets the output dimension order according to the given string (e.g., "XYZCT"). This string indicates the final planar rasterization order—i.e., the mapping from 1D plane number to 3D (Z, C, T) tuple. Changing it will not affect the Z, C or T sizes but will alter the order in which planes are returned when iterating. This method is useful when your application requires a particular output dimension order; e.g., ImageJ virtual stacks must be in XYCZT order.
-
getInputOrder
public List<net.imagej.axis.AxisType> getInputOrder(int imageIndex)
Returns the order for reading AxisTypes from disk.
-
getDimensionOrder
public List<net.imagej.axis.AxisType> getDimensionOrder(int imageIndex)
Returns the (potentially swapped) output order of the AxisTypes.
-
setSourceHelper
protected void setSourceHelper(org.scijava.io.location.Location source, SCIFIOConfig config)
Description copied from class:AbstractReaderFilterAllows code to be executed regardless of whichAbstractReaderFilter.setSource(org.scijava.io.location.Location)signature is called.- Overrides:
setSourceHelperin classAbstractReaderFilter- Parameters:
source- - Lowest common denominator of arguments in thesetSourceseries.
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex) throws FormatException, IOException
Description copied from interface:ReaderCreates aPlanerepresentation of the pixels at the specified indices.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Parameters:
imageIndex- the image index within the dataset.planeIndex- the plane index within the image.- Returns:
- The complete
Planeat the specified indices. - Throws:
FormatExceptionIOException
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, Plane plane) throws FormatException, IOException
Description copied from interface:ReaderAllows a singlePlaneobject to be reused by reference when opening complete planes.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Throws:
FormatExceptionIOException- See Also:
Reader.openPlane(int, long)
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds) throws FormatException, IOException
Description copied from interface:ReaderCreates aPlanerepresentation of a desired sub-region from the pixels at the specified indices.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Parameters:
imageIndex- the image index within the dataset.planeIndex- the plane index within the image.bounds- bounds of the planar axes.- Returns:
- The desired sub-region at the specified indices.
- Throws:
FormatExceptionIOException
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds) throws FormatException, IOException
Description copied from interface:ReaderAllows a singlePlaneobject to be reused by reference when opening sub-regions of planes.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Throws:
FormatExceptionIOException- See Also:
Reader.openPlane(int, long, Interval)
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, SCIFIOConfig config) throws FormatException, IOException
Description copied from interface:ReaderAsReader.openPlane(int, long)with configuration options.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Parameters:
imageIndex- the image index within the dataset.planeIndex- the plane index within the image.config- Configuration information to use for this read.- Returns:
- The complete
Planeat the specified indices. - Throws:
FormatExceptionIOException
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
Description copied from interface:ReaderAsReader.openPlane(int, long, Interval)with configuration options.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Parameters:
imageIndex- the image index within the dataset.planeIndex- the plane index within the image.bounds- bounds of the planar axes.config- Configuration information to use for this read.- Returns:
- The desired sub-region at the specified indices.
- Throws:
FormatExceptionIOException
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, Plane plane, SCIFIOConfig config) throws FormatException, IOException
Description copied from interface:ReaderAllows a singlePlaneobject to be reused by reference when opening complete planes.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Throws:
FormatExceptionIOException- See Also:
Reader.openPlane(int, long, SCIFIOConfig)
-
openPlane
public Plane openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
Description copied from interface:ReaderAllows a singlePlaneobject to be reused by reference when opening sub-regions of planes.- Specified by:
openPlanein interfaceReader- Overrides:
openPlanein classAbstractReaderFilter- Throws:
FormatExceptionIOException- See Also:
Reader.openPlane(int, long, Interval, SCIFIOConfig)
-
getMetadata
public Metadata getMetadata()
Description copied from interface:ReaderGets the type-specific Metadata for this Reader- Specified by:
getMetadatain interfaceReader- Overrides:
getMetadatain classAbstractReaderFilter
-
getPriority
public double getPriority()
- Specified by:
getPriorityin interfaceorg.scijava.Prioritized- Overrides:
getPriorityin classorg.scijava.plugin.AbstractRichPlugin
-
-