VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkMetaImageReader Class Reference

read binary UNC meta image data More...

#include <vtkMetaImageReader.h>

Inheritance diagram for vtkMetaImageReader:
Inheritance graph
[legend]
Collaboration diagram for vtkMetaImageReader:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkImageReader2 Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkMetaImageReaderNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual const char * GetFileExtensions ()
virtual const char * GetDescriptiveName ()
doubleGetPixelSpacing ()
int GetWidth ()
int GetHeight ()
doubleGetImagePositionPatient ()
int GetNumberOfComponents ()
int GetPixelRepresentation ()
int GetDataByteOrder (void)
virtual double GetRescaleSlope ()
virtual double GetRescaleOffset ()
virtual int GetBitsAllocated ()
virtual char * GetDistanceUnits ()
virtual char * GetAnatomicalOrientation ()
virtual double GetGantryAngle ()
virtual char * GetPatientName ()
virtual char * GetPatientID ()
virtual char * GetDate ()
virtual char * GetSeries ()
virtual char * GetImageNumber ()
virtual char * GetModality ()
virtual char * GetStudyID ()
virtual char * GetStudyUID ()
virtual char * GetTransferSyntaxUID ()
virtual int CanReadFile (const char *name)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkMetaImageReaderSafeDownCast (vtkObjectBase *o)
static vtkMetaImageReaderNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkMetaImageReader ()
 ~vtkMetaImageReader ()
void ExecuteInformation ()
void ExecuteDataWithInformation (vtkDataObject *out, vtkInformation *outInfo)
virtual int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)

Detailed Description

read binary UNC meta image data

One of the formats for which a reader is already available in the toolkit is the MetaImage file format. This is a fairly simple yet powerful format consisting of a text header and a binary data section. The following instructions describe how you can write a MetaImage header for the data that you download from the BrainWeb page.

The minimal structure of the MetaImage header is the following:

NDims = 3 DimSize = 181 217 181 ElementType = MET_UCHAR ElementSpacing = 1.0 1.0 1.0 ElementByteOrderMSB = False ElementDataFile = brainweb1.raw

NDims indicate that this is a 3D image. ITK can handle images of arbitrary dimension. DimSize indicates the size of the volume in pixels along each direction. ElementType indicate the primitive type used for pixels. In this case is "unsigned char", implying that the data is digitized in 8 bits / pixel. ElementSpacing indicates the physical separation between the center of one pixel and the center of the next pixel along each direction in space. The units used are millimeters. ElementByteOrderMSB indicates is the data is encoded in little or big endian order. You might want to play with this value when moving data between different computer platforms. ElementDataFile is the name of the file containing the raw binary data of the image. This file must be in the same directory as the header.

MetaImage headers are expected to have extension: ".mha" or ".mhd"

Once you write this header text file, it should be possible to read the image into your ITK based application using the itk::FileIOToImageFilter class.

Examples:
vtkMetaImageReader (Examples)
Tests:
vtkMetaImageReader (Tests)

Definition at line 75 of file vtkMetaImageReader.h.


Member Typedef Documentation

Reimplemented from vtkImageReader2.

Definition at line 78 of file vtkMetaImageReader.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkMetaImageReader::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkImageReader2.

virtual int vtkMetaImageReader::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkImageReader2.

Reimplemented from vtkImageReader2.

virtual vtkObjectBase* vtkMetaImageReader::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkImageReader2.

Reimplemented from vtkImageReader2.

void vtkMetaImageReader::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkImageReader2.

Construct object with FlipNormals turned off and Normals set to true.

Reimplemented from vtkImageReader2.

virtual const char* vtkMetaImageReader::GetFileExtensions ( ) [inline, virtual]

Get the file extensions for this format. Returns a string with a space separated list of extensions in the format .extension

Reimplemented from vtkImageReader2.

Definition at line 84 of file vtkMetaImageReader.h.

virtual const char* vtkMetaImageReader::GetDescriptiveName ( ) [inline, virtual]

Return a descriptive name for the file format that might be useful in a GUI.

Reimplemented from vtkImageReader2.

Definition at line 87 of file vtkMetaImageReader.h.

Definition at line 91 of file vtkMetaImageReader.h.

Definition at line 93 of file vtkMetaImageReader.h.

Definition at line 95 of file vtkMetaImageReader.h.

Definition at line 97 of file vtkMetaImageReader.h.

Definition at line 99 of file vtkMetaImageReader.h.

Definition at line 101 of file vtkMetaImageReader.h.

These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian.

Reimplemented from vtkImageReader2.

virtual char* vtkMetaImageReader::GetDistanceUnits ( ) [virtual]
virtual char* vtkMetaImageReader::GetAnatomicalOrientation ( ) [virtual]
virtual char* vtkMetaImageReader::GetPatientName ( ) [virtual]
virtual char* vtkMetaImageReader::GetPatientID ( ) [virtual]
virtual char* vtkMetaImageReader::GetDate ( ) [virtual]
virtual char* vtkMetaImageReader::GetSeries ( ) [virtual]
virtual char* vtkMetaImageReader::GetImageNumber ( ) [virtual]
virtual char* vtkMetaImageReader::GetModality ( ) [virtual]
virtual char* vtkMetaImageReader::GetStudyID ( ) [virtual]
virtual char* vtkMetaImageReader::GetStudyUID ( ) [virtual]
virtual char* vtkMetaImageReader::GetTransferSyntaxUID ( ) [virtual]
virtual int vtkMetaImageReader::CanReadFile ( const char *  name) [virtual]

Test whether the file with the given name can be read by this reader.

void vtkMetaImageReader::ExecuteInformation ( ) [protected, virtual]

Reimplemented from vtkImageReader2.

void vtkMetaImageReader::ExecuteDataWithInformation ( vtkDataObject output,
vtkInformation outInfo 
) [protected, virtual]

This is a convenience method that is implemented in many subclasses instead of RequestData. It is called by RequestData.

Reimplemented from vtkImageReader2.

virtual int vtkMetaImageReader::RequestInformation ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

Subclasses can reimplement this method to collect information from their inputs and set information for their outputs.

Reimplemented from vtkImageReader2.


The documentation for this class was generated from the following file: