Interface InfoStorer
- All Known Implementing Classes:
NIFTI2Image, NIFTIImage, UNCImage
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendInfoList(InfoList list) Appends anInfoListto the existing general file info of thisInfoStorer.voidappendInfoList(InfoList list, int dim, int n) Appends anInfoListto that existing for a specific dimension of thisInfoStorer.default FloatgetFloatInfo(String name) Returns a Float representing the value of an information item in the general image information.default FloatgetFloatInfo(String name, int dim, int n) Returns aFloatrepresenting the value of an information item in a particular dimension of thisInfoStorer.getFrameInfo(String name, int frame) Returns aStringrepresenting the value of the information item in a particular frame of thisInfoStorer.getFrameInfoList(int frame) Returns anInfoListobject applying to a particular frame of thisInfoStorer.Returns a string representing the value of an information item in the general image information.Returns aStringrepresenting the value of an information item in a particular dimension of thisInfoStorer.Returns anInfoListobject which is the general info for thisInfoStorer.getInfoList(int dim, int n) Returns anInfoListobject applying to a particular dimension/element for thisInfoStorer.default IntegergetIntegerInfo(String name) Returns an Integer representing the value of an information item in the general image information.getSliceInfo(String name, int slice) Returns aStringrepresenting the value of the information item in a particular slice of thisInfoStorer.getSliceInfoList(int slice) Returns anInfoListobject applying to a particular slice of thisInfoStorer.default org.jogamp.vecmath.Vector3fgetVectorInfo(String name, int dim, int n) Returns aVector3frepresenting the value of an information item in a particular dimension of thisInfoStorer.voidputFrameInfo(InfoList infoList, int frame) Adds all the items in an InfoList to the frame-specific information.voidputFrameInfo(String name, String value, int frame) Adds an item to the frame-specific information.voidAdds an item to the general file info.voidAdds an item to the dimension-specific information.voidAdds an item to the general file info.voidAdds an item to the dimension-specific information.voidAdds an item to the general file info.voidAdds an item to the dimension-specific information.voidputSliceInfo(InfoList infoList, int slice) Adds all the items in an InfoList to the slice-specific information.voidputSliceInfo(String name, String value, int slice) Adds an item to the slice-specific information.voidremoveInfo(String name) Removes an item from the general file information.voidremoveInfo(String name, int dim, int n) Removes an item from the dimension-specific information.voidsetFrameInfoList(InfoList infoList, int frame) Sets a newInfoLista specific frame of thisInfoStorer.voidsetInfoList(InfoList infoList) Sets a newInfoListto the general file info of thisInfoStorer.voidsetInfoList(InfoList infoList, int dim, int n) Sets a newInfoLista specific dimension of thisInfoStorer.voidsetSliceInfoList(InfoList infoList, int slice) Sets a newInfoLista specific slice of thisInfoStorer.
-
Method Details
-
getInfo
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
Stringrepresentation of the value of an information field, or null 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 theMultiSliceImage.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
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 theMultiSliceImage.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
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 theMultiSliceImage.close()method is called.- Parameters:
name- the name of the information to put.value- aStringto be associated with the name in the general file information.
-
getInfo
Returns aStringrepresenting the value of an information item in a particular dimension of thisInfoStorer. 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 slicento info that applied only to slicen.- Returns:
- a
Stringrepresentation of the value of the information, or null if the name is not found in the 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 theMultiSliceImage.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 thisInfoStorerto 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 slicento info that applied only to slicen.- Throws:
IndexOutOfBoundsException- if the requested dimensions do not exist in the image.
-
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 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 thisInfoStorerto 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 slicento info that applied only to slicen.- Throws:
IndexOutOfBoundsException- if the requested dimensions do not exist in the image.
-
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 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 thisInfoStorerto 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 slicento info that applied only to slicen.- Throws:
IndexOutOfBoundsException- if the requested dimensions do not exist in the image.
-
getSliceInfo
Returns aStringrepresenting the value of the information item in a particular slice of thisInfoStorer.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
Stringrepresentation of the value of the information, or null if the name is not found for the specified slice.
-
getFrameInfo
Returns aStringrepresenting the value of the information item in a particular frame of thisInfoStorer.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
Stringrepresentation of the value of the information, or null if the name is not found for the specified frame.
-
putSliceInfo
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 theMultiSliceImage.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
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 theMultiSliceImage.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
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 theMultiSliceImage.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
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 theMultiSliceImage.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
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 theMultiSliceImage.close()method is called.- Parameters:
name- the name of the information item to 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 theMultiSliceImage.close()method is called.- Parameters:
name- the name of the information item to put.dim- the dimension of thisInfoStorerto 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 slicento info that applied only to slicen.- Throws:
IndexOutOfBoundsException- if the requested dimensions do not exist in the image.
-
getInfoList
InfoList getInfoList()Returns anInfoListobject which is the general info for thisInfoStorer.- Returns:
- an
InfoListwhich is the general file info for thisInfoStorer.
-
setInfoList
Sets a newInfoListto the general file info of thisInfoStorer.- Parameters:
infoList- theInfoListobject to set to the general file info for thisInfoStorer.
-
getInfoList
Returns anInfoListobject applying to a particular dimension/element for thisInfoStorer.- Parameters:
dim- the dimension for which to get the information list.n- the element for which to get the information list.- Returns:
- an
InfoListobject from a particular dimension of theInfoStorer. - Throws:
IndexOutOfBoundsException- if the dimensions supplied do not match thisInfoStorer.
-
getSliceInfoList
Returns anInfoListobject applying to a particular slice of thisInfoStorer.The slice number is referenced from 0 to (number of slices - 1).
- Parameters:
slice- the slice number.- Returns:
- an
InfoListobject from a particular slice of thisInfoStorer. - Throws:
IndexOutOfBoundsException- if the slice supplied is inappropriate for the dimensions of thisInfoStorer.
-
getFrameInfoList
Returns anInfoListobject applying to a particular frame of thisInfoStorer.The frame number is referenced from 0 to (number of frames - 1).
- Parameters:
frame- the frame number.- Returns:
- an
InfoListobject from a particular frame of thisInfoStorer. - Throws:
IndexOutOfBoundsException- if the frame supplied is inappropriate for the dimensions of thisInfoStorer.
-
setInfoList
Sets a newInfoLista specific dimension of thisInfoStorer.- Parameters:
infoList- theInfoListto associate with thisInfoStorer/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 thisInfoStoreror theInfoListcannot be set.
-
setSliceInfoList
Sets a newInfoLista specific slice of thisInfoStorer.- Parameters:
infoList- theInfoListto associate with thisInfoStorer/slice.slice- the slice for which to set the information list.- Throws:
IndexOutOfBoundsException- if the slice supplied does not match thisInfoStorer.
-
setFrameInfoList
Sets a newInfoLista specific frame of thisInfoStorer.- Parameters:
infoList- theInfoListto associate with thisInfoStorer/frame.frame- the frame for which to set the information list.- Throws:
IndexOutOfBoundsException- if the frame supplied does not match thisInfoStorer.
-
appendInfoList
Appends anInfoListto the existing general file info of thisInfoStorer.- Parameters:
list- theInfoListobject to append to the general file info for thisInfoStorer.
-
appendInfoList
void appendInfoList(InfoList list, int dim, int n) throws InvalidImageException, IndexOutOfBoundsException Appends anInfoListto that existing for a specific dimension of thisInfoStorer.- Parameters:
list- theInfoListto 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 thisInfoStorer.
-
getIntegerInfo
Returns an Integer representing the value of an information item in the general image information. -
getFloatInfo
Returns a Float representing the value of an information item in the general image information. -
getFloatInfo
Returns aFloatrepresenting the value of an information item in a particular dimension of thisInfoStorer.- Parameters:
name- the name of the information item.dim- the dimension of thisInfoStorerto 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 slicento info that applied only to slicen.- Returns:
- a
Floatrepresentation 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 aFloat.
-
getVectorInfo
default org.jogamp.vecmath.Vector3f getVectorInfo(String name, int dim, int n) throws IndexOutOfBoundsException Returns aVector3frepresenting the value of an information item in a particular dimension of thisInfoStorer.- Parameters:
name- the name of the information item.dim- the dimension of thisInfoStorerto 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 slicento info that applied only to slicen.- Returns:
- a
Vector3frepresentation 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 aVector3f. - Throws:
IndexOutOfBoundsException
-