com.xinapse.multisliceimage
Interface InfoStorer

All Known Implementing Classes:
NIFTIImage, UNCImage

public interface InfoStorer

An interface the MultiSliceImage classes implement to indicate that they can store arbitrary textual information.


Method Summary
 void appendInfoList(InfoList list)
          Appends an InfoList to the existing general file info of this image.
 void appendInfoList(InfoList list, int dim, int n)
          Appends an InfoList to that existing for a specific dimension of this image.
 java.lang.String getInfo(java.lang.String name)
          Returns a string representing the value of this information item in the general image information.
 java.lang.String getInfo(java.lang.String name, int dim, int n)
          Returns a java.lang.String representing the value of this information item in a particular dimension of this image.
 InfoList getInfoList()
          Returns an InfoList object which is the general info for this image.
 InfoList getInfoList(int dim, int n)
          Returns an InfoList object applying to a particular dimension/element for this image.
 java.lang.String getSliceInfo(java.lang.String name, int slice)
          Returns a java.lang.String representing the value of this information item in a particular slice of this image.
 InfoList getSliceInfoList(int slice)
          Returns an InfoList object applying to a particular slice of this image.
 void putInfo(java.lang.String name, float value)
          Adds an item to the general file info.
 void putInfo(java.lang.String name, float value, int dim, int n)
          Adds an item to the dimension-specific information.
 void putInfo(java.lang.String name, int value)
          Adds an item to the general file info.
 void putInfo(java.lang.String name, int value, int dim, int n)
          Adds an item to the dimension-specific information.
 void putInfo(java.lang.String name, java.lang.String value)
          Adds an item to the general file info.
 void putInfo(java.lang.String name, java.lang.String value, int dim, int n)
          Adds an item to the dimension-specific information.
 void putSliceInfo(InfoList infoList, int slice)
          Adds all the items in an InfoList to the slice-specific information.
 void putSliceInfo(java.lang.String name, java.lang.String value, int slice)
          Adds an item to the slice-specific information.
 void removeInfo(java.lang.String name)
          Removes an item from the general file information.
 void removeInfo(java.lang.String name, int dim, int n)
          Removes an item from the dimension-specific information.
 void setInfoList(InfoList infoList)
          Sets a new InfoList to the general file info of this image.
 void setInfoList(InfoList infoList, int dim, int n)
          Sets a new InfoList a specific dimension of this image.
 void setSliceInfoList(InfoList infoList, int slice)
          Sets a new InfoList a specific slice of this image.
 

Method Detail

getInfo

java.lang.String getInfo(java.lang.String name)
                         throws InfoNotFoundException
Returns a string representing the value of this 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 this information field.
Returns:
a java.lang.String representation of the value of this information field.
Throws:
InfoNotFoundException - if the name is not found in the general info.

putInfo

void putInfo(java.lang.String name,
             int value)
             throws java.io.IOException
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 close() method is called.

Parameters:
name - the name of the information field to put.
value - an integer value to be associated with this name in the general file information.
Throws:
java.io.IOException - if the information cannot be added.

putInfo

void putInfo(java.lang.String name,
             float value)
             throws java.io.IOException
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 close() method is called.

Parameters:
name - the name of the information to put.
value - a floating point value to be associated with this name in the general file information.
Throws:
java.io.IOException - if the information cannot be addded.

putInfo

void putInfo(java.lang.String name,
             java.lang.String value)
             throws java.io.IOException
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 close() method is called.

Parameters:
name - the name of the information to put.
value - a java.lang.String to be associated with this name in the general file information.
Throws:
java.io.IOException - if the information cannot be addded.

getInfo

java.lang.String getInfo(java.lang.String name,
                         int dim,
                         int n)
                         throws InfoNotFoundException
Returns a java.lang.String representing the value of this information item in a particular dimension of this image. For example, if there is a item "pixel_x_size=0.91162" in the file info for this dimension, and a name "pixel_x_size" is supplied, then this method will return "0.91162".

Parameters:
name - the name of this information item.
dim - the dimension of this 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 java.lang.String representation of the value of this information.
Throws:
InfoNotFoundException - if the name is not found in this dimension/element info.

putInfo

void putInfo(java.lang.String name,
             int value,
             int dim,
             int n)
             throws java.io.IOException,
                    java.lang.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 integer value to be associated with this name in the general file information.
dim - the dimension of this image 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:
java.lang.IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
java.io.IOException - if the information cannot be addded.

putInfo

void putInfo(java.lang.String name,
             float value,
             int dim,
             int n)
             throws java.io.IOException,
                    java.lang.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 this name in the dimension-specific information.
dim - the dimension of this image 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:
java.lang.IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
java.io.IOException - if the information cannot be addded.

putInfo

void putInfo(java.lang.String name,
             java.lang.String value,
             int dim,
             int n)
             throws java.io.IOException,
                    java.lang.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 this name in the dimension-specific information.
