Interface InfoStorer

All Known Implementing Classes:
NIFTI2Image, NIFTIImage, UNCImage

public interface InfoStorer
An interface that classes implement to indicate that they can store arbitrary textual information.
  • Method Details

    • getInfo

      String getInfo(String name)
      Returns a string representing the value of an information item in the general image information.

      For example, if there is a item with a name "pixel_x_size" and a value "0.91162" in the general info, and name "pixel_x_size" is supplied, then this method will return "0.91162".

      Parameters:
      name - the name of an information field.
      Returns:
      a String representation of the value of an information field, or null if the name is not found in the general info.
    • putInfo

      void putInfo(String name, int value)
      Adds an item to the general file info.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information field to put.
      value - an integer value to be associated with the name in the general file information.
    • putInfo

      void putInfo(String name, float value)
      Adds an item to the general file info. If an info item with the same name exists, then then value will be overwritten.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information to put.
      value - a floating point value to be associated with the name in the general file information.
    • putInfo

      void putInfo(String name, String value)
      Adds an item to the general file info. If an info item with the same name exists, then then value will be overwritten.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information to put.
      value - a String to be associated with the name in the general file information.
    • getInfo

      String getInfo(String name, int dim, int n)
      Returns a String representing the value of an information item in a particular dimension of this InfoStorer. For example, if there is a item "pixel_x_size=0.91162" in the info for the dimension, and a name "pixel_x_size" is supplied, then this method will return "0.91162".
      Parameters:
      name - the name of the information item.
      dim - the dimension of the image to look for the information. For example in a 3-dimensional image you would look in dimension 0 for slice-specific info.
      n - the element to look in. For example in a 3-dimensional image you would look in slice n to info that applied only to slice n.
      Returns:
      a String representation of the value of the information, or null if the name is not found in the dimension/element info.
    • putInfo

      void putInfo(String name, int value, int dim, int n) throws IndexOutOfBoundsException
      Adds an item to the dimension-specific information. If an info item with the same name exists, then then value will be overwritten.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information item to put.
      value - an integer value to be associated with the name in the general file information.
      dim - the dimension of this InfoStorer to put the information item. For example in a 3-dimensional image you would put to dimension 0 for slice-specific info.
      n - the element to put to. For example in a 3-dimensional image you would put to slice n to info that applied only to slice n.
      Throws:
      IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
    • putInfo

      void putInfo(String name, float value, int dim, int n) throws IndexOutOfBoundsException
      Adds an item to the dimension-specific information. If an info item with the same name exists, then then value will be overwritten.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the close() method is called.
      Parameters:
      name - the name of the information item to put.
      value - an floating-point value to be associated with the name in the dimension-specific information.
      dim - the dimension of this InfoStorer to put the information. For example in a 3-dimensional image you would put to dimension 0 for slice-specific info.
      n - the element to put to. For example in a 3-dimensional image you would put to slice n to info that applied only to slice n.
      Throws:
      IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
    • putInfo

      void putInfo(String name, String value, int dim, int n) throws IndexOutOfBoundsException
      Adds an item to the dimension-specific information. If an info item with the same name exists, then then value will be overwritten.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the close() method is called.
      Parameters:
      name - the name of the information item to put.
      value - a String value to be associated with the name in the dimension-specific information.
      dim - the dimension of this InfoStorer to put the information. For example in a 3-dimensional image you would put to dimension 0 for slice-specific info.
      n - the element to put to. For example in a 3-dimensional image you would put to slice n to info that applied only to slice n.
      Throws:
      IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
    • getSliceInfo

      String getSliceInfo(String name, int slice)
      Returns a String representing the value of the information item in a particular slice of this InfoStorer.

      The slice number is referenced from 0 to (number of slices - 1).

      Parameters:
      name - the name of the information item.
      slice - the slice number.
      Returns:
      a String representation of the value of the information, or null if the name is not found for the specified slice.
    • getFrameInfo

      String getFrameInfo(String name, int frame)
      Returns a String representing the value of the information item in a particular frame of this InfoStorer.

      The frame number is referenced from 0 to (number of frames - 1).

      Parameters:
      name - the name of the information item.
      frame - the frame number.
      Returns:
      a String representation of the value of the information, or null if the name is not found for the specified frame.
    • putSliceInfo

      void putSliceInfo(String name, String value, int slice) throws IndexOutOfBoundsException
      Adds an item to the slice-specific information. If an info item with the same name exists, then then value will be overwritten.

      The slice number is referenced from 0 to (number of slices - 1).
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.

      Parameters:
      name - the name of the information item to put.
      value - a String to be associated with the name in the slice-specific info.
      slice - the slice number.
      Throws:
      IndexOutOfBoundsException - if the requested slice is greater than the total number of slices in the image, or if the image is not at least 2-dimensional.
    • putFrameInfo

      void putFrameInfo(String name, String value, int frame) throws IndexOutOfBoundsException
      Adds an item to the frame-specific information. If an info item with the same name exists, then then value will be overwritten.

      The frame number is referenced from 0 to (number of frames).
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.

      Parameters:
      name - the name of the information item to put.
      value - a String to be associated with the name in the frame-specific info.
      frame - the frame number.
      Throws:
      IndexOutOfBoundsException - if the indicated frame is greater than the total number of frames in the image, or if the image is not at least 3-dimensional.
    • putSliceInfo

      void putSliceInfo(InfoList infoList, int slice) throws IndexOutOfBoundsException
      Adds all the items in an InfoList to the slice-specific information. If an info item with the same name exists, then then value will be overwritten.

      The slice number is referenced from 0 to (number of slices - 1).
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.

      Parameters:
      infoList - the list of InfoItems to put.
      slice - the slice number.
      Throws:
      IndexOutOfBoundsException - if the requested slice is greater than the total number of slices in the image, or if the image is not at least 2-dimensional.
    • putFrameInfo

      void putFrameInfo(InfoList infoList, int frame) throws IndexOutOfBoundsException
      Adds all the items in an InfoList to the frame-specific information. If an info item with the same name exists, then the value will be overwritten.

      The frame number is referenced from 0 to (number of frames - 1).
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.

      Parameters:
      infoList - the list of InfoItems to put.
      frame - the frame number.
      Throws:
      IndexOutOfBoundsException - if the specified frame is greater than or equal to the total number of frames in the image, or if the image is not at least 3-dimensional.
    • removeInfo

      void removeInfo(String name)
      Removes an item from the general file information. If an info item with the given name is not present in the general info, then this method does nothing.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information item to be removed.
    • removeInfo

      void removeInfo(String name, int dim, int n) throws IndexOutOfBoundsException
      Removes an item from the dimension-specific information. If an info item with the given name is not present in the dimension-specific, then this method does nothing.
      N.B. For disk-based images, the changes in the info will not be reflected on disk unless the MultiSliceImage.close() method is called.
      Parameters:
      name - the name of the information item to put.
      dim - the dimension of this InfoStorer to from which to remove the information. For example in a 3-dimensional image you would put to dimension 0 for slice-specific info.
      n - the element to from which to remove the info item. For example in a 3-dimensional image you would put to slice n to info that applied only to slice n.
      Throws:
      IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
    • getInfoList

      InfoList getInfoList()
      Returns an InfoList object which is the general info for this InfoStorer.
      Returns:
      an InfoList which is the general file info for this InfoStorer.
    • setInfoList

      void setInfoList(InfoList infoList)
      Sets a new InfoList to the general file info of this InfoStorer.
      Parameters:
      infoList - the InfoList object to set to the general file info for this InfoStorer.
    • getInfoList

      InfoList getInfoList(int dim, int n) throws IndexOutOfBoundsException
      Returns an InfoList object applying to a particular dimension/element for this InfoStorer.
      Parameters:
      dim - the dimension for which to get the information list.
      n - the element for which to get the information list.
      Returns:
      an InfoList object from a particular dimension of the InfoStorer.
      Throws:
      IndexOutOfBoundsException - if the dimensions supplied do not match this InfoStorer.
    • getSliceInfoList

      InfoList getSliceInfoList(int slice) throws IndexOutOfBoundsException
      Returns an InfoList object applying to a particular slice of this InfoStorer.

      The slice number is referenced from 0 to (number of slices - 1).

      Parameters:
      slice - the slice number.
      Returns:
      an InfoList object from a particular slice of this InfoStorer.
      Throws:
      IndexOutOfBoundsException - if the slice supplied is inappropriate for the dimensions of this InfoStorer.
    • getFrameInfoList

      InfoList getFrameInfoList(int frame) throws IndexOutOfBoundsException
      Returns an InfoList object applying to a particular frame of this InfoStorer.

      The frame number is referenced from 0 to (number of frames - 1).

      Parameters:
      frame - the frame number.
      Returns:
      an InfoList object from a particular frame of this InfoStorer.
      Throws:
      IndexOutOfBoundsException - if the frame supplied is inappropriate for the dimensions of this InfoStorer.
    • setInfoList

      void setInfoList(InfoList infoList, int dim, int n) throws IndexOutOfBoundsException
      Sets a new InfoList a specific dimension of this InfoStorer.
      Parameters:
      infoList - the InfoList to associate with this InfoStorer/dimension.
      dim - the dimension to which to set the information list.
      n - the element to which to set the information list.
      Throws:
      IndexOutOfBoundsException - if the dimensions supplied do not match this InfoStorer or the InfoList cannot be set.
    • setSliceInfoList

      void setSliceInfoList(InfoList infoList, int slice) throws IndexOutOfBoundsException
      Sets a new InfoList a specific slice of this InfoStorer.
      Parameters:
      infoList - the InfoList to associate with this InfoStorer/slice.
      slice - the slice for which to set the information list.
      Throws:
      IndexOutOfBoundsException - if the slice supplied does not match this InfoStorer.
    • setFrameInfoList

      void setFrameInfoList(InfoList infoList, int frame) throws IndexOutOfBoundsException
      Sets a new InfoList a specific frame of this InfoStorer.
      Parameters:
      infoList - the InfoList to associate with this InfoStorer/frame.
      frame - the frame for which to set the information list.
      Throws:
      IndexOutOfBoundsException - if the frame supplied does not match this InfoStorer.
    • appendInfoList

      void appendInfoList(InfoList list)
      Appends an InfoList to the existing general file info of this InfoStorer.
      Parameters:
      list - the InfoList object to append to the general file info for this InfoStorer.
    • appendInfoList

      void appendInfoList(InfoList list, int dim, int n) throws InvalidImageException, IndexOutOfBoundsException
      Appends an InfoList to that existing for a specific dimension of this InfoStorer.
      Parameters:
      list - the InfoList to append.
      dim - the dimension to which to append the information list.
      n - the element to which to append the information list.
      Throws:
      InvalidImageException - if the dimensions are invalid for this InfoStorer.
      IndexOutOfBoundsException - if the dimensions supplied do not match this InfoStorer.
    • getIntegerInfo

      default Integer getIntegerInfo(String name)
      Returns an Integer representing the value of an information item in the general image information.
      Parameters:
      name - the name of the information field.
      Returns:
      an Integer representation of the value of the information field, or null if the name is not found in the general info, or the value could not be parsed as an Integer.
    • getFloatInfo

      default Float getFloatInfo(String name)
      Returns a Float representing the value of an information item in the general image information.
      Parameters:
      name - the name of the information field.
      Returns:
      an Float representation of the value of the information field, or null if the name is not found in the general info, or the value could not be parsed as an Float.
    • getFloatInfo

      default Float getFloatInfo(String name, int dim, int n)
      Returns a Float representing the value of an information item in a particular dimension of this InfoStorer.
      Parameters:
      name - the name of the information item.
      dim - the dimension of this InfoStorer to look for the information. For example in a 3-dimensional image you would look in dimension 0 for slice-specific info.
      n - the element to look in. For example in a 3-dimensional image you would look in slice n to info that applied only to slice n.
      Returns:
      a Float representation of the value of the information, or null if the name is not found in the dimension/element info or the value cannot be parsed as a Float.
    • getVectorInfo

      default org.jogamp.vecmath.Vector3f getVectorInfo(String name, int dim, int n) throws IndexOutOfBoundsException
      Returns a Vector3f representing the value of an information item in a particular dimension of this InfoStorer.
      Parameters:
      name - the name of the information item.
      dim - the dimension of this InfoStorer to look for the information. For example in a 3-dimensional image you would look in dimension 0 for slice-specific info.
      n - the element to look in. For example in a 3-dimensional image you would look in slice n to info that applied only to slice n.
      Returns:
      a Vector3f representation of the value of the information, or null if the name is not found in the dimension/element info or the value cannot be parsed as a Vector3f.
      Throws:
      IndexOutOfBoundsException