Interface ReadableImage

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
WritableImage
All Known Implementing Classes:
Analyze75Image, ANZImage, MultiSliceImage, NIFTI2Image, NIFTIImage, UNCImage

public interface ReadableImage extends AutoCloseable
Interface implemented by classes that ensure an image of that class can be read.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    A Comparable point in space that can be used to sort positions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes an image and frees up resources.
    void
    Gives this image the option to free up resources by removing access to image data.
    Returns the AffineTransform3D that will transform the pixel indices (colIdx, rowIdx, sliceIdx) to a position in space in the patient-centric coordinate system.
    Returns the AffineTransform3D 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.
    Returns a copy of this ReadableImage.
    Returns a String description of this image.
    getDescription(int slice)
    Returns a String description of this one particular slice of this image.
    int[]
    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
    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.
    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[]
    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
    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 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.
    com.xinapse.dicom.Laterality
    Returns the image laterality.
    Returns the maximum pixel intensity in the image.
    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 a ColourMapping if this image has an associated colour mapping.
    Returns a String showing the 'native' header for this image.
    int
    Returns the number of image columns in this image.
    int
    Returns the dimensionality of this image.
    int
    Returns the number of frames in a multi-frame image.
    int
    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.
    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.
    getPix(Object pixBuffer, int[] lowIdx, int[] highIdx)
    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 a PixelDataType 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 by getIntensityRescale().
    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.
    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.
    getSlice(Object pixBuffer, int slice)
    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
    Returns the diffusion-weighting gradient-vector for one slice of this image.
    Returns the slice thickness (in mm).
    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 a PixelDataType 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.
    Returns the title of this image.
    int
    Returns the total number of slices in this image.
    boolean
    Tests whether this image is still open.
  • Method Details

    • getStoredPixelDataType

      PixelDataType getStoredPixelDataType()
      Returns a PixelDataType 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 a PixelDataType 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 and dims[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

      Double getMin() throws InvalidImageException
      Returns the minimum pixel intensity in the image.
      Returns:
      the maximum pixel intensity as a Double, or null if the intensity min hasn't been calculated for this image.
      Throws:
      InvalidImageException - if the intensity cannot be returned as a Double.
    • getMax

      Double getMax() throws InvalidImageException
      Returns the maximum pixel intensity in the image.
      Returns:
      the maximum pixel intensity as a Double, or null if the intensity max hasn't been calculated for this image.
      Throws:
      InvalidImageException - if the intensity cannot be returned as a Double.
    • getPix

      Object getPix() throws InvalidImageException
      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

      Object getStoredPix() throws InvalidImageException
      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

      Object getPix(boolean radiological) throws InvalidImageException
      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

      Object getPix(int[] pixIdx) throws InvalidImageException
      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

      Object getPix(int[] lowIdx, int[] highIdx) throws InvalidImageException
      Returns pixel values from this image. The lowIdx and highIdx 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 of int specifying the low index of pixel values to get.
      highIdx - an array of int 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

      Object getPix(Object pixBuffer, int[] lowIdx, int[] highIdx) throws InvalidImageException
      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 an Object and must have enough elements to contain all the pixel values requested. The lowIdx and highIdx 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 of int specifying the low index of pixel values to get.
      highIdx - an array of int 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.
      Thus, when this slice is viewed on-screen, the first pixel in the array returned belongs at the top left of the screen, and the last pixel in the array belongs at the bottom right of the screen. This is regardless of the sub-class of image (for example, the flipping of Analyze images is taken care of by this method).
      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

      float getPixelXSize() throws ParameterNotSetException
      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

      float getPixelYSize() throws ParameterNotSetException
      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

      float getPixelZSize() throws ParameterNotSetException
      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

      float getTimeBetweenFrames() throws ParameterNotSetException
      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

      ColourMapping getNativeColourMapping() throws InvalidColourMappingException
      Returns a ColourMapping if this image has an associated colour mapping.
      Returns:
      a ColourMapping if this image has an associated colour mapping. Returns null 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

      org.jogamp.vecmath.Point3f getImagePositionPatient(int slice) throws IndexOutOfBoundsException
      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. Returns null 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. Returns null 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

      default AffineTransform3D getAffineTransform() throws InvalidImageException
      Returns the AffineTransform3D 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

      default AffineTransform3D getAffineTransform(Integer slice) throws InvalidImageException
      Returns the AffineTransform3D 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, or null if the body part cannot be determined.
    • getLaterality

      com.xinapse.dicom.Laterality getLaterality()
      Returns the image laterality.
      Returns:
      the image Laterality, or null 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

      Float getScanTE(int index) throws IndexOutOfBoundsException
      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

      Float getSaturationFreqOffsetPPM(int index) throws IndexOutOfBoundsException
      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

      Float getSliceDWbValue(int slice) throws IndexOutOfBoundsException
      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

      Float getFrameDWbValue(int frame) throws IndexOutOfBoundsException
      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

      org.jogamp.vecmath.Vector3f getSliceDWGradientVector(int slice) throws IndexOutOfBoundsException
      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

      org.jogamp.vecmath.Vector3f getFrameDWGradientVector(int frame) throws IndexOutOfBoundsException
      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

      float[] getSliceDWBMatrix(int slice) throws IndexOutOfBoundsException
      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

      float[] getFrameDWBMatrix(int frame) throws IndexOutOfBoundsException
      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

      Float getSliceTriggerDelayMS(int slice) throws IndexOutOfBoundsException
      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

      Float getFrameTriggerDelayMS(int frame) throws IndexOutOfBoundsException
      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 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.
      Returns:
      an array will be of length 2 where the first element is m and the second is b.
    • getRescaleUnits

      com.xinapse.dicom.RescaleUnits getRescaleUnits()
      Returns the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved by getIntensityRescale().
      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

      String getDescription(int slice)
      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

      String getHTMLDescription(int slice) throws IndexOutOfBoundsException
      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

      List<ROI> getROIs() throws IOException
      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

      void close() throws InvalidImageException, IOException
      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 interface AutoCloseable
      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

      ReadableImage getCopy() throws IOException
      Returns a copy of this ReadableImage.
      Returns:
      a copy of this ReadableImage.
      Throws:
      IOException - if the an I/O error occurs whilst copying.
    • disposeImageData

      void disposeImageData() throws InvalidImageException
      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.