Interface InfoStorer
- All Known Implementing Classes:
NIFTI2Image
,NIFTIImage
,UNCImage
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendInfoList
(InfoList list) Appends anInfoList
to the existing general file info of this image.void
appendInfoList
(InfoList list, int dim, int n) Appends anInfoList
to that existing for a specific dimension of this image.getFrameInfo
(String name, int frame) Returns aString
representing the value of this information item in a particular frame of this image.getFrameInfoList
(int frame) Returns anInfoList
object applying to a particular frame of this image.Returns a string representing the value of this information item in the general image information.Returns aString
representing the value of this information item in a particular dimension of this image.Returns anInfoList
object which is the general info for this image.getInfoList
(int dim, int n) Returns anInfoList
object applying to a particular dimension/element for this image.getSliceInfo
(String name, int slice) Returns aString
representing the value of this information item in a particular slice of this image.getSliceInfoList
(int slice) Returns anInfoList
object applying to a particular slice of this image.void
putFrameInfo
(InfoList infoList, int frame) Adds all the items in an InfoList to the frame-specific information.void
putFrameInfo
(String name, String value, int frame) Adds an item to the frame-specific information.void
Adds an item to the general file info.void
Adds an item to the dimension-specific information.void
Adds an item to the general file info.void
Adds an item to the dimension-specific information.void
Adds an item to the general file info.void
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
(String name, String value, int slice) Adds an item to the slice-specific information.void
removeInfo
(String name) Removes an item from the general file information.void
removeInfo
(String name, int dim, int n) Removes an item from the dimension-specific information.void
setFrameInfoList
(InfoList infoList, int frame) Sets a newInfoList
a specific frame of this image.void
setInfoList
(InfoList infoList) Sets a newInfoList
to the general file info of this image.void
setInfoList
(InfoList infoList, int dim, int n) Sets a newInfoList
a specific dimension of this image.void
setSliceInfoList
(InfoList infoList, int slice) Sets a newInfoList
a specific slice of this image.
-
Method Details
-
getInfo
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
String
representation of the value of this information field. - Throws:
InfoNotFoundException
- if the name is not found in the general info.
-
putInfo
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 theReadableImage.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:
IOException
- if the information cannot be added because of an I/O error.
-
putInfo
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 theReadableImage.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:
IOException
- if the information cannot be addded because of an I/O error.
-
putInfo
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 theReadableImage.close()
method is called.- Parameters:
name
- the name of the information to put.value
- aString
to be associated with this name in the general file information.- Throws:
IOException
- if the information cannot be addded because of an I/O error.
-
getInfo
Returns aString
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 slicen
to info that applied only to slicen
.- Returns:
- a
String
representation of the value of this information. - Throws:
InfoNotFoundException
- if the name is not found in this dimension/element info.
-
putInfo
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 theReadableImage.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 slicen
to info that applied only to slicen
.- Throws:
IndexOutOfBoundsException
- if the requested dimensions do not exist in the image.IOException
- if the information cannot be addded because of an I/O error.
-
putInfo
void putInfo(String name, float value, int dim, int n) throws IOException, 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 slicen
to info that applied only to slicen
.- Throws:
IndexOutOfBoundsException
- if the requested dimensions do not exist in the image.IOException
- if the information cannot be addded because of an I/O error.
-
putInfo
void putInfo(String name, String value, int dim, int n) throws IOException, 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 slicen
to info that applied only to slicen
.- Throws:
IndexOutOfBoundsException
- if the requested dimensions do not exist in the image.IOException
- if the information cannot be addded because of an I/O error.
-
getSliceInfo
Returns aString
representing the value of this information item in a particular slice of this image.The slice number is referenced from 0 to (number of slices - 1).
- Parameters:
name
- the name of this information item.slice
- the slice number.- Returns:
- a
String
representation of the value of this information. - Throws:
InfoNotFoundException
- if the name is not found for the specified slice.
-
getFrameInfo
Returns aString
representing the value of this information item in a particular frame of this image.The frame number is referenced from 0 to (number of frames - 1).
- Parameters:
name
- the name of this information item.frame
- the frame number.- Returns:
- a
String
representation of the value of this information. - Throws:
InfoNotFoundException
- if the name is not found for the specified frame.
-
putSliceInfo
void putSliceInfo(String name, String value, int slice) throws IndexOutOfBoundsException, 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 (number of slices - 1).
N.B. For disk-based images, the changes in the info will not be reflected on disk unless theReadableImage.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:
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.IOException
- if the information cannot be added because of an I/O error.
-
putFrameInfo
void putFrameInfo(String name, String value, int frame) throws IndexOutOfBoundsException, IOException 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 theReadableImage.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 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.IOException
- if the information cannot be added because of an I/O error.
-
putSliceInfo
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 theReadableImage.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.IOException
- if the information cannot be added because of an I/O error.
-
putFrameInfo
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 theReadableImage.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.IOException
- if the information cannot be added because of an I/O error.
-
removeInfo
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 theReadableImage.close()
method is called.- Parameters:
name
- the name of the information item to be removed.- Throws:
IOException
- if the information cannot be removed.
-
removeInfo
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 theReadableImage.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 slicen
to info that applied only to slicen
.- Throws:
IndexOutOfBoundsException
- if the requested dimensions do not exist in the image.IOException
- if the information cannot be removed.
-
getInfoList
InfoList getInfoList()Returns anInfoList
object which is the general info for this image.- Returns:
- an
InfoList
which is the general file info for thisInfoStorer
.
-
setInfoList
Sets a newInfoList
to the general file info of this image.- Parameters:
infoList
- theInfoList
object to set to the general file info for this image.- Throws:
IOException
- if theInfoList
cannot be set.
-
getInfoList
Returns anInfoList
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 thisInfoStorer
. - Throws:
IndexOutOfBoundsException
- if the dimensions supplied do not match this image.
-
getSliceInfoList
Returns anInfoList
object applying to a particular slice of this image.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 thisInfoStorer
. - Throws:
IndexOutOfBoundsException
- if the slice supplied is inappropriate for the dimensions of this image.
-
getFrameInfoList
Returns anInfoList
object applying to a particular frame of this image.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 thisInfoStorer
. - Throws:
IndexOutOfBoundsException
- if the frame supplied is inappropriate for the dimensions of this image.
-
setInfoList
Sets a newInfoList
a specific dimension of this image.- Parameters:
infoList
- theInfoList
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:
IndexOutOfBoundsException
- if the dimensions supplied do not match this image or theInfoList
cannot be set.IOException
- if theInfoList
cannot be set.
-
setSliceInfoList
Sets a newInfoList
a specific slice of this image.- Parameters:
infoList
- theInfoList
to associate with this image/slice.slice
- the slice for which to set the information list.- Throws:
IndexOutOfBoundsException
- if the slice supplied does not match this image.IOException
- if theInfoList
cannot be set.
-
setFrameInfoList
Sets a newInfoList
a specific frame of this image.- Parameters:
infoList
- theInfoList
to associate with this image/frame.frame
- the frame for which to set the information list.- Throws:
IndexOutOfBoundsException
- if the frame supplied does not match this image.IOException
- if theInfoList
cannot be set.
-
appendInfoList
Appends anInfoList
to the existing general file info of this image.- Parameters:
list
- theInfoList
object to append to the general file info for this image.- Throws:
IOException
- if theInfoList
cannot be appended because of an I/O error.
-
appendInfoList
void appendInfoList(InfoList list, int dim, int n) throws InvalidImageException, IndexOutOfBoundsException, IOException Appends anInfoList
to that existing for a specific dimension of this image.- Parameters:
list
- theInfoList
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 image.IOException
- if theInfoList
cannot be appended because of an I/O error.
-