edu.rit.mri
Class PixelSignal

java.lang.Object
  extended by edu.rit.mri.PixelSignal
All Implemented Interfaces:
Externalizable, Serializable

public class PixelSignal
extends Object
implements Externalizable

Class PixelSignal encapsulates the measured spin signal on one pixel of a magnetic resonance image. This includes:

Each spin signal value is stored as a value of type short in the range −32768..+32767.

Operations are provided to read a pixel signal object from a DataInputStream and write a pixel signal object to a DataOutputStream. The format is:

Operations are provided to read a pixel signal object from an ObjectInputStream and write a pixel signal object to an ObjectOutputStream. The format is:

See Also:
Serialized Form

Constructor Summary
PixelSignal()
          Construct a new, uninitialized pixel signal object.
PixelSignal(int fileIndex, int pixelIndex, Series S_series)
          Construct a new pixel signal object.
PixelSignal(int fileIndex, int pixelIndex, short[] S_array)
          Construct a new pixel signal object.
 
Method Summary
 int fileIndex()
          Get the file index.
 void fileIndex(int index)
          Specify the file index.
 int length()
          Get the number of measured spin signal values for this pixel.
 int pixelIndex()
          Get the pixel index.
 void pixelIndex(int index)
          Specify the pixel index.
 void read(DataInput in)
          Read this pixel signal object from the given data input stream.
 void readExternal(ObjectInput in)
          Read this pixel signal object from the given object input stream.
 Series S_measured()
          Get a series containing this pixel's measured spin signal values.
 void S_measured(Series S_series)
          Specify a series containing this pixel's measured spin signal values.
 void S_measured(short[] S_array)
          Specify an array containing this pixel's measured spin signal values.
 void write(DataOutput out)
          Write this pixel signal object to the given data output stream.
 void writeExternal(ObjectOutput out)
          Write this pixel signal object to the given object output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PixelSignal

public PixelSignal()
Construct a new, uninitialized pixel signal object. This constructor is for use only by object deserialization.


PixelSignal

public PixelSignal(int fileIndex,
                   int pixelIndex,
                   short[] S_array)
Construct a new pixel signal object. If there was no measured spin signal for this pixel, S_array is null.

Parameters:
fileIndex - File index.
pixelIndex - Pixel index.
S_array - Array containing measured spin signal values, or null.

PixelSignal

public PixelSignal(int fileIndex,
                   int pixelIndex,
                   Series S_series)
Construct a new pixel signal object. If there was no measured spin signal for this pixel, S_series is null. Each value in S_series is truncated to type short before being stored; values outside the range −32768..+32767 are pinned to the nearest boundary of that range.

Parameters:
fileIndex - File index.
pixelIndex - Pixel index.
S_series - Series containing measured spin signal values, or null.
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.

length

public int length()
Get the number of measured spin signal values for this pixel. If there was no measured spin signal for this pixel, 0 is returned.

Returns:
Number of measured spin signal values, or 0.

S_measured

public Series S_measured()
Get a series containing this pixel's measured spin signal values. If there was no measured spin signal for this pixel, null is returned.

Returns:
Series containing measured spin signal values, or null.

S_measured

public void S_measured(short[] S_array)
Specify an array containing this pixel's measured spin signal values. If there was no measured spin signal for this pixel, S_array is null.

Parameters:
S_array - Array containing measured spin signal values, or null.

S_measured

public void S_measured(Series S_series)
Specify a series containing this pixel's measured spin signal values. If there was no measured spin signal for this pixel, S_series is null. Each value in S_series is truncated to type short before being stored; values outside the range −32768..+32767 are pinned to the nearest boundary of that range.

Parameters:
S_series - Series containing measured spin signal values, or null.

write

public void write(DataOutput out)
           throws IOException
Write this pixel signal object to the given data output stream.

Note: The file index and pixel index are not written.

Parameters:
out - Data output stream.
Throws:
IOException - Thrown if an I/O error occurred.

read

public void read(DataInput in)
          throws IOException
Read this pixel signal object from the given data input stream.

Note: The file index and pixel index are not read.

Parameters:
in - Data input stream.
Throws:
IOException - Thrown if an I/O error occurred.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Write this pixel signal object to the given object output stream.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - Object output stream.
Throws:
IOException - Thrown if an I/O error occurred.

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Read this pixel signal object from the given object input stream.

Specified by:
readExternal in interface Externalizable
Parameters:
in - Object input stream.
Throws:
IOException - Thrown if an I/O error occurred.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.