Class PhaseImage

java.lang.Object
com.xinapse.image.PhaseImage

public abstract class PhaseImage extends Object
A Class for converting an image where the intensity values represent phase, to phase values in the range -pi .. +pi.
  • Method Details

    • getPhase

      public static float[] getPhase(Object pixelValues, PixelDataType dataType) throws InvalidArgumentException, InvalidImageException
      Return the phase values from pixel values that represent phase. The range of intensities is examined to guess the mapping from intensity to phase.
      Parameters:
      pixelValues - the pixel values from which the phase is to be extracted.
      dataType - the PixelDataType of the pixel values.
      Returns:
      the phase values in the range -pi .. +pi.
      Throws:
      InvalidArgumentException - if the supplied pixel data type cannot be handled.
      InvalidImageException - if the supplied pixel values are invalid.
    • getPhase

      public static float[] getPhase(ReadableImage phaseImage, Object phasePix, PixelDataType phaseDataType, Object magnitudePix, PixelDataType magnitudeDataType) throws InvalidArgumentException, InvalidImageException
      Return the phase values from pixel values that represent phase and (optionally) magnitude. The range of intensities is examined to guess the mapping from intensity to phase. If the supplied phaseImage is from a General Electric MRI scanner, the image header will be examined to determine whether magnitude scaling has been applied to the phase image, and also the value of the VENC scaling if this a velocity-enecoded image.
      Parameters:
      phaseImage - the image that represents phase.
      phasePix - the pixel values from which the phase is to be extracted.
      phaseDataType - the PixelDataType of the phase pixel values.
      magnitudePix - if non-null, the magnitude pixel values.
      magnitudeDataType - if non-null, the PixelDataType of the magnitude pixel values.
      Returns:
      the phase values in the range -pi .. +pi.
      Throws:
      InvalidArgumentException - if the supplied pixel data type cannot be handled.
      InvalidImageException - if the supplied pixel values are invalid.
    • getPhase

      public static float[] getPhase(ReadableImage phaseImage, ReadableImage magnitudeImage, List<ROI> stationaryTissueROIs) throws InvalidArgumentException, InvalidImageException
      Return the phase values from an image where pixel values represent phase.
      Parameters:
      phaseImage - the image from which the phase values are to be extracted.
      magnitudeImage - if non-null, the image from which the magnitude values are to be extracted. Phase images from General Electric scanners may have been scaled by multiplying them by the image magnitude to make them look better. If this has been done, then the magnitudeImage must be non-null so that this scaling can be undone.
      stationaryTissueROIs - if non-null, a List of ROIs in stationary tissue so that a phase correction can be performed (for velocity-encoded phase data). The phase offset in the ROIs is subtracted from all phase values for phase correction. Note that this can cause phase wrap to occur.
      Returns:
      the phase values in the range -pi .. +pi. The image orientation of the returned phase values will be radiological.
      Throws:
      InvalidArgumentException - if the supplied image has pixel intensities that cannot be handled.
      InvalidImageException - if either of the supplied images is invalid.
    • getPhase

      public static float[] getPhase(ReadableImage phaseImage, Object phasePix, PixelDataType phaseDataType, Object magnitudePix, PixelDataType magnitudeDataType, List<ROI> stationaryTissueROIs) throws InvalidArgumentException, InvalidImageException
      Return the phase values from pixel values that represent phase and (optionally) magnitude. The range of intensities is examined to guess the mapping from intensity to phase. If the supplied phaseImage is from a General Electric MRI scanner, the image header will be examined to determine whether magnitude scaling has been applied to the phase image, and also the value of the VENC scaling if this a velocity-enecoded image.
      Parameters:
      phaseImage - the image that represents phase.
      phasePix - the pixel values from which the phase is to be extracted.
      phaseDataType - the PixelDataType of the phase pixel values.
      magnitudePix - if non-null, the magnitude pixel values.
      magnitudeDataType - if non-null, the PixelDataType of the magnitude pixel values.
      stationaryTissueROIs - if non-null, a List of ROIs in stationary tissue so that a phase correction can be performed (for velocity-encoded phase data). The phase offset in the ROIs is subtracted from all phase values for phase correction. Note that this can cause phase wrap to occur.
      Returns:
      the phase values in the range -pi .. +pi.
      Throws:
      InvalidArgumentException - if the supplied pixel data type cannot be handled.
      InvalidImageException - if the supplied pixel values are invalid.