Class InfoExtendedData
java.lang.Object
com.xinapse.multisliceimage.Analyze.InfoExtendedData
- All Implemented Interfaces:
Cloneable
NIFTI 1.1 extended data that allows artibrary text to be associated with an image.
The extension is XML, and is to allow assignment of arbitary text to document the image.
In addition, each dimension of the image, and element of that dimension, can have
textual information assigned. For example, if there is a time dimension, each time sample
could have a time stamp or a "state" assigned. If there is a "slice" dimension,
each slice could have a record of the DICOM file from which the pixel data was extracted.
The XML is always standalone and has an internal DTD as in the example below.
The GeneralInfoList is a list of InfoItems, and contains information about the image as a whole.
A DimInfoList contains information about a specific dimension, and the attributes
Dimension and Element show which dimension is involved.
For example for a 3-D dataset, Dimension="Slice" refers to the slice dimension, Dimension="Row"
to the row dimension and Dimension="Col" to the column dimension.
For Dimension="Slice", Element="0" refers to the first slice, Element="1" to the second slice
etc.
The information is stored in an InfoItem, which has a name,value structure and the name can
be used to lookup any of the values.
This is the DTD for InfoExtendedData
documents:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <!DOCTYPE InfoExtendedData [ <!ELEMENT InfoExtendedData (GeneraInfoList?, DimInfoList*)> <!ELEMENT GeneraInfoList (InfoItem*)> <!ELEMENT DimInfoList (InfoItem*)> <!ATTLIST DimInfoList Dimension (Col | Row | Slice | Time | 5 | 6 | 7 | 8 | 9 | 10) #REQUIRED Element CDATA #REQU IRED> <!ELEMENT InfoItem (Name,Value)> <!ELEMENT Name (#PCDATA)> <!ELEMENT Value (#PCDATA)> <!--Xinapse Multi-Dimensional Image Extended Data-->Here's an example of
InfoExtendedData
with information having been stored in the
"general" image information, and also in the Slice, and Row dimensions of the image.
There is a piece of information for slice 0, and another for slice 1.
<!--Xinapse Multi-Dimensional Image Extended Data--> <InfoExtendedData> <GeneraInfoList> <InfoItem> <Name>PatientName</Name> <Value>Smith, AB</Value> </InfoItem> <InfoItem> <Name><0x00100, 0x200A></Name> <Value>Tag <0x001B, 0x134z> A DICOM Element (3)</Value> </InfoItem> <InfoItem> <Name><0x00101, 0x200A></Name> <Value>Tag <0x001B, 0x134z> A DICOM Element</Value> </InfoItem> </GeneraInfoList> <DimInfoList Dimension="Slice" Element="0"> <InfoItem> <Name><0x00101, 0x200A></Name> <Value>Tag <0x001B, 0x134z> A DICOM Element A</Value> </InfoItem> </DimInfoList> <DimInfoList Dimension="Slice" Element="1"> <InfoItem> <Name><0x00101, 0x200A></Name> <Value>Tag <0x001B, 0x134z> A DICOM Element A</Value> </InfoItem> </DimInfoList> <DimInfoList Dimension="Row" Element="1"> <InfoItem> <Name><0x00101, 0x200A></Name> <Value>Tag <0x001B, 0x134z> A DICOM Element "C"</Value> </InfoItem> </DimInfoList> </InfoExtendedData>Here's how general information information looks after it has been read in and converted to a
String
using the toString()
method:
PatientName=Smith, AB <0x00100, 0x200A>=Tag <0x001B, 0x134z> A DICOM Element (3) <0x00101, 0x200A>=Tag <0x001B, 0x134z> A DICOM ElementYou should not manipulate the
InfoExtendedData
directly, but should use methods
of the InfoStorer
interface (such as NIFTIImage.getInfo(String)
,
and NIFTIImage.putInfo(String, int)
).-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
static com.xinapse.multisliceimage.Analyze.ExtendedData
getInstance
(byte[] bArray, int eCode) Creates a new block of NIFTI extended data.static void
Runs the self-test of the InfoExtendedData class.toString()
-
Field Details
-
CODE
public static final int CODEThe ecode for anInfoExtendedData
extension.- See Also:
-
-
Method Details
-
clone
-
toString
-
main
Runs the self-test of the InfoExtendedData class.- Parameters:
args
- ignored.
-
getInstance
public static com.xinapse.multisliceimage.Analyze.ExtendedData getInstance(byte[] bArray, int eCode) throws IOException Creates a new block of NIFTI extended data.- Parameters:
bArray
- the data that encapsulates the extended data.eCode
- the ecode for the extended data.- Returns:
- a new block of NIFTI extended data.
- Throws:
IOException
- if the length of the byte[] is not a multiple of 16.
-