edu.rit.mri
Class SignalDataSetReader
- java.lang.Object
-
- edu.rit.mri.SignalDataSetReader
-
public class SignalDataSetReader extends java.lang.ObjectClass SignalDataSetReader provides an object that reads a magnetic resonance image spin signal data set from a file. The data set includes the measured spin signals for each pixel in the image.The spin signal data set file format is defined in class SignalDataSetWriter.
-
-
Constructor Summary
Constructors Constructor and Description SignalDataSetReader(java.io.File theFile)Construct a new spin signal 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.PixelSignalgetPixelSignal(int i)Get the pixel signal data for the given pixel in this data set.SeriesgetTimeSeries()Get the time series for 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
-
SignalDataSetReader
public SignalDataSetReader(java.io.File theFile) throws java.io.IOExceptionConstruct a new spin signal 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.
-
getTimeSeries
public Series getTimeSeries()
Get the time series for this data set.- Returns:
- Time series.
-
getPixelSignal
public PixelSignal getPixelSignal(int i) throws java.io.IOException
Get the pixel signal data for the given pixel in this data set. If the given pixel has no associated signal data, null is returned.- Parameters:
i- Pixel index, 0 ≤ i ≤ P−1.- Returns:
- PixelSignal 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