Class TissueNormaliser

java.lang.Object
com.xinapse.image.template.TissueNormaliser

public class TissueNormaliser extends Object
A class for normalising image intensities.
  • Constructor Details

    • TissueNormaliser

      public TissueNormaliser()
  • Method Details

    • normalise

      public static WritableImage[] normalise(ReadableImage t1Image, ReadableImage flairImage, ReadableImage gmProb, ReadableImage wmProb, ReadableImage lvProb) throws InvalidImageException, IOException, NumericalException
      Normalise the intensities of a T1-weighted image and a co-registered FLAIR image, using two particular tissues as a reference. After normalisation:
      • The T1 image will have mean intensities intensities in the GM on the order of 0, and mean intensities in the WM on the order of 1.
      • The FLAIR image will have mean intensities intensities in the WM on the order of 1, and mean intensities in the CSF on the order of 0.
      Parameters:
      t1Image - the T1-weighted image.
      flairImage - the FLAIR image.
      gmProb - an image of the probability of GM.
      wmProb - an image of the probability of WM.
      lvProb - an image of the probability of lateral ventricle.
      Returns:
      normalised versions of the input t1Image and the input flairImage.
      Throws:
      InvalidImageException - if any of the input images is invalid.
      IOException - if an I/O error occurs while reading any of the input images.
      NumericalException - if a numerical error prevents normalisation.
    • getMeanSD

      public static float[] getMeanSD(ReadableImage t1Image, ReadableImage flairImage, ReadableImage tissueProb) throws InvalidImageException, IOException, NumericalException
      Returns mean and standard deviation statistics about a T1-weighted image and a FLAIR image.
      Parameters:
      t1Image - the T1-weighted image.
      flairImage - the FLAIR image.
      tissueProb - the tissue probabilities for which to return the stats.
      Returns:
      the T1 mean and SD, the FLAIR mean and SD in that order.
      Throws:
      InvalidImageException - if any of the input images is invalid.
      IOException - if the images can't be read.
      NumericalException - if a numerical error occurs while calculating the mean and SD.
    • getMeanSD

      public static float[] getMeanSD(float[] t1Pix, float[] flairPix, float[] tissueProb, int nCols, int nRows, int nSlices) throws InvalidImageException, NumericalException
      Returns mean and standard deviation statistics about a T1-weighted image and a FLAIR image.
      Parameters:
      t1Pix - the T1-weighted image pixel values.
      flairPix - the FLAIR image pixel values.
      tissueProb - the tissue probability pixel values.
      nCols - the number of image columns.
      nRows - the number of image rows.
      nSlices - the number of image slices.
      Returns:
      the T1 mean and SD, the FLAIR mean and SD in that order.
      Throws:
      InvalidImageException - if any of the input images is invalid.
      NumericalException - if a numerical error occurs while calculating the mean and SD.
    • getMedian

      public static float[] getMedian(ReadableImage t1Image, ReadableImage flairImage, ReadableImage tissueProb) throws InvalidImageException, IOException, NumericalException
      Returns median intensity statistics for a T1-weighted image and a FLAIR image.
      Parameters:
      t1Image - the T1-weighted image.
      flairImage - the FLAIR image.
      tissueProb - the tissue probabilities for which to return the medians.
      Returns:
      the T1 median and FLAIR median in that order.
      Throws:
      InvalidImageException - if any of the input images is invalid.
      IOException - if the images can't be read.
      NumericalException - if a numerical error occurs while calculating the medians.
    • getMedian

      public static float[] getMedian(float[] t1Pix, float[] flairPix, float[] tissueProb, int nCols, int nRows, int nSlices) throws InvalidImageException, NumericalException
      Returns median intensities for a T1-weighted image and a FLAIR image.
      Parameters:
      t1Pix - the T1-weighted image pixel values.
      flairPix - the FLAIR image pixel values.
      tissueProb - the tissue probability pixel values.
      nCols - the number of image columns.
      nRows - the number of image rows.
      nSlices - the number of image slices.
      Returns:
      the T1 median and the FLAIR median in that order.
      Throws:
      InvalidImageException - if any of the input images is invalid.
      NumericalException - if a numerical error occurs while calculating the median and SD.
    • main

      public static void main(String[] args)
      Runs the self-test of this class.
      Parameters:
      args - the program arguments. Five are expected: T1, FLAIR, gmProb, wmProb, lvProb.