FreeMat
|
Section: Visualization Toolkit IO Classes
This class provides methods to access all of the information contained in the MINC header. If you read a MINC file into VTK and then write it out again, you can use writer->SetImageAttributes(reader->GetImageAttributes) to ensure that all of the medical information contained in the file is tranferred from the reader to the writer. If you want to change any of the header information, you must use ShallowCopy to make a copy of the reader's attributes and then modify only the copy.
To create an instance of class vtkMINCImageAttributes, simply invoke its constructor as follows
obj = vtkMINCImageAttributes
The class vtkMINCImageAttributes has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj
is an instance of the vtkMINCImageAttributes class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkMINCImageAttributes = obj.NewInstance ()
vtkMINCImageAttributes = obj.SafeDownCast (vtkObject o)
obj.Reset ()
- Reset all the attributes in preparation for loading new information. obj.SetName (string )
- Get the name of the image, not including the path or the extension. This is only needed for printing the header and there is usually no need to set it. string = obj.GetName ()
- Get the name of the image, not including the path or the extension. This is only needed for printing the header and there is usually no need to set it. obj.SetDataType (int )
- Get the image data type, as stored on disk. This information is useful if the file was converted to floating-point when it was loaded. When writing a file from float or double image data, you can use this method to prescribe the output type. int = obj.GetDataType ()
- Get the image data type, as stored on disk. This information is useful if the file was converted to floating-point when it was loaded. When writing a file from float or double image data, you can use this method to prescribe the output type. obj.AddDimension (string dimension)
- Add the names of up to five dimensions. The ordering of these dimensions will determine the dimension order of the file. If no DimensionNames are set, the writer will set the dimension order of the file to be the same as the dimension order in memory. obj.AddDimension (string dimension, vtkIdType length)
- Add the names of up to five dimensions. The ordering of these dimensions will determine the dimension order of the file. If no DimensionNames are set, the writer will set the dimension order of the file to be the same as the dimension order in memory. vtkStringArray = obj.GetDimensionNames ()
- Get the dimension names. The dimension names are same order as written in the file, starting with the slowest-varying dimension. Use this method to get the array if you need to change "space" dimensions to "frequency" after performing a Fourier transform. vtkIdTypeArray = obj.GetDimensionLengths ()
- Get the lengths of all the dimensions. The dimension lengths are informative, the vtkMINCImageWriter does not look at these values but instead uses the dimension sizes of its input. vtkStringArray = obj.GetVariableNames ()
- Get the names of all the variables. vtkStringArray = obj.GetAttributeNames (string variable)
- List the attribute names for a variable. Set the variable to the empty string to get a list of the global attributes. obj.SetImageMin (vtkDoubleArray imageMin)
- Get the image min and max arrays. These are set by the reader, but they aren't used by the writer except to compute the full real data range of the original file. obj.SetImageMax (vtkDoubleArray imageMax)
- Get the image min and max arrays. These are set by the reader, but they aren't used by the writer except to compute the full real data range of the original file. vtkDoubleArray = obj.GetImageMin ()
- Get the image min and max arrays. These are set by the reader, but they aren't used by the writer except to compute the full real data range of the original file. vtkDoubleArray = obj.GetImageMax ()
- Get the image min and max arrays. These are set by the reader, but they aren't used by the writer except to compute the full real data range of the original file. int = obj.GetNumberOfImageMinMaxDimensions ()
- Get the number of ImageMinMax dimensions. obj.SetNumberOfImageMinMaxDimensions (int )
- Get the number of ImageMinMax dimensions. int = obj.HasAttribute (string variable, string attribute)
- Check to see if a particular attribute exists. obj.SetAttributeValueAsArray (string variable, string attribute, vtkDataArray array)
- Set attribute values for a variable as a vtkDataArray. Set the variable to the empty string to access global attributes. vtkDataArray = obj.GetAttributeValueAsArray (string variable, string attribute)
- Set attribute values for a variable as a vtkDataArray. Set the variable to the empty string to access global attributes. obj.SetAttributeValueAsString (string variable, string attribute, string value)
- Set an attribute value as a string. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. string = obj.GetAttributeValueAsString (string variable, string attribute)
- Set an attribute value as a string. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. obj.SetAttributeValueAsInt (string variable, string attribute, int value)
- Set an attribute value as an int. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. int = obj.GetAttributeValueAsInt (string variable, string attribute)
- Set an attribute value as an int. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. obj.SetAttributeValueAsDouble (string variable, string attribute, double value)
- Set an attribute value as a double. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. double = obj.GetAttributeValueAsDouble (string variable, string attribute)
- Set an attribute value as a double. Set the variable to the empty string to access global attributes. If you specify a variable that does not exist, it will be created. int = obj.ValidateAttribute (string varname, string attname, vtkDataArray array)
- Validate a particular attribute. This involves checking that the attribute is a MINC standard attribute, and checking whether it can be set (as opposed to being set automatically from the image information). The return values is 0 if the attribute is set automatically and therefore should not be copied from here, 1 if this attribute is valid and should be set, and 2 if the attribute is non-standard. obj.ShallowCopy (vtkMINCImageAttributes source)
- Do a shallow copy. This will copy all the attributes from the source. It is much more efficient than a DeepCopy would be, since it only copies pointers to the attribute values instead of copying the arrays themselves. You must use this method to make a copy if you want to modify any MINC attributes from a MINCReader before you pass them to a MINCWriter. obj.FindValidRange (double range[2])
- Find the valid range of the data from the information stored in the attributes. obj.FindImageRange (double range[2])
- Find the image range of the data from the information stored in the attributes. obj.PrintFileHeader ()
- A diagnostic function. Print the header of the file in the same format as ncdump or mincheader.