Package mgui.io.domestic.shapes
Class VolumeFileLoader
java.lang.Object
mgui.io.FileLoader
mgui.io.domestic.shapes.InterfaceShapeLoader
mgui.io.domestic.shapes.VolumeFileLoader
- All Implemented Interfaces:
InterfaceIO,IconObject
- Direct Known Subclasses:
FSLVolumeLoader,InterfileLoader,NiftiVolumeLoader,VolFileLoader,WunilVolumeLoader
public abstract class VolumeFileLoader extends InterfaceShapeLoader
Loader for reading from a volume (3D grid) file into a
Volume3DInt object.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description doubledataMaxdoubledataMinbooleanflipXbooleanflipYbooleanflipZprotected floatmaxAlphaprotected floatminAlphaprotected booleansetAlphaFields inherited from class mgui.io.FileLoader
dataFile, dataURL, options -
Constructor Summary
Constructors Constructor Description VolumeFileLoader() -
Method Summary
Modifier and Type Method Description VolumeInputOptionsgetDefaultOptions()Returns a default set of options for loading a volume with this loader.javax.swing.IcongetObjectIcon()Returns theIconassociated with this object.java.util.ArrayList<java.lang.Class<?>>getSupportedObjects()Returns a list of classes for objects which are supported by this I/O interfaceintgetVolCount()Volume3DIntgetVolume3D()Volume3DIntgetVolume3D(int t)Load the volume at time point t.Volume3DIntgetVolume3D(int v, ProgressUpdater progress_bar)Creates and returns a grid based on the metadata.Volume3DIntgetVolume3D(VolumeInputOptions options)Creates and returns a grid based on the parameters inoptions.Volume3DIntgetVolume3D(VolumeInputOptions options, int v, ProgressUpdater progress_bar)Creates and returns a grid based on the metadata.protected Volume3DIntgetVolume3DCustom(VolumeInputOptions options, int v, ProgressUpdater progress_bar)Creates and returns a grid based on the parameters inoptions.abstract VolumeMetadatagetVolumeMetadata()Returns a set of metadata describing the current volume file.booleanload(InterfaceIOOptions options, ProgressUpdater progress_bar)Loads data from the set of files or URLs specified byoptions.java.lang.ObjectloadObject(ProgressUpdater progress_bar, InterfaceIOOptions options)Loads data into an instance of the object corresponding to this loader.InterfaceShapeloadShape(ShapeInputOptions options, ProgressUpdater progress_bar)Loads a shape with the givenoptions.Volume3DIntloadVolume()Load the volume at the current file, with default options.Volume3DIntloadVolume(ProgressUpdater progress_bar)Load the volume at the current file.Volume3DIntloadVolume(VolumeInputOptions options, ProgressUpdater progress_bar)Load the volume at the current file, with the given options.voidsetAlpha(boolean set)voidsetAlpha(boolean set, float min, float max)booleansetVolume3D(Volume3DInt volume, int v, VolumeInputOptions options)booleansetVolume3D(Volume3DInt volume, int v, VolumeInputOptions options, ProgressUpdater progress)booleansetVolume3D(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)booleansetVolume3D(Volume3DInt volume, VolumeInputOptions options)protected abstract booleansetVolume3DBlocking(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)protected booleansetVolume3DWorker(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)Methods inherited from class mgui.io.FileLoader
getComplementIOType, getFailureMessage, getFile, getIOType, getOptions, getProgressMessage, getSuccessMessage, getTitle, getWriterComplement, load, load, loadObject, loadObject, loadObject, setFile, setOptions, setURL, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
setAlpha
protected boolean setAlpha -
minAlpha
protected float minAlpha -
maxAlpha
protected float maxAlpha -
flipX
public boolean flipX -
flipY
public boolean flipY -
flipZ
public boolean flipZ -
dataMax
public double dataMax -
dataMin
public double dataMin
-
-
Constructor Details
-
VolumeFileLoader
public VolumeFileLoader()
-
-
Method Details
-
loadShape
public InterfaceShape loadShape(ShapeInputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from class:InterfaceShapeLoaderLoads a shape with the givenoptions.- Specified by:
loadShapein classInterfaceShapeLoader- Returns:
- Throws:
java.io.IOException
-
getVolCount
public int getVolCount() -
getVolume3D
-
getVolumeMetadata
public abstract VolumeMetadata getVolumeMetadata() throws java.io.IOException, java.io.FileNotFoundExceptionReturns a set of metadata describing the current volume file.- Returns:
- Throws:
java.io.IOExceptionjava.io.FileNotFoundException
-
loadObject
public java.lang.Object loadObject(ProgressUpdater progress_bar, InterfaceIOOptions options) throws java.io.IOExceptionDescription copied from class:FileLoaderLoads data into an instance of the object corresponding to this loader. If loaded object is of typePersistentObject, this method should also set the file loader and reference URL for the object. TODO: make generic?- Overrides:
loadObjectin classInterfaceShapeLoader- Parameters:
progress_bar- An optional progress updater. Can benull.options- Options defining the loading process- Returns:
- Throws:
java.io.IOException
-
loadVolume
Load the volume at the current file, with the given options.- Parameters:
options-progress_bar-- Returns:
-
loadVolume
Load the volume at the current file, with default options.- Returns:
-
loadVolume
Load the volume at the current file.- Parameters:
progress_bar-- Returns:
-
getVolume3D
Load the volume at time point t.- Parameters:
t-- Returns:
- Throws:
ShapeIOException
-
getVolume3D
Creates and returns a grid based on the parameters inoptions.- Parameters:
options-- Returns:
-
getVolume3D
Creates and returns a grid based on the metadata.- Parameters:
options-- Returns:
-
getVolume3D
Creates and returns a grid based on the metadata.- Parameters:
options-- Returns:
-
getDefaultOptions
Returns a default set of options for loading a volume with this loader.- Returns:
-
getVolume3DCustom
protected Volume3DInt getVolume3DCustom(VolumeInputOptions options, int v, ProgressUpdater progress_bar)Creates and returns a grid based on the parameters inoptions. Use this method to override the metadata if necessary.- Parameters:
options-- Returns:
-
setVolume3D
- Throws:
ShapeIOException
-
setVolume3D
public boolean setVolume3D(Volume3DInt volume, int v, VolumeInputOptions options) throws ShapeIOException- Throws:
ShapeIOException
-
setVolume3D
public boolean setVolume3D(Volume3DInt volume, int v, VolumeInputOptions options, ProgressUpdater progress) throws ShapeIOException- Throws:
ShapeIOException
-
setVolume3D
public boolean setVolume3D(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress) throws ShapeIOException- Throws:
ShapeIOException
-
setVolume3DWorker
protected boolean setVolume3DWorker(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress) -
setVolume3DBlocking
protected abstract boolean setVolume3DBlocking(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress) throws ShapeIOException- Throws:
ShapeIOException
-
setAlpha
public void setAlpha(boolean set, float min, float max) -
setAlpha
public void setAlpha(boolean set) -
load
Description copied from class:FileLoaderLoads data from the set of files or URLs specified byoptions. Loading is controlled by the specifications ofoptions. If loaded object is of typePersistentObject, this method should also set the file loader and reference URL for the object.This method should also set the URL reference and writer and loader attributes to match this one and its complement.
- Overrides:
loadin classInterfaceShapeLoaderprogress_bar- An optional progress updater. Can benull.- Returns:
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin interfaceIconObject- Overrides:
getObjectIconin classFileLoader- Returns:
-
getSupportedObjects
public java.util.ArrayList<java.lang.Class<?>> getSupportedObjects()Description copied from interface:InterfaceIOReturns a list of classes for objects which are supported by this I/O interface- Specified by:
getSupportedObjectsin interfaceInterfaceIO- Overrides:
getSupportedObjectsin classFileLoader- Returns:
-