dim - the dimension of this image 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:
java.lang.IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
java.io.IOException - if the information cannot be addded.

getSliceInfo

java.lang.String getSliceInfo(java.lang.String name,
                              int slice)
                              throws InfoNotFoundException
Returns a java.lang.String representing the value of this information item in a particular slice of this image.

The slice number is referenced from 0 to (total number of slice - 1) regardless of the number of samples in the "slice" dimension of the image.

Parameters:
name - the name of this information item.
slice - the slice number.
Returns:
a java.lang.String representation of the value of this information.
Throws:
InfoNotFoundException - if the name is not found for the specified slice.

putSliceInfo

void putSliceInfo(java.lang.String name,
                  java.lang.String value,
                  int slice)
                  throws java.lang.IndexOutOfBoundsException,
                         java.io.IOException
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 (total number of slice - 1) regardless of the number of samples in the "slice" dimension of the image.
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 to be associated with this name in the slice-specific info.
slice - the slice number.
Throws:
java.lang.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.
java.io.IOException - if the information cannot be added.

putSliceInfo

void putSliceInfo(InfoList infoList,
                  int slice)
                  throws java.lang.IndexOutOfBoundsException,
                         java.io.IOException
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 (total number of slice - 1) regardless of the number of samples in the "slice" dimension of the image.
N.B. For disk-based images, the changes in the info will not be reflected on disk unless the close() method is called.

Parameters:
infoList - the list of InfoItems to put.
slice - the slice number.
Throws:
java.lang.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.
java.io.IOException - if the information cannot be added.

removeInfo

void removeInfo(java.lang.String name)
                throws java.io.IOException
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 close() method is called.

Parameters:
name - the name of the information item to be removed.
Throws:
java.io.IOException - if the information cannot be removed.

removeInfo

void removeInfo(java.lang.String name,
                int dim,
                int n)
                throws java.io.IOException,
                       java.lang.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 close() method is called.

Parameters:
name - the name of the information item to put.
dim - the dimension of this image 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:
java.lang.IndexOutOfBoundsException - if the requested dimensions do not exist in the image.
java.io.IOException - if the information cannot be removed.

getInfoList

InfoList getInfoList()
Returns an InfoList object which is the general info for this image.

Returns:
an InfoList which is the general file info for this InfoStorer.

setInfoList

void setInfoList(InfoList infoList)
                 throws java.io.IOException
Sets a new InfoList to the general file info of this image.

Parameters:
infoList - the InfoList object to set to the general file info for this image.
Throws:
java.io.IOException - if the InfoList cannot be set.

getInfoList

InfoList getInfoList(int dim,
                     int n)
                     throws java.lang.IndexOutOfBoundsException
Returns an InfoList object applying to a particular dimension/element for this image.

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 this InfoStorer.
Throws:
java.lang.IndexOutOfBoundsException - if the dimensions supplied do not match this image.

getSliceInfoList

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

Parameters:
slice - the slice number.
Returns:
an InfoList object from a particular slice of this InfoStorer.
Throws:
java.lang.IndexOutOfBoundsException - if the slice supplied does not match this image.

setInfoList

void setInfoList(InfoList infoList,
                 int dim,
                 int n)
                 throws java.lang.IndexOutOfBoundsException,
                        java.io.IOException
Sets a new InfoList a specific dimension of this image.

Parameters:
infoList - the InfoList to associate with this image/dimension.
dim - the dimension to which to set the information list.
n - the element to which to set the information list.
Throws:
java.lang.IndexOutOfBoundsException - if the dimensions supplied do not match this image or the InfoList cannot be set.
java.io.IOException - if the InfoList cannot be set.

setSliceInfoList

void setSliceInfoList(InfoList infoList,
                      int slice)
                      throws java.lang.IndexOutOfBoundsException,
                             java.io.IOException
Sets a new InfoList a specific slice of this image.

Parameters:
infoList - the InfoList to associate with this image/slice.
slice - the slice for which to set the information list.
Throws:
java.lang.IndexOutOfBoundsException - if the slice supplied does not match this image.
java.io.IOException - if the InfoList cannot be set.

appendInfoList

void appendInfoList(InfoList list)
                    throws java.io.IOException
Appends an InfoList to the existing general file info of this image.

Parameters:
list - the InfoList object to append to the general file info for this image.
Throws:
java.io.IOException - if the InfoList cannot be appended.

appendInfoList

void appendInfoList(InfoList list,
                    int dim,
                    int n)
                    throws MultiSliceImageException,
                           java.io.IOException
Appends an InfoList to that existing for a specific dimension of this image.

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:
java.lang.IndexOutOfBoundsException - if the dimensions supplied do not match this image.
java.io.IOException - if the InfoList cannot be appended.
MultiSliceImageException


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.