Package com.xinapse.image
Interface ReadableImage
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
WritableImage
- All Known Implementing Classes:
Analyze75Image
,ANZImage
,MultiSliceImage
,NIFTI2Image
,NIFTIImage
,UNCImage
Interface implemented by classes that ensure an image of that class can be read.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A Comparable point in space that can be used to sort positions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes an image and frees up resources.void
Gives this image the option to free up resources by removing access to image data.default AffineTransform3D
Returns theAffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system.default AffineTransform3D
getAffineTransform
(Integer slice) Returns theAffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system for one particular slice of the image.com.xinapse.dicom.BodyPart
Returns the body part imaged.getCopy()
Returns a copy of thisReadableImage
.Returns a String description of this image.getDescription
(int slice) Returns a String description of this one particular slice of this image.int[]
getDims()
Returns the dimensions (numbers of samples in each image dimension) of this image.Returns the scan echo train length for this image.Returns the excitation pulse flip angle for this image.float[]
getFrameDWBMatrix
(int frame) Returns the diffusion-weighting b-matrix for one frame of this image.getFrameDWbValue
(int frame) Returns the diffusion-weighting b-value for one frame of this 4-D image.org.jogamp.vecmath.Vector3f
getFrameDWGradientVector
(int frame) Returns the diffusion-weighting gradient-vector for one frame of this image 4-D image.com.xinapse.dicom.Uid
Returns the frame of reference UID that uniquely identifies the frame of reference for an image.getFrameTriggerDelayMS
(int frame) Returns the trigger delay, in milliseconds, for one frame of this image.Returns a String description of this image in HTML format.getHTMLDescription
(int slice) Returns a String description of a slice of this image in HTML format.org.jogamp.vecmath.Vector3f[]
Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (L,P,S) coordinates.org.jogamp.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.org.jogamp.vecmath.Point3f
Returns the coordinates of the center of the first pixel of the image, in mm, in patient coordinates.org.jogamp.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.float[]
Returns the valuesm
andb
in the relationship between pixel intensity (I) values and the output units specified ingetRescaleUnits()
in the expression:
Output units = m*I + b
.com.xinapse.dicom.Laterality
Returns the image laterality.getMax()
Returns the maximum pixel intensity in the image.getMin()
Returns the minimum pixel intensity in the image.Returns the imaging modality with which this image was collected.Returns the imaging plane that this image is "most like".Returns aColourMapping
if this image has an associated colour mapping.Returns a String showing the 'native' header for this image.int
getNCols()
Returns the number of image columns in this image.int
getNDim()
Returns the dimensionality of this image.int
Returns the number of frames in a multi-frame image.int
getNRows()
Returns the number of image rows in this image.default int
Returns the number of unique slice locations present in the image.int
Returns the number of physical slice locations in this image.Returns the patient date of birth for this image.Returns the patient ID for this image.Returns the patient name for this image.Returns the position in which the patient is lying in the scanning equipment.com.xinapse.dicom.Sex
Returns the patient sex for this image.getPix()
Returns all the pixel values for this image in the order in which they are stored internally, and with intensity values as they are to be presented to the user (i.e., after any intensity rescaling).getPix
(boolean radiological) Returns all the pixel values for this image, optionally returning them in the correct order in which they will be presented, where the first pixel should be presented at the top left corner of the display device.getPix
(int[] pixIdx) Returns a single pixel value from this image.getPix
(int[] lowIdx, int[] highIdx) Returns pixel values from this image.Get pixel values from this image into a specified array.float
Returns the pixel size in the x (horizontal) direction for this image.float
Returns the pixel size in the y (vertical) direction for this image.float
Returns the separation between the centres of image planes for this image.Returns aPixelDataType
representing the data type of pixel values for this image, after any intensity scaling has taken place.Returns the name of the pulse sequence with which this image was collected.com.xinapse.dicom.RescaleUnits
Returns the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved bygetIntensityRescale()
.getROIs()
Returns a List of ROIs that are stored with the image.Returns the scan saturation frequency offset for this image if it has a single saturation frequency offset in parts-per-million.getSaturationFreqOffsetPPM
(int index) Returns the scan saturation frequency offset for one dimension index of this image in parts-per-million.Returns the scan Date for this image.Returns the DICOM Scanning Sequence with which this image was collected.Returns the scan echo time for this image if it has a single echo-time.getScanTE
(int index) Returns the scan echo time for one dimension index of this image.Returns the scan inversion time for this image.Returns the scan repetition time for this image.Returns the DICOM Scanning Sequence Variant with which this image was collected.Returns a short description of the series (scan), such as is provided by the DICOM series description.Returns the series number for this ReadableImage.getSlice
(int slice) Returns the pixel values for one slice of an n-dimensional image, where n > 1.Returns all the pixels for a two-dimensional slice of this image, as a 1-dimensional array of primitive values.float[]
getSliceDWBMatrix
(int slice) Returns the diffusion-weighting b-matrix for one slice of this image.getSliceDWbValue
(int slice) Returns the diffusion-weighting b-value for one slice of this image.org.jogamp.vecmath.Vector3f
getSliceDWGradientVector
(int slice) Returns the diffusion-weighting gradient-vector for one slice of this image.Returns the slice thickness (in mm).getSliceTriggerDelayMS
(int slice) Returns the trigger delay, in milliseconds, for one slice of this image.Returns all the pixel values for this image in the order in which they are stored internally, and in the format they are stored internally.Returns aPixelDataType
representing the data type of this image, as the pixel values are stored on disk.Returns the study ID for this ReadableImage.Returns the suggested file name for in-memory images that are to be saved to disk.float
Returns the time between frames in a 4- or higher dimensional image.getTitle()
Returns the title of this image.int
Returns the total number of slices in this image.boolean
isOpen()
Tests whether this image is still open.
-
Method Details
-
getStoredPixelDataType
PixelDataType getStoredPixelDataType()Returns aPixelDataType
representing the data type of this image, as the pixel values are stored on disk.- Returns:
- the
PixelDataType
representing the data type of this image as stored on disk.
-
getPresentationPixelDataType
PixelDataType getPresentationPixelDataType()Returns aPixelDataType
representing the data type of pixel values for this image, after any intensity scaling has taken place.- Returns:
- the
PixelDataType
representing the data type of this image after any remapping of intensity values (rescaling and adding an intensity offset) has taken place.
-
getNDim
int getNDim()Returns the dimensionality of this image.- Returns:
- the image dimensionality.
-
getDims
int[] getDims()Returns the dimensions (numbers of samples in each image dimension) of this image.- Returns:
- an array with length equal to the image dimensionality, containing the
numbers of pixels (samples) in each dimension of the image.
By convention, element (nDim-1) contains the number of columns,
element (nDim-2) the number of rows, etc. For example, in a 4-dimensional image,
dims[0]
is the number of frames,dims[1]
the number of slices,dims[2]
the number of rows anddims[3]
the number of columns.
-
getNCols
int getNCols()Returns the number of image columns in this image.- Returns:
- the number of image columns.
-
getNRows
int getNRows()Returns the number of image rows in this image.- Returns:
- the number of image rows.
-
getNSlices
int getNSlices()Returns the number of physical slice locations in this image. If the image dimensionality is greater than or equal to three, then this method returns the number of samples in the third dimension. If the dimensionality is less than 3 two, it returns 1.- Returns:
- the number of physical slice locations.
-
getNFrames
int getNFrames()Returns the number of frames in a multi-frame image. If the image dimensionality is greater than or equal to four, then this method returns the number of samples in the fourth dimension. If the dimensionality is less than 4, it returns 1.- Returns:
- the number of image (movie) frames.
-
getNSliceLocations
default int getNSliceLocations()Returns the number of unique slice locations present in the image. If the image dimensionality is greater than 3, then the number of slice locations is the same as the slice dimension size. However, for 3-dimensional images, the number of unique slice locations may be fewer, for example, if a 3-dimensional image contains all echo times in a multi-echo sequence.- Returns:
- the number of unique slice locations.
-
getTotalNSlices
int getTotalNSlices()Returns the total number of slices in this image. If the image is less than 3-dimensional, this method returns 1; if it is 3-dimensional, it returns the number of slices; if it is 4- or more dimensional, it sums up the total number of planar slices in each dimension and returns the total. For example a 4-dimensional image with 4 slices and 10 frames, the total number of slices is 40.- Returns:
- the number of planar image slices.
-
getMin
Returns the minimum pixel intensity in the image.- Returns:
- the maximum pixel intensity as a
Double
, ornull
if the intensity min hasn't been calculated for this image. - Throws:
InvalidImageException
- if the intensity cannot be returned as a Double.
-
getMax
Returns the maximum pixel intensity in the image.- Returns:
- the maximum pixel intensity as a
Double
, ornull
if the intensity max hasn't been calculated for this image. - Throws:
InvalidImageException
- if the intensity cannot be returned as a Double.
-
getPix
Returns all the pixel values for this image in the order in which they are stored internally, and with intensity values as they are to be presented to the user (i.e., after any intensity rescaling).- Returns:
- all the pixel values for this image.
- Throws:
InvalidImageException
- if an error occurs while accessing the pixel values.
-
getStoredPix
Returns all the pixel values for this image in the order in which they are stored internally, and in the format they are stored internally.- Returns:
- all the pixel values for this image.
- Throws:
InvalidImageException
- if an error occurs while accessing the pixel values.
-
getPix
Returns all the pixel values for this image, optionally returning them in the correct order in which they will be presented, where the first pixel should be presented at the top left corner of the display device.- Parameters:
radiological
-true
if the pixels are to be returned in the correct order for presentation, where the first returned pixel is to be presented at the top left, and the last at the bottom right of the display device;false
if the are to be return in the order in which they are stored internally.- Returns:
- all the pixel values for this image.
- Throws:
InvalidImageException
- if an error occurs while accessing the pixel values.
-
getPix
Returns a single pixel value from this image.- Parameters:
pixIdx
- the index (in each image dimension) to the pixel.- Returns:
- a single pixel value from this image as an
Object
. - Throws:
InvalidImageException
- if an error occurs while accessing the pixel value.
-
getPix
Returns pixel values from this image. ThelowIdx
andhighIdx
arrays should have at least a number of elements at least equal to the dimensionality of the image, and the elements specifing the pixel number range for each dimension. For example, if an image has 3 dimensions, and dimensions of {5, 256, 256}, then pixels for the middle three slices will be returned by setting lowIdx to {1, 0, 0} and highIdx to {4, 255, 255}.- Parameters:
lowIdx
- an array ofint
specifying the low index of pixel values to get.highIdx
- an array ofint
specifying the high index of pixel values to get.- Returns:
- a one-dimensional array of pixel values of the correct type for this image, cast to an Object.
- Throws:
InvalidImageException
- if the indices supplied extend beyond the image, or the pixel values cannot be gotten for other reasons.
-
getPix
Get pixel values from this image into a specified array. array is a 1-dimensional array of the correct type of element for this image into which pixel values will be copied; it must be cast to anObject
and must have enough elements to contain all the pixel values requested. ThelowIdx
andhighIdx
int arrays should have at least a number of elements at least equal to the dimensionality of the image, and the elements specifing the pixel number range for each dimension. For example, if an image has 3 dimensions, and dimensions of {5, 256, 256}, then pixels for the middle three slices will be returned by setting lowIdx to {1, 0, 0} and highIdx to {4, 255, 255}.- Parameters:
pixBuffer
- a 1-dimensional array of length at least enough to contain all the pixel values, and of the correct java primitive data type.lowIdx
- an array ofint
specifying the low index of pixel values to get.highIdx
- an array ofint
specifying the high index of pixel values to get.- Returns:
- a one-dimensional array of pixel values of the correct type for this image, cast to an Object.
- Throws:
InvalidImageException
- if an I/O error occurs while accessing the pixel data.IllegalArgumentException
- if the indices supplied extend beyond the image, if the supplied array is of the wrong primitive data type, or if the pixel values cannot be gotten for other reasons.
-
getSlice
Object getSlice(Object pixBuffer, int slice) throws InvalidImageException, IndexOutOfBoundsException Returns all the pixels for a two-dimensional slice of this image, as a 1-dimensional array of primitive values. The pixels values are ordered so that the first pixel in the returned array should be displayed at the top left corner of the 2-D image array, when viewed in standard radiological orientation.If the supplied array is null, a new array will be created and returned.
- Parameters:
pixBuffer
- an array of suitable length and of a suitable primitive data type for this image.slice
- the slice number. Slices numbered from zero up to one less than the total number of slices in this image, regardless of the dimensionality of the image.- Returns:
- an array of the correct primitive data type for this image.
- Throws:
InvalidImageException
- if the slice number is invalid for this image,IndexOutOfBoundsException
- if the slice number is invalid for this image,
-
getSlice
Returns the pixel values for one slice of an n-dimensional image, where n > 1.N.B.The pixel values are always returned in a standard radiological orientation. Standard radiological orientation is:
- For axial images, increasing left coordinate with column number, and increasing posterior coordinate with row number.
- For coronal images, increasing left coordinate with column number, and increasing inferior coordinate with row number.
- For sagittal images, increasing posterior coordinate with column number, and increasing inferior coordinate with row number.
- Parameters:
slice
- the slice number. Must be 0 for a 2-dimensional image or from 0 to dims[0]-1 for a 3-dimensional image. For images of higher dimensionality, each extra dimension multiplies the number of available slices by the size in that dimension, so all images of higher dimensionality that 1 look like multi-slice images.- Returns:
- a 1-dimensional array of the primitive java type appropriate for this image, and of size [nRows * nCols]. This array is cast to an Object before return.
- Throws:
InvalidImageException
- if there is a problem accessing the pixel values.IndexOutOfBoundsException
- if the image does not have the right dimensionality or the slice number is inappropriate for this image.
-
getPixelXSize
Returns the pixel size in the x (horizontal) direction for this image.- Returns:
- the pixel size in the x (horizontal) direction in mm.
- Throws:
ParameterNotSetException
- if the pixel size can't be found.
-
getPixelYSize
Returns the pixel size in the y (vertical) direction for this image.- Returns:
- the pixel size in the y (vertical) direction in mm.
- Throws:
ParameterNotSetException
- if the pixel size can't be found.
-
getPixelZSize
Returns the separation between the centres of image planes for this image.- Returns:
- the pixel size in the z (slice) direction in mm.
- Throws:
ParameterNotSetException
- if the pixel size can't be found.
-
getTimeBetweenFrames
Returns the time between frames in a 4- or higher dimensional image.- Returns:
- the time between frames in seconds.
- Throws:
ParameterNotSetException
- if the time between frames is not set, or if this image doesn't have a dimensionality of at least 4.
-
getSliceThickness
Float getSliceThickness()Returns the slice thickness (in mm). This method is necessary because the slice thickness may not be the same as the inter-slice pixel spacing, if there is a gap between slices.- Returns:
- the slice thickness in mm, or null if the slice thickness is not set, or its value is corrupt.
-
getTitle
String getTitle()Returns the title of this image.- Returns:
- the title of this image.
-
getNativeColourMapping
Returns aColourMapping
if this image has an associated colour mapping.- Returns:
- a
ColourMapping
if this image has an associated colour mapping. Returnsnull
if it does not. - Throws:
InvalidColourMappingException
- if this image has an associated ColourMapping, but the ColourMapping cannot be successfully retrieved.
-
getPatientName
String getPatientName()Returns the patient name for this image.- Returns:
- the patient name for this image, or
null
if the patient name can't be found.
-
getPatientID
String getPatientID()Returns the patient ID for this image.- Returns:
- the patientID for this image, or
null
if the patientID can't be found.
-
getPatientDoB
Date getPatientDoB()Returns the patient date of birth for this image.- Returns:
- the patient's date of birth for this image, or
null
if the patient's dob can't be found.
-
getPatientSex
com.xinapse.dicom.Sex getPatientSex()Returns the patient sex for this image.- Returns:
- the patient's sex image, or
Sex.OTHER
if the patient's sex can't be found.
-
getPatientPosition
PatientPosition getPatientPosition()Returns the position in which the patient is lying in the scanning equipment. For example,PatientPosition.HFS
(head-first supine).- Returns:
- the position in which the patient is lying in the scanning equipment, or
null
if the patient position cannot be determined.
-
getStudyID
String getStudyID()Returns the study ID for this ReadableImage.- Returns:
- the study ID. Returns
null
if the study ID can't be found.
-
getSeriesNumber
Integer getSeriesNumber()Returns the series number for this ReadableImage.- Returns:
- the series number. Returns
null
if the series number can't be found.
-
getSeriesDescription
String getSeriesDescription()Returns a short description of the series (scan), such as is provided by the DICOM series description.- Returns:
- a short description of the series, or null if none is available.
-
getScanDate
Date getScanDate()Returns the scan Date for this image.- Returns:
- the date/time at which this scan was performed, or
null
if the scan date can't be found.
-
getMostLikePlane
MostLikePlane getMostLikePlane()Returns the imaging plane that this image is "most like".- Returns:
- the plane that is "most" like the imaging plane for this image. Returns
MostLikePlane.UNKNOWN
if the imaging plane cannot be determined, or if the image does not contain a set of parallel slices.
-
getImagePositionPatient
org.jogamp.vecmath.Point3f getImagePositionPatient()Returns the coordinates of the center of the first pixel of the image, in mm, in patient coordinates. This method will only return if the image pixels form a regular array of pixels with parallel image planes; otherwise a ParameterNotSetException is thrown.- Returns:
- the Left,Posterior,Superior (LPS) coordinates of the first pixel
in the image data matrix. Returns
null
if the position cannot be retrieved from this image.
-
getImagePositionPatient
Returns the coordinates of the center of the first pixel of the specified slice of this image, in mm, in patient coordinates.- Parameters:
slice
- the slice number (indexed from 0) for which to return the pixel coordinates.- Returns:
- the Left,Posterior,Superior (LPS) coordinates of the first pixel
in the specified slice of this image. Returns
null
if the position cannot be retrieved from this image. - Throws:
IndexOutOfBoundsException
- if the slice number is bad for this image.
-
getImageOrientationPatient
org.jogamp.vecmath.Vector3f[] getImageOrientationPatient()Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (L,P,S) coordinates.- Returns:
- a
Vector3f
[], corresponding to the direction cosines of the image row, column and slice directions in Left,Posterior,Superior (LPS) coordinates. Returnsnull
if the direction cosines cannot be retrieved from this image.
-
getImageOrientationPatient
org.jogamp.vecmath.Vector3f[] getImageOrientationPatient(int slice) throws IndexOutOfBoundsException Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient coordinates.- Parameters:
slice
- the slice for which to return the image orientation.- Returns:
- a
Vector3f
[], corresponding to the direction cosines of the image row, column and slice directions in Left,Posterior,Superior (LPS) coordinates. Returnsnull
if the direction cosines cannot be retrieved from this image. - Throws:
IndexOutOfBoundsException
- if the image does not have the right dimensionality or the slice number is inappropriate for this image.
-
getAffineTransform
Returns theAffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system.
Jim's coordinate system has:- The first coordinate increasing to the patient left (L).
- The second coordinate increasing to the patient posterior (P).
- The third coordinate increasing to the patient superior (S).
- Returns:
- the
AffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system. The pixel indices can be transformed to the (L,P,S) coordinate by applying:// 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 = getAffineTransform().transform(ijk, lps);
- Throws:
InvalidImageException
- if this image isn't at least 2-dimensional.
-
getAffineTransform
Returns theAffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system for one particular slice of the image. Useful if the image does not contain a cuboid block of slices.
Jim's coordinate system has:- The first coordinate increasing to the patient left (L).
- The second coordinate increasing to the patient posterior (P).
- The third coordinate increasing to the patient superior (S).
- Parameters:
slice
- the image slice for which to return the transform. Supplying a null slice number will cause this method to return the AffineTransform3D for the 3-D block.- Returns:
- the
AffineTransform3D
that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system. The pixel indices can be transformed to the (L,P,S) coordinate by applying:// 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 = getAffineTransform().transform(ijk, lps);
- Throws:
InvalidImageException
- if this image isn't at least 2-dimensional.
-
getModality
Modality getModality()Returns the imaging modality with which this image was collected.- Returns:
- the
Modality
used to collect this image.
-
getBodyPart
com.xinapse.dicom.BodyPart getBodyPart()Returns the body part imaged.- Returns:
- the
BodyPart
imaged, ornull
if the body part cannot be determined.
-
getLaterality
com.xinapse.dicom.Laterality getLaterality()Returns the image laterality.- Returns:
- the image
Laterality
, ornull
if the laterality cannot be determined.
-
getScanTR
Float getScanTR()Returns the scan repetition time for this image.- Returns:
- the scan TR for this image, or null if not set for this image.
-
getScanTE
Float getScanTE()Returns the scan echo time for this image if it has a single echo-time.- Returns:
- the scan TE for this image, or null if not set for this image.
-
getScanTE
Returns the scan echo time for one dimension index of this image. For 3-D images, the dimension index is the slice dimension. For 4-D (or higher dimensionality) images, the dimension index is the frame dimension.- Parameters:
index
- the index for which to return the echo time.- Returns:
- the scan TE for the specified index of this image, or null if not set for this image.
- Throws:
IndexOutOfBoundsException
- if the index is bad for this image.
-
getSaturationFreqOffsetPPM
Float getSaturationFreqOffsetPPM()Returns the scan saturation frequency offset for this image if it has a single saturation frequency offset in parts-per-million.- Returns:
- the scan saturation frequency offset for this image, or null if not set for this image.
-
getSaturationFreqOffsetPPM
Returns the scan saturation frequency offset for one dimension index of this image in parts-per-million. For 3-D images, the dimension index is the slice dimension. For 4-D (or higher dimensionality) images, the dimension index is the frame dimension.- Parameters:
index
- the index for which to return the saturation frequency offset.- Returns:
- the scan TE for the specified index of this image, or null if not set for this image.
- Throws:
IndexOutOfBoundsException
- if the index is bad for this image.
-
getScanTI
Float getScanTI()Returns the scan inversion time for this image.- Returns:
- the scan TI for this image, or null if not set for this image.
-
getEchoTrainLength
Integer getEchoTrainLength()Returns the scan echo train length for this image.- Returns:
- the echo train length for this image, or null if not set for this image.
-
getFlipAngle
Float getFlipAngle()Returns the excitation pulse flip angle for this image.- Returns:
- the excitation pulse flip angle for this image, or null if not set for this image.
-
getSliceDWbValue
Returns the diffusion-weighting b-value for one slice of this image.- Parameters:
slice
- the slice number for which to return the b-value.- Returns:
- the diffusion-weighting b-value for the specified slice of this image, or
null
if the b-value cannot be found, or if the modality used to collect the image doesn't have a b-value defined - Throws:
IndexOutOfBoundsException
- if the slice number is bad for this image.
-
getFrameDWbValue
Returns the diffusion-weighting b-value for one frame of this 4-D image.- Parameters:
frame
- the frame number for which to return the b-value.- Returns:
- the diffusion-weighting b-value for the specified frame of this image, or
null
if the b-value cannot be found, or if the modality used to collect the image doesn't have a b-value defined - Throws:
IndexOutOfBoundsException
- if the frame number is bad for this image, or it isn't a 4-D image.
-
getSliceDWGradientVector
Returns the diffusion-weighting gradient-vector for one slice of this image.- Parameters:
slice
- the slice number for which to return the gradient-vector.- Returns:
- the diffusion-weighting gradient-vector for the specified slice of this image, or
null
if the gradient vector cannot be found, or if the modality used to collect the image doesn't have a gradient vector defined. - Throws:
IndexOutOfBoundsException
- if the slice number is bad for this image.
-
getFrameDWGradientVector
Returns the diffusion-weighting gradient-vector for one frame of this image 4-D image.- Parameters:
frame
- the frame number for which to return the gradient-vector.- Returns:
- the diffusion-weighting gradient-vector for the specified frame of this image, or
null
if the gradient vector cannot be found, or if the modality used to collect the image doesn't have a gradient vector defined. - Throws:
IndexOutOfBoundsException
- if the frame number is bad for this image, or it isn't a 4-D image.
-
getSliceDWBMatrix
Returns the diffusion-weighting b-matrix for one slice of this image.- Parameters:
slice
- the slice number for which to get the b-matrix.- Returns:
- the diffusion-weighting b-matrix for this image if it is a
magnetic resonance image, or
null
if the B-matrix cannot be found, or if the modality used to collect the image doesn't have a B-matrix defined. The 6 unique matrix elements are returned as a float[] with elements in the order bXX, bXY, bXZ, bYY, bYZ, bZZ. - Throws:
IndexOutOfBoundsException
- if the slice number is bad for this image.
-
getFrameDWBMatrix
Returns the diffusion-weighting b-matrix for one frame of this image.- Parameters:
frame
- the frame number for which to get the b-matrix.- Returns:
- the diffusion-weighting b-matrix for this image if it is a
magnetic resonance image, or
null
if the B-matrix cannot be found, or if the modality used to collect the image doesn't have a B-matrix defined. The 6 unique matrix elements are returned as a float[] with elements in the order bXX, bXY, bXZ, bYY, bYZ, bZZ. - Throws:
IndexOutOfBoundsException
- if the frame number is bad for this image, or it isn't a 4-D image.
-
getSliceTriggerDelayMS
Returns the trigger delay, in milliseconds, for one slice of this image.- Parameters:
slice
- the slice number for which to get the trigger delay.- Returns:
- the trigger delay (in milliseconds) for this image, or
null
if the trigger delay cannot be found. - Throws:
IndexOutOfBoundsException
- if the slice number is bad for this image, or it isn't a 4-D image.
-
getFrameTriggerDelayMS
Returns the trigger delay, in milliseconds, for one frame of this image.- Parameters:
frame
- the frame number for which to get the trigger delay.- Returns:
- the trigger delay (in milliseconds) for this image, or
null
if the trigger delay cannot be found. - Throws:
IndexOutOfBoundsException
- if the frame number is bad for this image, or it isn't a 4-D image.
-
getPulseSequence
String getPulseSequence()Returns the name of the pulse sequence with which this image was collected.- Returns:
- the name of the pulse sequence used to collect this image.
-
getScanningSequence
PulseSequenceType getScanningSequence()Returns the DICOM Scanning Sequence with which this image was collected.- Returns:
- the DICOM Scanning Sequence used to collect this image, or
null
if the scanning sequence isn't available.
-
getSequenceVariant
PulseSequenceVariant getSequenceVariant()Returns the DICOM Scanning Sequence Variant with which this image was collected.- Returns:
- the DICOM Scanning Sequence Variant used to collect this image, or
null
if the sequence variant isn't available.
-
getFrameOfReferenceUID
com.xinapse.dicom.Uid getFrameOfReferenceUID()Returns the frame of reference UID that uniquely identifies the frame of reference for an image.- Returns:
- the frame of reference UID, or
null
if this image does not have frame of reference UID.
-
getIntensityRescale
float[] getIntensityRescale()Returns the valuesm
andb
in the relationship between pixel intensity (I) values and the output units specified ingetRescaleUnits()
in the expression:
Output units = m*I + b
.- Returns:
- an array will be of length 2 where the first element is
m
and the second isb
.
-
getRescaleUnits
com.xinapse.dicom.RescaleUnits getRescaleUnits()Returns the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved bygetIntensityRescale()
.- Returns:
- the RescaleUnits describing the physical meaning of the pixel intensity units. Returns the RescaleUnits.US if the physical meaning is unknown, or arbitrary.
-
getNativeHeader
String getNativeHeader()Returns a String showing the 'native' header for this image.- Returns:
- a String describing the 'native' header for this image.
-
getDescription
String getDescription()Returns a String description of this image.- Returns:
- a String describing this image.
-
getDescription
Returns a String description of this one particular slice of this image.- Parameters:
slice
- the slice to describe.- Returns:
- a String describing the given slice of this image.
-
getHTMLDescription
String getHTMLDescription()Returns a String description of this image in HTML format.- Returns:
- a String describing this image.
-
getHTMLDescription
Returns a String description of a slice of this image in HTML format.- Parameters:
slice
- the slice number.- Returns:
- a String describing this image slice.
- Throws:
IndexOutOfBoundsException
- if the slice is bad for this image.
-
getSuggestedFileName
String getSuggestedFileName()Returns the suggested file name for in-memory images that are to be saved to disk.- Returns:
- the suggested file name, or
null
if not set.
-
getROIs
Returns a List of ROIs that are stored with the image.- Returns:
- a List of ROIs that are stored with the image, or
null
if there are no ROIs stored with the image. - Throws:
IOException
- if an I/O error occurs while reading the ROIs.
-
close
Closes an image and frees up resources. Any further operations to a closed image are not possible, and may cause an exception to be thrown.- Specified by:
close
in interfaceAutoCloseable
- Throws:
InvalidImageException
- if the image cannot be written or closed.IOException
- if an I/O error occurs.
-
isOpen
boolean isOpen()Tests whether this image is still open.- Returns:
true
if the image is still open for reading and (if opened read/write) writing;false
otherwise.
-
getCopy
Returns a copy of thisReadableImage
.- Returns:
- a copy of this
ReadableImage
. - Throws:
IOException
- if the an I/O error occurs whilst copying.
-
disposeImageData
Gives this image the option to free up resources by removing access to image data. After this method is called, image data may no longer be accessible, and method calls to access it may result in an Exception being thrown.- Throws:
InvalidImageException
- is an error occurs while disposing of the image data.
-