Documentation of 'edu.rit.mri.PixelSignal' Java class
PixelSignal
edu.rit.mri

Class PixelSignal

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable


    public class PixelSignal
    extends java.lang.Object
    implements java.io.Externalizable
    Class PixelSignal encapsulates the measured spin signal on one pixel of a magnetic resonance image. This includes:
    • File index.
    • Pixel index.
    • Pixel's measured spin signal values, Si.

    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:

    • Number of spin signal values, M (2-byte short).
    • M spin signal values, each a 2-byte short.

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

    • File index (4-byte int).
    • Pixel index (4-byte int).
    • Number of spin signal values, M (2-byte short).
    • M spin signal values, each a 2-byte short.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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(java.io.DataInput in)
      Read this pixel signal object from the given data input stream.
      void readExternal(java.io.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(java.io.DataOutput out)
      Write this pixel signal object to the given data output stream.
      void writeExternal(java.io.ObjectOutput out)
      Write this pixel signal object to the given object output stream.
      • Methods inherited from class java.lang.Object

        equals, 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(java.io.DataOutput out)
                   throws java.io.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:
        java.io.IOException - Thrown if an I/O error occurred.
      • read

        public void read(java.io.DataInput in)
                  throws java.io.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:
        java.io.IOException - Thrown if an I/O error occurred.
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this pixel signal object to the given object output stream.
        Specified by:
        writeExternal in interface java.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.IOException
        Read this pixel signal object from the given object input stream.
        Specified by:
        readExternal in interface java.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

You see the box below because you did not login.