edu.rit.mri
Class TissuesDataSetReader
- java.lang.Object
-
- edu.rit.mri.TissuesDataSetReader
-
public class TissuesDataSetReader extends java.lang.ObjectClass TissuesDataSetReader provides an object that reads a magnetic resonance image tissues data set from a file. The data set includes the results of a spin relaxometry analysis for each pixel in the image, including number of tissues, spin density of each tissue, and spin-lattice relaxation rate of each tissue.The tissues data set file format is defined in class TissuesDataSetWriter.
-
-
Constructor Summary
Constructors Constructor and Description TissuesDataSetReader(java.io.File theFile)Construct a new tissues data set reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Close this data set.intcolumnFor(int i)Get the column index corresponding to the given pixel index.intgetHeight()Get the height H of this data set's magnetic resonance image.intgetPixelCount()Get the number of pixels P in this data set's magnetic resonance image.PixelTissuesgetPixelTissues(int i)Get the pixel tissues data for the given pixel in this data set.intgetWidth()Get the width W of this data set's magnetic resonance image.intindexFor(int r, int c)Get the pixel index for the given row and column indexes.introwFor(int i)Get the row index corresponding to the given pixel index.
-
-
-
Constructor Detail
-
TissuesDataSetReader
public TissuesDataSetReader(java.io.File theFile) throws java.io.IOExceptionConstruct a new tissues data set reader.- Parameters:
theFile- File to read.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theFile is null.java.io.IOException- Thrown if an I/O error occurred.
-
-
Method Detail
-
getHeight
public int getHeight()
Get the height H of this data set's magnetic resonance image.- Returns:
- Height (number of rows).
-
getWidth
public int getWidth()
Get the width W of this data set's magnetic resonance image.- Returns:
- Width (number of columns).
-
getPixelCount
public int getPixelCount()
Get the number of pixels P in this data set's magnetic resonance image.- Returns:
- Number of pixels.
-
indexFor
public int indexFor(int r, int c)Get the pixel index for the given row and column indexes.- Parameters:
r- Row index, 0 ≤ r ≤ H−1.c- Column index, 0 ≤ c ≤ W−1.- Returns:
- Pixel index.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if r or c is out of bounds.
-
rowFor
public int rowFor(int i)
Get the row index corresponding to the given pixel index.- Parameters:
i- Pixel index, 0 ≤ i ≤ P−1.- Returns:
- Row index.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
columnFor
public int columnFor(int i)
Get the column index corresponding to the given pixel index.- Parameters:
i- Pixel index, 0 ≤ i ≤ P−1.- Returns:
- Column index.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
getPixelTissues
public PixelTissues getPixelTissues(int i) throws java.io.IOException
Get the pixel tissues data for the given pixel in this data set. If the given pixel has no associated tissues data, null is returned.- Parameters:
i- Pixel index, 0 ≤ i ≤ P−1.- Returns:
- PixelTissues object for pixel i, or null.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.java.io.IOException- Thrown if an I/O error occurred.
-
close
public void close() throws java.io.IOExceptionClose this data set.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG