|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.multisliceimage.MultiSliceImage
com.xinapse.multisliceimage.Analyze.ANZImage
com.xinapse.multisliceimage.Analyze.NIFTIImage
public class NIFTIImage
This class is a representation of a multi-dimensional image in the NIFTI-1 format (see The Neuroimaging Informatics Technology Initiative), an extension of the original Analyze 7.5 format (see The Biomedical Imaging Resource). A NIFTIImage Object can be created either from two data sources (one for the header, the other for the image data), one data source (a combined header/image source), or it can be created afresh.
Both big-endian and little-endian byte ordering are implemented and supported. When reading existing images, the byte order is auto detected. When existing images are copied or modified, the original byte order is retained. For images newly-created from scratch by this package, the byte ordering the native byte order.
N.B. The Analyze format requires that for BINARY images, individual slices must begin on a byte boundary. In this implementation, that restriction is removed. If you wish to maintain compatibility with Analyze and other programs that maintain this restriction, please ensure that a multi-slice/multi-frame images have slices with a number of pixels that is a multiple of 8 (bits).
N.B. When the pixel values are returned by methods such as getPix() and getSlice(), these are the intensities of the data primities values stored on disk or help in memory. They are not scaled according to the intensity rescaling factors that are part of the NIFTI-1 standard. To get the pixel values intended by the setter of the intensity rescaling factors, you will need to perform any intensity rescaling yourself.
| Field Summary | |
|---|---|
static java.lang.String |
COMPRESSED_EXTENSION
The file extension for compressed NIFTI image files. |
static java.lang.String |
COMPRESSED_PROPERTY_KEY
The property value key for setting whether NIFTI images should be stored compressed, or uncompressed. |
static boolean |
DEFAULT_COMPRESSED
Whether to store NIFTI images compressed by default. |
static boolean |
DEFAULT_NIFTI_ONE_FILE
Whether to store NIFTI images in one file (.nii) by default. |
static java.lang.String |
EXTENSION
The file extension for NIFTI image files. |
static java.lang.String |
ONE_FILE_PROPERTY_KEY
The property value key for setting whether NIFTI images should be stored in one file, or two. |
static java.lang.String |
UPPERCASE_COMPRESSED_EXTENSION
The file extension for compressed NIFTI image files in upper case form. |
static java.lang.String |
UPPERCASE_EXTENSION
The file extension for NIFTI image files in upper case form. |
| Fields inherited from class com.xinapse.multisliceimage.Analyze.ANZImage |
|---|
COMPRESSED_UPPERCASE_EXTENSION |
| Constructor Summary | |
|---|---|
NIFTIImage(ANZPixFormat dataType,
java.lang.Short... dims)
Creates a new in-memory NIFTIImage. |
|
NIFTIImage(java.io.File f,
NIFTIHeader header)
Creates a new disk-based NIFTIImage, using an existing header as a template for the new image. |
|
NIFTIImage(NIFTIHeader hdr)
Creates a new in-memory NIFTIImage, using information from an existing NIFTIHeader. |
|
NIFTIImage(short nCols,
short nRows,
short nSlices,
short nFrames,
ANZPixFormat dataType)
Creates a new in-memory NINFIImage. |
|
NIFTIImage(java.lang.String filename,
ANZPixFormat dataType,
java.lang.Short... dims)
Creates a new disk-based NIFTIImage. |
|
NIFTIImage(java.lang.String filename,
NIFTIHeader header)
Creates a new disk-based NIFTIImage, using an existing header as a template for the new image. |
|
NIFTIImage(java.lang.String filename,
short nCols,
short nRows,
short nSlices,
short nFrames,
ANZPixFormat dataType)
Creates a new disk-based NIFTIImage. |
|
NIFTIImage(java.lang.String filename,
java.lang.String mode)
Opens an existing NIFTIImage, with pixel data remaining on disk until requested. |
|
| Method Summary | |
|---|---|
void |
addExtendedData(com.xinapse.multisliceimage.Analyze.ExtendedData extendedData)
Adds a block of ExtendedData to this NIFTIImage. |
void |
appendAuditInfo(java.lang.String name,
java.lang.String value)
Appends audit trail information to this image. |
void |
appendInfoList(InfoList infoList)
Appends an InfoList to the existing general file info of this image. |
void |
appendInfoList(InfoList infoList,
int dim,
int n)
Appends an InfoList to that for a particular dimension of this image. |
void |
close()
Closes a NIFTIImage and frees up resources. |
static java.lang.String |
getCommonName()
Returns the common name for this type of image. |
float[] |
getDWBMatrix(int slice)
Returns the diffusion-weighting b-matrix for one slice of this image. |
float |
getDWbValue(int slice)
Returns the diffusion-weighting b-value for one slice of this image. |
javax.vecmath.Vector3f |
getDWGradientVector(int slice)
Returns the diffusion-weighting gradient-vector for one slice of this image. |
java.util.List<com.xinapse.multisliceimage.Analyze.ExtendedData> |
getExtendedData()
Returns a java.util.List of ExtendedData for this NIFTIImage. |
float |
getFlipAngle()
Returns the excitation pulse flip angle for this image. |
java.lang.String |
getHTMLDescription(int slice)
Returns a String description of a slice of this image in HTML format. |
javax.vecmath.Vector3f[] |
getImageOrientationPatient(int slice)
Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient coordinates. |
javax.vecmath.Point3f |
getImagePositionPatient(int slice)
Returns the coordinates of the center of the first pixel of the specified slice of this image, in mm, in patient coordinates. |
java.lang.String |
getInfo(java.lang.String name)
Returns a string representing the value of this information item in the general image information. |
java.lang.String |
getInfo(java.lang.String name,
int dim,
int n)
Returns a java.lang.String representing the value of this information item in a particular dimension of this image. |
InfoList |
getInfoList()
Returns an InfoList object which is the general info for this image. |
InfoList |
getInfoList(int dim,
int n)
Returns an InfoList object applying to a particular dimension/element for this image. |
MultiSliceImage |
getInstance(java.lang.Class cl,
int nSlices)
Creates a new in-memory MultiSliceImage with the MultiSliceImage class given by the argument, possibly changing the number of slices in the image. |
float[] |
getIntensityRescale()
Returns the values m and b in the relationship between pixel intensity (I) values and the output units specified in getRescaleUnits() in the expression: Output units = m*I + b. |
NIFTIIntent |
getIntent()
Returns the NIFTIIntent in this NIFTIImage. |
Modality |
getModality()
Returns the modality with which this image was acquired. |
java.util.Date |
getPatientDoB()
Returns the patient's date of birth for this image. |
java.lang.String |
getPatientID()
Returns the patient ID for this image. |
java.lang.String |
getPatientName()
Returns the patient name for this image. |
PatientPosition |
getPatientPosition()
Returns the position in which the patient is lying in the scanning equipment. |
static boolean |
getPreferredCompressed()
Returns the user's preference about whether NIFTI images should be stored compressed. |
static boolean |
getPreferredNIFTIOneFile()
Returns the user's preference about whether NIFTI images should be stored in two separate files (.hdr and .hdr) or one (.nii). |
static PreviewIcon |
getPreviewIcon(java.io.File f)
Returns the PreviewIcon for an NIFTIImage, or null if the supplied File does not represent a NIFTI image. |
java.lang.String |
getPulseSequence()
Returns the pulse sequence name for this image. |
NIFTIXForm |
getQForm()
Returns the qForm in this NIFTIImage. |
java.lang.String |
getRescaleUnits()
Returns the intent name, or "arbitrary units", if the intent name is not set. |
java.util.Date |
getScanDate()
Returns the scan date for this image. |
PulseSequenceType |
getScanningSequence()
Returns the scanning sequence for this image. |
float |
getScanTE()
Returns the scan echo time for this image if it has a single echo-time. |
float |
getScanTE(int slice)
Returns the scan echo time for one slice of this image. |
float |
getScanTI()
Returns the scan inversion time for this image. |
float |
getScanTR()
Returns the scan repetition time for this image. |
PulseSequenceVariant |
getSequenceVariant()
Returns the scanning sequence variant for this image. |
NIFTIXForm |
getSForm()
Returns the sForm in this NIFTIImage. |
AffineTransform3D |
getSFormAffineTransform()
Returns the general (sForm) AffineTransform3D that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in a patient-centric coordinate system. |
java.lang.String |
getSimpleName()
Returns the simple name for this type of image - the String that should be seen by the users to identify this type of image. |
java.lang.String |
getSliceInfo(java.lang.String name,
int slice)
Returns a java.lang.String representing the value of this information item in a particular slice of this image. |
InfoList |
getSliceInfoList(int slice)
Returns an InfoList object applying to a particular slice of this image. |
float |
getSliceThickness()
Returns the slice thickness (in mm). |
static boolean |
imageExists(java.lang.String filename)
Tests whether a NIFTIImage with the given name already exists on disk. |
static void |
main(java.lang.String[] args)
Run the self-test for the NIFTIImage class. |
void |
putInfo(java.lang.String name,
float value)
Adds an item to the general file info. |
void |
putInfo(java.lang.String name,
float value,
int dim,
int n)
Adds an item to the dimension-specific information. |
void |
putInfo(java.lang.String name,
int value)
Adds an item to the general file info. |
void |
putInfo(java.lang.String name,
int value,
int dim,
int n)
Adds an item to the dimension-specific information. |
void |
putInfo(java.lang.String name,
java.lang.String value)
Adds an item to the general file info. |
void |
putInfo(java.lang.String name,
java.lang.String value,
int dim,
int n)
Adds an item to the dimension-specific information. |
void |
putSliceInfo(InfoList infoList,
int slice)
Adds all the items in an InfoList to the slice-specific information. |
void |
putSliceInfo(java.lang.String name,
java.lang.String value,
int slice)
Adds an item to the slice-specific information. |
void |
removeExtendedData(com.xinapse.multisliceimage.Analyze.ExtendedData extendedData)
Removes a block of ExtendedData from this NIFTIImage. |
void |
removeInfo(java.lang.String name)
Removes an item from the general file information. |
void |
removeInfo(java.lang.String name,
int dim,
int n)
Removes an item from the dimension-specific information. |
static void |
savePreferredCompressed(boolean compressed)
Sets the user's preference about whether NIFTI images should be stored compressed. |
static void |
savePreferredNIFTIOneFile(boolean oneFile)
Sets the user's preference about whether NIFTI images should be stored in two separate files (.hdr and .hdr) or one (.nii). |
void |
setDWBMatrix(float[] bMatrix,
int slice)
Sets the diffusion-weighting B-matrix for one slice of this image. |
void |
setDWbValue(float bValue,
int slice)
Sets the diffusion-weighting b-value for one slice of this image. |
void |
setDWGradientVector(javax.vecmath.Vector3f gradVec,
int slice)
Sets the diffusion-weighting gradient vector for one slice of this image. |
void |
setFlipAngle(float flipAngle)
Sets the excitation pulse flip angle for this image. |
void |
setImageOrientationPatient(javax.vecmath.Vector3f[] dirCos,
int slice)
Sets the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (LPS) coordinates. |
void |
setImagePositionPatient(javax.vecmath.Point3f position,
int slice)
Sets the coordinates of the center of the first pixel of the image, in mm, in patient (LPS) coordinates, for one slice of this image. |
void |
setInfoList(InfoList infoList)
Sets a new InfoList to the general file info of this image. |
void |
setInfoList(InfoList infoList,
int dim,
int n)
Sets a new InfoList a specific dimension of this image. |
void |
setIntensityRescale(float[] rescale)
Sets the values m and b in the relationship between pixel intensity (I) values and the output units specified in setRescaleUnits() in the expression: Output units = m*I + b. |
void |
setIntent(NIFTIIntent intent)
Sets the NIFTIIntent in this NIFTIImage. |
void |
setModality(Modality modality)
Sets the modality with which this image was acquired. |
void |
setPatientDoB(java.util.Date patientDoB)
Sets the patient's date of birth for this image. |
void |
setPatientID(java.lang.String patientID)
Sets the patient ID for this image. |
void |
setPatientName(java.lang.String patientName)
Attempts to set the patient name for this image. |
void |
setPatientPosition(PatientPosition position)
Sets the position in which the patient is lying in the scanning equipment for this MultiSliceImage. |
void |
setPulseSequence(java.lang.String seqName)
Sets the pulse sequence name for this image. |
void |
setQForm(NIFTIXForm qForm)
Sets the qForm code in this NIFTIImage. |
void |
setRescaleUnits(java.lang.String unitsString)
Sets the intent name. |
void |
setScanDate(java.util.Date scanDate)
Sets the scan date/time for this image. |
void |
setScanningSequence(PulseSequenceType seq)
Sets the DICOM scanning sequence for this image. |
void |
setScanTE(float TE)
Sets the scan echo time for this image, for single-echo-time images. |
void |
setScanTE(float TE,
int slice)
Sets the scan echo time for one slice of this image. |
void |
setScanTI(float TI)
Sets the scan inversion time for this image. |
void |
setScanTR(float TR)
Sets the scan repetition time for this image. |
void |
setSequenceVariant(PulseSequenceVariant seqVar)
Sets the DICOM scanning sequence variant for this image. |
void |
setSForm(NIFTIXForm sForm)
Sets the sForm code in this NIFTIImage. |
void |
setSliceInfoList(InfoList infoList,
int slice)
Sets a new InfoList a specific slice of this image. |
void |
setSliceThickness(float thickness)
Sets the slice thickness (in mm). |
java.lang.String |
write(java.lang.String root)
Writes this NIFTIImage to disk. |
| Methods inherited from class com.xinapse.multisliceimage.Analyze.ANZImage |
|---|
clone, getByteOrder, getDataType, getDescription, getDescription, getDims, getFileDataOffset, getHeader, getHTMLDescription, getImageOrientationPatient, getImagePositionPatient, getIntensityRescale, getMax, getMin, getNativeColourMapping, getNCols, getNDim, getNFrames, getNRows, getNSlices, getPixelDataType, getPixelXSize, getPixelYSize, getPixelZSize, getTimeBetweenFrames, getTitle, getTotalNSlices, isCompressed, isOpen, setDBName, setDescription, setImageOrientationPositionPatient, setIntensityRescale, setMinMax, setNativeColourMapping, setPixelSpacing, setPixelXSize, setPixelYSize, setPixelZSize, setTimeBetweenFrames, setTitle, toString, write |
| Methods inherited from class com.xinapse.multisliceimage.MultiSliceImage |
|---|
autoResample, checkMinMax, crop, deleteImage, exists, export, export, export, getClasses, getDateFormat, getFrameOfReferenceUID, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getMostLikePlane, getNPixels, getPix, getPix, getPix, getPix, getPix, getPreferredImageClass, getPreview, getROIs, getScanDateFormat, getSlice, getSlice, getSliceDim, getSuggestedFileName, isImage, isModified, pad, parseMultiValuedString, putPix, putPix, putPix, putPix, putSlice, reorient, reorientRadiological, reSample, reSample, savePreferredImageClass, set3DBlockParameters, setMinMax, setModified, setOrientationPositionRadiological, setSuggestedFileName, toBufferedImage |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ONE_FILE_PROPERTY_KEY
public static final java.lang.String COMPRESSED_PROPERTY_KEY
public static final boolean DEFAULT_NIFTI_ONE_FILE
public static final boolean DEFAULT_COMPRESSED
public static final java.lang.String EXTENSION
public static final java.lang.String UPPERCASE_EXTENSION
public static final java.lang.String COMPRESSED_EXTENSION
public static final java.lang.String UPPERCASE_COMPRESSED_EXTENSION
| Constructor Detail |
|---|
public NIFTIImage(short nCols,
short nRows,
short nSlices,
short nFrames,
ANZPixFormat dataType)
throws ANZException,
java.io.IOException
nCols - the number of columns in the image x-direction.nRows - the number of rows in the image y-direction.nSlices - the number of slice in the image.nFrames - the number of frames (time points) in the image.dataType - the ANZPixFormat for the image.
ANZException - if the image cannot be created.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(ANZPixFormat dataType,
java.lang.Short... dims)
throws ANZException,
java.io.IOException
dims - the number of samples in each of the image dimensions. The number of
arguments supplied determines the dimensionality of the image.dataType - an ANZPixFormat.
ANZException - if the header cannot be created.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(NIFTIHeader hdr)
throws ANZException,
java.io.IOException
hdr - the NIFTIHeader that will be used for dimensional information etc.
ANZException - if the image cannot be created.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(java.lang.String filename,
short nCols,
short nRows,
short nSlices,
short nFrames,
ANZPixFormat dataType)
throws java.io.IOException,
ANZException
filename - the root of the Analyze file name (i.e. without the ".img" or ".hdr"
extension). If the filename does have an extension, this this will be handled.nCols - the number of columns in the image x-direction.nRows - the number of rows in the image y-direction.nSlices - the number of slice in the image.nFrames - the number of frames (time points) in the image.dataType - the ANZPixFormat for the image.
ANZException - if the NIFTIImage cannot be instantiated.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(java.lang.String filename,
ANZPixFormat dataType,
java.lang.Short... dims)
throws java.io.IOException,
ANZException
filename - the root of the NIFTI file name (i.e. without any ".img" ".hdr", ".nii",
".img.gz", ".hdr.gz" or ".nii.gz" extension). If the filename does have an
extension, this this will be handled gracefully.dims - the number of samples in each of the image dimensions. The number of
arguments supplied determines the dimensionality of the image.dataType - an ANZPixFormat.
ANZException - if the header cannot be created.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(java.io.File f,
NIFTIHeader header)
throws java.io.IOException,
ANZException
f - the File object that will form the root of the Analyze file name
(i.e. without the ".hdr" extension). If f's name does have an
extension, this this will be handled.header - the NIFTIHeader to use as the template.
ANZException - if the new image cannot be created on disk.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(java.lang.String filename,
NIFTIHeader header)
throws java.io.IOException,
ANZException
filename - the image file name (possibly without any ".hdr" or ".nii"
extension). If the filename has no extension, then the decision about whether to save the
image in a NIFTI one-file format (.nii) and whether it will be compressed
(.hdr.gz/.img.gz/.nii.gz) will be made according to the user preferences.
If the filename does have an extension, this this will override the user preferences,
and will be handled as follows:
header - the ANZHeader to use as the template.
ANZException - if the new image cannot be created on disk.
java.io.IOException - if an I/O error occurs.
public NIFTIImage(java.lang.String filename,
java.lang.String mode)
throws MultiSliceImageException,
java.io.IOException,
java.io.FileNotFoundException
filename - the name of the image file.mode - the open mode. Can be either "r" (read-only) or "rw" (read-write).
MultiSliceImageException - if the image cannot be opened or loaded, or
if mode is invalid.
java.io.FileNotFoundException - if the image file doesn't exist.
java.io.IOException - if an I/O error occurs.| Method Detail |
|---|
public static boolean getPreferredNIFTIOneFile()
If the system property "nifti.onefile" exists, and the property value is either "true" or "false", then the user's preference is overridden by the property value.
public static void savePreferredNIFTIOneFile(boolean oneFile)
oneFile - true if the user prefers to store NIFTI-compliant images in
one .nii file; false otherwise.public static boolean getPreferredCompressed()
If the system property "nifti.compressed" exists, and the property value is either "true" or "false", then the user's preference is overridden by the property value.
public static void savePreferredCompressed(boolean compressed)
compressed - true if the user prefers to store NIFTI-compliant images
compressed.
public MultiSliceImage getInstance(java.lang.Class cl,
int nSlices)
throws java.io.IOException,
MultiSliceImageException
MultiSliceImage
getInstance in class ANZImagecl - the class of image to be written (e.g.
com.xinapse.multisliceimage.UNC.UNCImage.class).nSlices - the number of slices in the image that is to be written.
java.io.IOException - if an I/O error occurs.
MultiSliceImageException - if the image cannot be written.public static boolean imageExists(java.lang.String filename)
filename - the name of the image file to test for existence.
public static PreviewIcon getPreviewIcon(java.io.File f)
f - the File to be tested.
public java.lang.String write(java.lang.String root)
throws java.io.IOException,
MultiSliceImageException
write in class ANZImageroot - the root of the NIFTI filename. Will be appended with
".hdr", ".img", ".nii", ".hdr.gz", ".img.gz" or ".nii.gz" as appropriate to create the
full filename(s).
MultiSliceImageException - if the image cannot be written.
java.io.IOException - if an I/O error occurs.
public void close()
throws java.io.IOException,
MultiSliceImageException
close in interface LoadableImageclose in class ANZImageMultiSliceImageException - if the file cannot be written or closed.
java.io.IOException - if an I/O error occurs.
public javax.vecmath.Point3f getImagePositionPatient(int slice)
throws java.lang.IndexOutOfBoundsException
LoadableImage
getImagePositionPatient in interface LoadableImagegetImagePositionPatient in class ANZImagejava.lang.IndexOutOfBoundsException - if the slice number is bad for this image.
public void setImagePositionPatient(javax.vecmath.Point3f position,
int slice)
MultiSliceImage
setImagePositionPatient in class MultiSliceImageposition - the Left,Posterior,Superior (LPS) coordinates of the first pixel of
this specified slice in the image data matrix.slice - the slice for which to set the position.
public javax.vecmath.Vector3f[] getImageOrientationPatient(int slice)
throws java.lang.IndexOutOfBoundsException
LoadableImage
getImageOrientationPatient in interface LoadableImagegetImageOrientationPatient in class ANZImageslice - the slice for which to return the image orientation.
java.lang.IndexOutOfBoundsException - if the image does not have the right dimensionality
or the slice number is inappropriate for this image.
public void setImageOrientationPatient(javax.vecmath.Vector3f[] dirCos,
int slice)
throws java.lang.IndexOutOfBoundsException
MultiSliceImageIf the orientation cannot be set for this image, this method does nothing.
setImageOrientationPatient in class MultiSliceImagedirCos - the direction cosines of the image row, column and (optionally)
slice directions respectively in Left,Posterior,Superior (LPS) coordinates.slice - the slice for which to set the orientation.
java.lang.IndexOutOfBoundsException - if the cosines array does not have the
correct dimensions.public float[] getIntensityRescale()
LoadableImage
getIntensityRescale in interface LoadableImage
public void setIntensityRescale(float[] rescale)
throws java.io.IOException
MultiSliceImage
setIntensityRescale in class MultiSliceImagerescale - a float[] of length 2 where the first element is m
and the second is b.
java.io.IOException - if an I/O error occurs.public java.lang.String getRescaleUnits()
getRescaleUnits in interface LoadableImagegetRescaleUnits in class ANZImage
public void setRescaleUnits(java.lang.String unitsString)
throws java.io.IOException
setRescaleUnits in class MultiSliceImageunitsString - the new intent name.
java.io.IOException - if the rescaling units cannot be set for this image.public java.lang.String getSimpleName()
MultiSliceImage
getSimpleName in class MultiSliceImagepublic static java.lang.String getCommonName()
public NIFTIXForm getQForm()
public void setQForm(NIFTIXForm qForm)
throws ANZException
qForm - the qForm to set in this NIFTIImage.
ANZException - if the qForm cannot be set.public NIFTIXForm getSForm()
public void setSForm(NIFTIXForm sForm)
throws ANZException
sForm - the sForm to set in this NIFTIImage.
ANZException - if the sForm cannot be set.
public AffineTransform3D getSFormAffineTransform()
throws ParameterNotSetException
// Create a point for the pixel indices.
Point3f ijk = new Point3f(i, j, k);
Point3f lps = new Point3f();
// The lps coordinate of the point is returned.
Point3f lps = header.getAffineTransform().transform(ijk, lps);
ParameterNotSetException - if the AffineTransform cannot be retrieved.public NIFTIIntent getIntent()
public void setIntent(NIFTIIntent intent)
throws ANZException
intent - the NIFTIIntent to set in this NIFTIImage.
ANZException - if the intent cannot be set.public PatientPosition getPatientPosition()
LoadableImage
getPatientPosition in interface LoadableImage
public void setPatientPosition(PatientPosition position)
throws java.io.IOException
MultiSliceImage
setPatientPosition in class MultiSliceImageposition - the position in which the patient is lying in the scanning equipment.
e.g. PatientPosition.HFS (head-first supine).
java.io.IOException - if the patient position cannot be set for this image.
public void setScanDate(java.util.Date scanDate)
throws java.io.IOException
MultiSliceImage
setScanDate in class MultiSliceImagescanDate - the new scan date/time to be assigned to this image.
java.io.IOException - if the scan date cannot be set.
public void setPulseSequence(java.lang.String seqName)
throws java.io.IOException
MultiSliceImage
setPulseSequence in class MultiSliceImageseqName - the new name of the pulse sequence to be assigned to this image.
java.io.IOException - if the pulse sequence name cannot be set.
public void setScanningSequence(PulseSequenceType seq)
throws java.io.IOException
MultiSliceImage
setScanningSequence in class MultiSliceImageseq - the new scanning sequence to be assigned to this image.
java.io.IOException - if the scanning sequence cannot be set.
public void setSequenceVariant(PulseSequenceVariant seqVar)
throws java.io.IOException
MultiSliceImage
setSequenceVariant in class MultiSliceImageseqVar - the new scanning sequence variant to be assigned to this image.
java.io.IOException - if the scanning sequence variant cannot be set.
public float getSliceThickness()
throws ParameterNotSetException
LoadableImage
getSliceThickness in interface LoadableImageParameterNotSetException - if the slice thickness is not set, or its value is corrupt.
public void setSliceThickness(float thickness)
throws java.io.IOException
MultiSliceImage
setSliceThickness in class MultiSliceImagethickness - the slice thickness in mm.
java.io.IOException - if the slice thickness cannot be set for this image, or
if the slice thickness is negative.public Modality getModality()
MultiSliceImage
getModality in interface LoadableImagegetModality in class MultiSliceImage
public void setModality(Modality modality)
throws java.io.IOException
MultiSliceImage
setModality in class MultiSliceImagemodality - the new imaging modality to be assigned to this image.
java.io.IOException - if modality cannot be set.
public float getScanTR()
throws ParameterNotSetException
getScanTR in interface LoadableImageParameterNotSetException - if the TR hasn't been set.
public void setScanTR(float TR)
throws java.io.IOException
setScanTR in class MultiSliceImageTR - the new scan TR to be assigned to this image.
java.io.IOException - if the scan TR cannot be set.
public float getScanTI()
throws ParameterNotSetException
getScanTI in interface LoadableImageParameterNotSetException - if the TI hasn't been set.
public void setScanTI(float TI)
throws java.io.IOException
setScanTI in class MultiSliceImageTI - the new scan TI to be assigned to this image.
java.io.IOException - if the scan TI cannot be set.
public float getScanTE()
throws ParameterNotSetException
getScanTE in interface LoadableImageParameterNotSetException - if the TE hasn't been set.
public void setScanTE(float TE)
throws java.io.IOException
setScanTE in class MultiSliceImageTE - the new scan TE to be assigned to this image.
java.io.IOException - if an I/O error occurs.
public float getScanTE(int slice)
throws ParameterNotSetException,
java.lang.IndexOutOfBoundsException
getScanTE in interface LoadableImageslice - the slice number for which to return the echo time.
ParameterNotSetException - if the TE hasn't been set.
java.lang.IndexOutOfBoundsException - if the slice number is bad for this image.
public void setScanTE(float TE,
int slice)
throws java.io.IOException
MultiSliceImage
setScanTE in class MultiSliceImageTE - the new scan TE to be assigned to this image.slice - the slice number for which to set the echo time.
java.io.IOException - if the scan TE cannot be set.
public float getFlipAngle()
throws ParameterNotSetException
getFlipAngle in interface LoadableImageParameterNotSetException - if the flip angle hasn't been set.
public void setFlipAngle(float flipAngle)
throws java.io.IOException
setFlipAngle in class MultiSliceImageflipAngle - the new scan flip angle to be assigned to this image.
java.io.IOException - if an I/O error occurs.
public float getDWbValue(int slice)
throws ParameterNotSetException,
java.lang.IndexOutOfBoundsException
LoadableImage
getDWbValue in interface LoadableImageslice - the slice number for which to return the b-value.
ParameterNotSetException - if the b-value is not set.
java.lang.IndexOutOfBoundsException - if the slice number is bad for this image.
public void setDWbValue(float bValue,
int slice)
throws java.io.IOException
MultiSliceImage
setDWbValue in class MultiSliceImagebValue - the new b-value to be assigned to this image.slice - the slice number for which to set the b-value.
java.io.IOException - if the scan b-value cannot be set.
public javax.vecmath.Vector3f getDWGradientVector(int slice)
throws ParameterNotSetException,
java.lang.IndexOutOfBoundsException
LoadableImage
getDWGradientVector in interface LoadableImageslice - the slice number for which to return the gradient-vector.
ParameterNotSetException - if the gradient-vector is not set.
java.lang.IndexOutOfBoundsException - if the slice number is bad for this image.
public void setDWGradientVector(javax.vecmath.Vector3f gradVec,
int slice)
throws java.io.IOException
MultiSliceImage
setDWGradientVector in class MultiSliceImagegradVec - the new gradient vector to be assigned to this image.slice - the slice number for which to set the gradient vector.
java.io.IOException - if the scan gradient vector cannot be set.
public float[] getDWBMatrix(int slice)
throws ParameterNotSetException,
java.lang.IndexOutOfBoundsException
LoadableImage
getDWBMatrix in interface LoadableImageslice - the slice number for which to get the b-matrix.
ParameterNotSetException - if the b-matrix cannot be found, or if the
modality used to collect the image doesn't have a b-matrix defined.
java.lang.IndexOutOfBoundsException
public void setDWBMatrix(float[] bMatrix,
int slice)
throws java.io.IOException
MultiSliceImage
setDWBMatrix in class MultiSliceImagebMatrix - the new B-matrix to be assigned to this image.slice - the slice number for which to set the B-matrix.
java.io.IOException - if the scan B-matrix cannot be set.public java.lang.String getPatientName()
getPatientName in interface LoadableImage
public void setPatientName(java.lang.String patientName)
throws java.io.IOException
MultiSliceImage
setPatientName in class MultiSliceImagepatientName - the new patient name to be assigned to this image.
java.io.IOException - if the patient name cannot be set.public java.lang.String getPatientID()
getPatientID in interface LoadableImage
public void setPatientID(java.lang.String patientID)
throws java.io.IOException
MultiSliceImage
setPatientID in class MultiSliceImagepatientID - the new patient ID to be assigned to this image.
java.io.IOException - if the patient ID cannot be set.public java.util.Date getPatientDoB()
getPatientDoB in interface LoadableImage
public void setPatientDoB(java.util.Date patientDoB)
throws java.io.IOException
MultiSliceImage
setPatientDoB in class MultiSliceImagepatientDoB - the new patient date of birth to be assigned to this image.
java.io.IOException - if the patient date of birth cannot be set.public java.util.Date getScanDate()
getScanDate in interface LoadableImage
public java.lang.String getPulseSequence()
throws ParameterNotSetException
getPulseSequence in interface LoadableImageParameterNotSetException - if the pulse sequence name hasn't been set.
public PulseSequenceType getScanningSequence()
throws ParameterNotSetException
getScanningSequence in interface LoadableImageParameterNotSetException - if the scanning sequence hasn't been set.
public PulseSequenceVariant getSequenceVariant()
throws ParameterNotSetException
getSequenceVariant in interface LoadableImageParameterNotSetException - if the scanning sequence variant hasn't been set.
public void appendAuditInfo(java.lang.String name,
java.lang.String value)
throws java.io.IOException
appendAuditInfo in interface LoadableImagename - a String describing the name of the action that was performed on this image.value - a String describing the value of the action that was performed on this image.
java.io.IOException - if an I/O error occurs.
public void putInfo(java.lang.String name,
int value)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information field to put.value - an integer value to be associated with this name in the general file
information.
java.io.IOException - if the information cannot be added.
public void putInfo(java.lang.String name,
float value)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information to put.value - a floating point value to be associated with this name in the general file
information.
java.io.IOException - if the information cannot be addded.
public void putInfo(java.lang.String name,
java.lang.String value)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information to put.value - a java.lang.String to be associated with this name in the general file
information.
java.io.IOException - if the information cannot be addded.
public void putInfo(java.lang.String name,
int value,
int dim,
int n)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information item to put.value - an integer value to be associated with this name in the general file
information.dim - the dimension of this image to put the information item. For example in a
3-dimensional image you would put to dimension 0 for slice-specific info.n - the element to put to. For example in a
3-dimensional image you would put to slice n to info that applied only to slice
n.
java.io.IOException - if the information cannot be addded.
public void putInfo(java.lang.String name,
float value,
int dim,
int n)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information item to put.value - an floating-point value to be associated with this name in the dimension-specific
information.dim - the dimension of this image to put the information. For example in a
3-dimensional image you would put to dimension 0 for slice-specific info.n - the element to put to. For example in a
3-dimensional image you would put to slice n to info that applied only to slice
n.
java.io.IOException - if the information cannot be addded.
public void putInfo(java.lang.String name,
java.lang.String value,
int dim,
int n)
throws java.io.IOException
InfoStorer
putInfo in interface InfoStorername - the name of the information item to put.value - a String value to be associated with this name in the dimension-specific
information.dim - the dimension of this image to put the information. For example in a
3-dimensional image you would put to dimension 0 for slice-specific info.n - the element to put to. For example in a
3-dimensional image you would put to slice n to info that applied only to slice
n.
java.io.IOException - if the information cannot be addded.
public void putSliceInfo(InfoList infoList,
int slice)
throws java.io.IOException
InfoStorer
The slice number is referenced from 0 to (total number of slice - 1) regardless of the
number of samples in the "slice" dimension of the image.
N.B. For disk-based images, the changes in the info will not be
reflected on disk unless the close() method is called.
putSliceInfo in interface InfoStorerinfoList - the list of InfoItems to put.slice - the slice number.
java.io.IOException - if the information cannot be added.
public void putSliceInfo(java.lang.String name,
java.lang.String value,
int slice)
throws java.io.IOException
InfoStorer
The slice number is referenced from 0 to (total number of slice - 1) regardless of the
number of samples in the "slice" dimension of the image.
N.B. For disk-based images, the changes in the info will not be
reflected on disk unless the close() method is called.
putSliceInfo in interface InfoStorername - the name of the information item to put.value - a String to be associated with this name in the slice-specific info.slice - the slice number.
java.io.IOException - if the information cannot be added.
public java.lang.String getInfo(java.lang.String name)
throws InfoNotFoundException
InfoStorerFor example, if there is a item with a name "pixel_x_size" and a value "0.91162" in the general info, and name "pixel_x_size" is supplied, then this method will return "0.91162".
getInfo in interface InfoStorername - the name of this information field.
InfoNotFoundException - if the name is not found in the general info.
public java.lang.String getInfo(java.lang.String name,
int dim,
int n)
throws InfoNotFoundException
InfoStorer
getInfo in interface InfoStorername - the name of this information item.dim - the dimension of this image to look for the information. For example in a
3-dimensional image you would look in dimension 0 for slice-specific info.n - the element to look in. For example in a
3-dimensional image you would look in slice n to info that applied only to slice
n.
InfoNotFoundException - if the name is not found in this dimension/element info.
public java.lang.String getSliceInfo(java.lang.String name,
int slice)
throws InfoNotFoundException
InfoStorerThe slice number is referenced from 0 to (total number of slice - 1) regardless of the number of samples in the "slice" dimension of the image.
getSliceInfo in interface InfoStorername - the name of this information item.slice - the slice number.
InfoNotFoundException - if the name is not found for the specified slice.public void removeInfo(java.lang.String name)
InfoStorer
removeInfo in interface InfoStorername - the name of the information item to be removed.
public void removeInfo(java.lang.String name,
int dim,
int n)
InfoStorer
removeInfo in interface InfoStorername - the name of the information item to put.dim - the dimension of this image to from which to remove the information.
For example in a 3-dimensional image you would put to dimension 0 for slice-specific info.n - the element to from which to remove the info item. For example in a
3-dimensional image you would put to slice n to info that applied only to slice
n.public InfoList getInfoList()
InfoStorer
getInfoList in interface InfoStorer
public void setInfoList(InfoList infoList)
throws java.io.IOException
InfoStorer
setInfoList in interface InfoStorerinfoList - the InfoList object to set to the general file info for this image.
java.io.IOException - if the InfoList cannot be set.
public InfoList getInfoList(int dim,
int n)
InfoStorer
getInfoList in interface InfoStorerdim - the dimension for which to get the information list.n - the element for which to get the information list.
public InfoList getSliceInfoList(int slice)
InfoStorer
getSliceInfoList in interface InfoStorerslice - the slice number.
public void setInfoList(InfoList infoList,
int dim,
int n)
throws java.io.IOException
InfoStorer
setInfoList in interface InfoStorerinfoList - the InfoList to associate with this image/dimension.dim - the dimension to which to set the information list.n - the element to which to set the information list.
java.io.IOException - if the InfoList cannot be set.
public void setSliceInfoList(InfoList infoList,
int slice)
throws java.io.IOException
InfoStorer
setSliceInfoList in interface InfoStorerinfoList - the InfoList to associate with this image/slice.slice - the slice for which to set the information list.
java.io.IOException - if the InfoList cannot be set.
public void appendInfoList(InfoList infoList)
throws java.io.IOException
InfoStorer
appendInfoList in interface InfoStorerinfoList - the InfoList object to append to the general file info for this image.
java.io.IOException - if the InfoList cannot be appended.
public void appendInfoList(InfoList infoList,
int dim,
int n)
throws MultiSliceImageException
appendInfoList in interface InfoStorerinfoList - ths list to append.dim - the diemension for which the InfoList will be appended.n - the element of that dimension for which the InfoList will be appended.
MultiSliceImageException - if the InfoList cannot be appended.
public void addExtendedData(com.xinapse.multisliceimage.Analyze.ExtendedData extendedData)
throws ANZException
extendedData - the ExtendedData to add.
ANZException - if the ExtendedData cannot be added.public java.util.List<com.xinapse.multisliceimage.Analyze.ExtendedData> getExtendedData()
public void removeExtendedData(com.xinapse.multisliceimage.Analyze.ExtendedData extendedData)
throws ANZException
extendedData - the ExtendedData to remove.
ANZException - if the extended data cannot be removed.public java.lang.String getHTMLDescription(int slice)
LoadableImage
getHTMLDescription in interface LoadableImagegetHTMLDescription in class ANZImageslice - the slice number.
public static void main(java.lang.String[] args)
args - a list of images to try to open.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||