Package mgui.io.standard.nifti
Class NiftiVolumeLoader
java.lang.Object
mgui.io.FileLoader
mgui.io.domestic.shapes.InterfaceShapeLoader
mgui.io.domestic.shapes.VolumeFileLoader
mgui.io.standard.nifti.NiftiVolumeLoader
- All Implemented Interfaces:
InterfaceIO
,IconObject
public class NiftiVolumeLoader extends VolumeFileLoader
File loader to read Analyze 7.5 format volume files. Has methods to read from
both header (.hdr) and volume (.img) files.
See http://www.mayo.edu/PDF/ANALYZE75.pdf for details on this format.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description java.io.File
header
boolean
is_nifti
java.io.File
transform
java.io.File
volume
Fields inherited from class mgui.io.domestic.shapes.VolumeFileLoader
dataMax, dataMin, flipX, flipY, flipZ, maxAlpha, minAlpha, setAlpha
Fields inherited from class mgui.io.FileLoader
dataFile, dataURL, options
-
Constructor Summary
Constructors Constructor Description NiftiVolumeLoader()
NiftiVolumeLoader(java.io.File input)
NiftiVolumeLoader(java.io.File input, boolean trans)
-
Method Summary
Modifier and Type Method Description Box3D
getBoundingBox()
java.io.File
getFile()
Returns the current data file for this loader.int
getVolCount()
VolumeMetadata
getVolumeMetadata()
Returns a set of metadata describing the current volume file.InterfaceIOType
getWriterComplement()
Returns theInterfaceIOType
of aFileWriter
which is the complement of this loader; i.e., writes what this loader reads with identical encoding.boolean
hasVol(int v)
protected void
init(java.io.File input, boolean trans)
NiftiMetadata
readHeader()
void
setFile(java.io.File input)
Sets the current File for this loader.protected boolean
setVolume3DBlocking(Volume3DInt volume3d, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress)
void
writeHeader(NiftiMetadata h)
Methods inherited from class mgui.io.domestic.shapes.VolumeFileLoader
getDefaultOptions, getObjectIcon, getSupportedObjects, getVolume3D, getVolume3D, getVolume3D, getVolume3D, getVolume3D, getVolume3DCustom, load, loadObject, loadShape, loadVolume, loadVolume, loadVolume, setAlpha, setAlpha, setVolume3D, setVolume3D, setVolume3D, setVolume3D, setVolume3DWorker
Methods inherited from class mgui.io.FileLoader
getComplementIOType, getFailureMessage, getIOType, getOptions, getProgressMessage, getSuccessMessage, getTitle, load, load, loadObject, loadObject, loadObject, setOptions, setURL, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
header
public java.io.File header -
volume
public java.io.File volume -
transform
public java.io.File transform -
is_nifti
public boolean is_nifti
-
-
Constructor Details
-
NiftiVolumeLoader
public NiftiVolumeLoader() -
NiftiVolumeLoader
public NiftiVolumeLoader(java.io.File input) -
NiftiVolumeLoader
public NiftiVolumeLoader(java.io.File input, boolean trans)
-
-
Method Details
-
setFile
public void setFile(java.io.File input)Description copied from class:FileLoader
Sets the current File for this loader. Sets the URL tonull
.- Specified by:
setFile
in interfaceInterfaceIO
- Overrides:
setFile
in classFileLoader
-
getFile
public java.io.File getFile()Description copied from class:FileLoader
Returns the current data file for this loader.- Overrides:
getFile
in classFileLoader
- Returns:
-
init
protected void init(java.io.File input, boolean trans) throws java.io.IOException- Throws:
java.io.IOException
-
getBoundingBox
-
readHeader
-
getVolumeMetadata
Description copied from class:VolumeFileLoader
Returns a set of metadata describing the current volume file.- Specified by:
getVolumeMetadata
in classVolumeFileLoader
- Returns:
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
writeHeader
-
hasVol
public boolean hasVol(int v) -
getVolCount
public int getVolCount()- Overrides:
getVolCount
in classVolumeFileLoader
-
setVolume3DBlocking
protected boolean setVolume3DBlocking(Volume3DInt volume3d, java.lang.String column, int v, VolumeInputOptions options, ProgressUpdater progress) throws ShapeIOException- Specified by:
setVolume3DBlocking
in classVolumeFileLoader
- Throws:
ShapeIOException
-
getWriterComplement
Description copied from class:FileLoader
Returns theInterfaceIOType
of aFileWriter
which is the complement of this loader; i.e., writes what this loader reads with identical encoding. Transfer between loader and writer should be lossless.Returns
null
if no complement is defined.- Overrides:
getWriterComplement
in classFileLoader
- Returns:
-