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 double
dataMax
double
dataMin
boolean
flipX
boolean
flipY
boolean
flipZ
protected float
maxAlpha
protected float
minAlpha
protected boolean
setAlpha
Fields inherited from class mgui.io.FileLoader
dataFile, dataURL, options
-
Constructor Summary
Constructors Constructor Description VolumeFileLoader()
-
Method Summary
Modifier and Type Method Description VolumeInputOptions
getDefaultOptions()
Returns a default set of options for loading a volume with this loader.javax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.java.util.ArrayList<java.lang.Class<?>>
getSupportedObjects()
Returns a list of classes for objects which are supported by this I/O interfaceint
getVolCount()
Volume3DInt
getVolume3D()
Volume3DInt
getVolume3D(int t)
Load the volume at time point t.Volume3DInt
getVolume3D(int v, ProgressUpdater progress_bar)
Creates and returns a grid based on the metadata.Volume3DInt
getVolume3D(VolumeInputOptions options)
Creates and returns a grid based on the parameters inoptions
.Volume3DInt
getVolume3D(VolumeInputOptions options, int v, ProgressUpdater progress_bar)
Creates and returns a grid based on the metadata.protected Volume3DInt
getVolume3DCustom(VolumeInputOptions options, int v, ProgressUpdater progress_bar)
Creates and returns a grid based on the parameters inoptions
.abstract VolumeMetadata
getVolumeMetadata()
Returns a set of metadata describing the current volume file.boolean
load(InterfaceIOOptions options, ProgressUpdater progress_bar)
Loads data from the set of files or URLs specified byoptions
.java.lang.Object
loadObject(ProgressUpdater progress_bar, InterfaceIOOptions options)
Loads data into an instance of the object corresponding to this loader.InterfaceShape
loadShape(ShapeInputOptions options, ProgressUpdater progress_bar)
Loads a shape with the givenoptions
.Volume3DInt
loadVolume()
Load the volume at the current file, with default options.Volume3DInt
loadVolume(ProgressUpdater progress_bar)
Load the volume at the current file.Volume3DInt
loadVolume(VolumeInputOptions options, ProgressUpdater progress_bar)
Load the volume at the current file, with the given options.void
setAlpha(boolean set)
void
setAlpha(boolean set, float min, float max)
boolean
setVolume3D(Volume3DInt volume, int v, VolumeInputOptions options)
boolean
setVolume3D(Volume3DInt volume, int v, VolumeInputOptions options, ProgressUpdater progress)
boolean
setVolume3D(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)
boolean
setVolume3D(Volume3DInt volume, VolumeInputOptions options)
protected abstract boolean
setVolume3DBlocking(Volume3DInt volume, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)
protected boolean
setVolume3DWorker(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, toString
Methods 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:InterfaceShapeLoader
Loads a shape with the givenoptions
.- Specified by:
loadShape
in 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.IOException
java.io.FileNotFoundException
-
loadObject
public java.lang.Object loadObject(ProgressUpdater progress_bar, InterfaceIOOptions options) throws java.io.IOExceptionDescription copied from class:FileLoader
Loads 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:
loadObject
in 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:FileLoader
Loads 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:
load
in classInterfaceShapeLoader
progress_bar
- An optional progress updater. Can benull
.- Returns:
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Overrides:
getObjectIcon
in classFileLoader
- Returns:
-
getSupportedObjects
public java.util.ArrayList<java.lang.Class<?>> getSupportedObjects()Description copied from interface:InterfaceIO
Returns a list of classes for objects which are supported by this I/O interface- Specified by:
getSupportedObjects
in interfaceInterfaceIO
- Overrides:
getSupportedObjects
in classFileLoader
- Returns:
-