edu.rit.mri
Class PixelTissues
- java.lang.Object
-
- edu.rit.mri.PixelTissues
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public class PixelTissues extends java.lang.Object implements java.io.ExternalizableClass PixelTissues encapsulates the results of a spin relaxometry analysis on one pixel of a magnetic resonance image. This includes:- File index.
- Pixel index.
- Pixel's computed spin density ρ for each tissue.
- Pixel's computed spin-lattice relaxation rate R1 for each tissue.
Each spin density and spin-lattice relaxation rate is stored as a value of type double.
Operations are provided to read a pixel tissues object from a DataInputStream and write a pixel tissues object to a DataOutputStream. The format is:
- Number of tissues, L (2-byte short).
- L spin density values, each an 8-byte double.
- L spin-lattice relaxation rate values, each an 8-byte double.
Operations are provided to read a pixel tissues object from an ObjectInputStream and write a pixel tissues object to an ObjectOutputStream. The format is:
- File index (4-byte int).
- Pixel index (4-byte int).
- Number of tissues, L (2-byte short).
- L spin density values, each an 8-byte double.
- L spin-lattice relaxation rate values, each an 8-byte double.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PixelTissues()Construct a new, uninitialized pixel tissues object.PixelTissues(int fileIndex, int pixelIndex, java.util.List<java.lang.Double> rho_list, java.util.List<java.lang.Double> R1_list)Construct a new pixel tissues object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intfileIndex()Get the file index.voidfileIndex(int index)Specify the file index.intnumTissues()Get the number of tissues computed for this pixel.intpixelIndex()Get the pixel index.voidpixelIndex(int index)Specify the pixel index.doubleR1(int i)Get the given tissue's spin-lattice relaxation rate.voidread(java.io.DataInput in)Read this pixel tissues object from the given data input stream.voidreadExternal(java.io.ObjectInput in)Read this pixel tissues object from the given object input stream.doublerho(int i)Get the given tissue's spin density.SeriesS_series(Series t_series)Get a series containing this pixel's computed spin signal for the given time series.doubleS(double t)Get this pixel's computed spin signal at the given time.voidtissues(java.util.List<java.lang.Double> rho_list, java.util.List<java.lang.Double> R1_list)Specify the tissues for this pixel.voidwrite(java.io.DataOutput out)Write this pixel tissues object to the given data output stream.voidwriteExternal(java.io.ObjectOutput out)Write this pixel tissues object to the given object output stream.
-
-
-
Constructor Detail
-
PixelTissues
public PixelTissues()
Construct a new, uninitialized pixel tissues object. This constructor is for use only by object deserialization.
-
PixelTissues
public PixelTissues(int fileIndex, int pixelIndex, java.util.List<java.lang.Double> rho_list, java.util.List<java.lang.Double> R1_list)Construct a new pixel tissues object. If a solution could not be computed for this pixel, rho and R1 are null.- Parameters:
fileIndex- File index.pixelIndex- Pixel index.rho_list- List containing computed spin densities, or null.R1_list- List containing computed spin-lattice relaxation rates, or null.- Throws:
java.lang.IllegalArgumentException- (unchecked exception) Thrown if index < 0. Thrown if rho_list and R1_list are not the same length.
-
-
Method Detail
-
fileIndex
public int fileIndex()
Get the file index.- Returns:
- File index.
-
fileIndex
public void fileIndex(int index)
Specify the file index.- Parameters:
index- File index.
-
pixelIndex
public int pixelIndex()
Get the pixel index.- Returns:
- Pixel index.
-
pixelIndex
public void pixelIndex(int index)
Specify the pixel index.- Parameters:
index- Pixel index.
-
tissues
public void tissues(java.util.List<java.lang.Double> rho_list, java.util.List<java.lang.Double> R1_list)Specify the tissues for this pixel. If a solution could not be computed for this pixel, rho and R1 are null.- Parameters:
rho_list- List containing computed spin densities, or null.R1_list- List containing computed spin-lattice relaxation rates, or null.- Throws:
java.lang.IllegalArgumentException- (unchecked exception) Thrown if rho_list and R1_list are not the same length.
-
numTissues
public int numTissues()
Get the number of tissues computed for this pixel. If the analysis could not find a solution for this pixel, 0 is returned.- Returns:
- Number of tissues, L.
-
rho
public double rho(int i)
Get the given tissue's spin density.- Parameters:
i- Tissue index, 0 ≤ i ≤ L−1.- Returns:
- Spin density, ρi.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
R1
public double R1(int i)
Get the given tissue's spin-lattice relaxation rate.- Parameters:
i- Tissue index, 0 ≤ i ≤ L−1.- Returns:
- Spin-lattice relaxation rate, R1i.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
S
public double S(double t)
Get this pixel's computed spin signal at the given time. The formula is:S(t) = Σi ρi [1 − 2 exp(−R1i t)] If the analysis could not find a solution for this pixel, 0 is returned.- Parameters:
t- Time.- Returns:
- Spin signal, S(t).
-
S_series
public Series S_series(Series t_series)
Get a series containing this pixel's computed spin signal for the given time series. If the analysis could not find a solution for this pixel, null is returned.- Parameters:
t_series- Series of times, tj.- Returns:
- Series of spin signals, S(tj), or null.
-
write
public void write(java.io.DataOutput out) throws java.io.IOExceptionWrite this pixel tissues object to the given data output stream.Note: The file index and pixel index are not written.
- Parameters:
out- Data output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
read
public void read(java.io.DataInput in) throws java.io.IOExceptionRead this pixel tissues object from the given data input stream.Note: The file index and pixel index are not read.
- Parameters:
in- Data input stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this pixel tissues object to the given object output stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- Object output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOExceptionRead this pixel tissues object from the given object input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- Object input stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG