edu.rit.mri
Class SignalDataSetWriter
- java.lang.Object
-
- edu.rit.mri.SignalDataSetWriter
-
public class SignalDataSetWriter extends java.lang.ObjectClass SignalDataSetWriter provides an object that writes a magnetic resonance image spin signal data set to a file. The data set includes the measured spin signals for each pixel in the image.The spin signal data set file format is as follows. Primitive types are written as with java.io.DataOutput.
- Image height H (int, 4 bytes).
- Image width W (int, 4 bytes). Number of pixels P = H×W.
- P offsets (long, 8 bytes each). Each is the offset to the start of the pixel signal data for the corresponding pixel index. An offset of 0 means no signal data for that pixel index.
- Length of time series M (short, 2 bytes).
- M time values (double, 8 bytes each).
- Pixel signal data for each pixel. Written using PixelSignal.write().
-
-
Constructor Summary
Constructors Constructor and Description SignalDataSetWriter(java.io.File theFile, int H, int W, Series t_series)Construct a new spin signal data set writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPixelSignal(PixelSignal signal)Add the given pixel signal data to this data set.voidclose()Close this data set.
-
-
-
Constructor Detail
-
SignalDataSetWriter
public SignalDataSetWriter(java.io.File theFile, int H, int W, Series t_series) throws java.io.IOExceptionConstruct a new spin signal data set writer.- Parameters:
theFile- File to write.H- Height (number of rows).W- Width (number of columns).t_series- Time series.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theFile is null. Thrown if t_series is null.java.lang.IllegalArgumentException- (unchecked exception) Thrown if H < 0 or W < 0.java.io.IOException- Thrown if an I/O error occurred.
-
-
Method Detail
-
addPixelSignal
public void addPixelSignal(PixelSignal signal) throws java.io.IOException
Add the given pixel signal data to this data set. The pixel signal data consists of the pixel index and the signal series. The signal series is a series of length M giving the spin signal measurements S(ti), where the ti are the elements of the time series.- Parameters:
signal- PixelSignal object, with a pixel index i in the range 0 ≤ i ≤ P−1.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if signal is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.java.lang.IllegalArgumentException- (unchecked exception) Thrown if the length of the signal series ≠ M, the length of the time series.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