Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkRawReader Class Reference

mitkRawReader - a concrete reader for reading raw volume file(no header information). More...

#include <mitkRawReader.h>

Inherits mitkVolumeReader.

Inheritance diagram for mitkRawReader:

Inheritance graph
[legend]
Collaboration diagram for mitkRawReader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
 mitkRawReader ()
void SetWidth (int w)
void SetHeight (int h)
void SetImageNum (int n)
void SetSpacingX (float px)
void SetSpacingY (float py)
void SetSpacingZ (float pz)
void SetChannelNum (int n)
void SetTitleBytes (int n)
void SetEndian (bool isBig=false)
void SetBigEndian (bool isBig=true)
void SetLittleEndian (bool isBig=false)
void SetPlanarCfg (bool isColorByPlane)
void SetDataType (int dataType)
void SetDataTypeToFloat ()
void SetDataTypeToDouble ()
void SetDataTypeToInt ()
void SetDataTypeToUnsignedInt ()
void SetDataTypeToLong ()
void SetDataTypeToUnsignedLong ()
void SetDataTypeToShort ()
void SetDataTypeToUnsignedShort ()
void SetDataTypeToUnsignedChar ()
void SetDataTypeToChar ()

Detailed Description

mitkRawReader - a concrete reader for reading raw volume file(no header information).

mitkRawReader reads a raw volume file(no any header information) to a volume. Because raw file doesn't has any header information, including width, height, image number, spacing information, etc. , you must set enough information using the series SetXXX functions. To use this reader, the code snippet is:

    mitkRawReader *aReader = new mitkRawReader; 
    aReader->SetWidth(w); 
    aReader->SetHeight(h); 
    aReader->SetImageNum(d); 
    aReader->SetSpacingX(sx); 
    aReader->SetSpacingY(sy); 
    aReader->SetSpacingZ(sz); 
    aReader->SetDataType(dt); 
    aReader->SetChannelNum(cn); 
    aReader->AddFileName(filename); //Only require one file name 
    //the above is the required information 
    if (aReader->Run())
    { 
        mitkVolume *aVolume = aReader->GetOutput(); 
        Using aVolume
    }


Constructor & Destructor Documentation

mitkRawReader::mitkRawReader  ) 
 

Default constructor.


Member Function Documentation

virtual void mitkRawReader::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkVolumeReader.

void mitkRawReader::SetBigEndian bool  isBig = true  )  [inline]
 

Provided for convenience, just the same as SetEndian().

void mitkRawReader::SetChannelNum int  n  )  [inline]
 

Set number of channel.

Parameters:
n number of channel 1---gray image 3---RGB image 4---RGBA image

void mitkRawReader::SetDataType int  dataType  )  [inline]
 

Set the data type of these images.

Parameters:
dataType the data type of these images, the value should be one of follows:
MITK_CHAR (char)
MITK_UNSIGNED_CHAR (unsigned char)
MITK_SHORT (short)
MITK_UNSIGNED_SHORT (unsigned short)
MITK_INT (int)
MITK_UNSIGNED_INT (unsigned int)
MITK_LONG (long)
MITK_UNSIGNED_LONG (unsigned long)
MITK_FLOAT (float)
MITK_DOUBLE (double)

void mitkRawReader::SetDataTypeToChar  )  [inline]
 

Set data type to char.

void mitkRawReader::SetDataTypeToDouble  )  [inline]
 

Set data type to double.

void mitkRawReader::SetDataTypeToFloat  )  [inline]
 

Set data type to float.

void mitkRawReader::SetDataTypeToInt  )  [inline]
 

Set data type to int.

void mitkRawReader::SetDataTypeToLong  )  [inline]
 

Set data type to long.

void mitkRawReader::SetDataTypeToShort  )  [inline]
 

Set data type to short.

void mitkRawReader::SetDataTypeToUnsignedChar  )  [inline]
 

Set data type to unsigned char.

void mitkRawReader::SetDataTypeToUnsignedInt  )  [inline]
 

Set data type to unsigned int.

void mitkRawReader::SetDataTypeToUnsignedLong  )  [inline]
 

Set data type to unsigned long.

void mitkRawReader::SetDataTypeToUnsignedShort  )  [inline]
 

Set data type to unsigned short.

void mitkRawReader::SetEndian bool  isBig = false  )  [inline]
 

Set endian if depth per pixel is bigger than 8.

Parameters:
isBig if the endian configuration is big endian (Mac)

void mitkRawReader::SetHeight int  h  )  [inline]
 

Set image height.

Parameters:
h image height

void mitkRawReader::SetImageNum int  n  )  [inline]
 

Set number of images.

Parameters:
n image number

void mitkRawReader::SetLittleEndian bool  isBig = false  )  [inline]
 

Provided for convenience, just the same as SetEndian().

void mitkRawReader::SetPlanarCfg bool  isColorByPlane  )  [inline]
 

Set planar configuration.

Parameters:
isColorByPlane if the planar configuration is color-by-plane
Note:
Only used when channel number is bigger than 1. For RGB images, if it is color-by-plane, it's means the pixels should be stored as "R1 R2 R3 ... G1 G2 G3 ... B1 B2 B3 ...", otherwise "R1 G1 B1 R2 G2 B2 ..."

void mitkRawReader::SetSpacingX float  px  )  [inline]
 

Set spacing information in x axis, the unit is mm.

Parameters:
px the spacing (mm) in two adjacent voxels in x axis.

void mitkRawReader::SetSpacingY float  py  )  [inline]
 

Set spacing information in y axis, the unit is mm.

Parameters:
py the spacing (mm) in two adjacent voxels in y axis.

void mitkRawReader::SetSpacingZ float  pz  )  [inline]
 

Set spacing information in z axis, the unit is mm.

Parameters:
pz the spacing (mm) in two adjacent voxels in z axis.

void mitkRawReader::SetTitleBytes int  n  )  [inline]
 

Set number of bytes in title (header). These bytes will be skipped.

Parameters:
n number of bytes in title (header)
Note:
This title has nothing to do with the image. If the file has a title, the number of bytes must be given so that the program can skip the title properly when reading the file.

void mitkRawReader::SetWidth int  w  )  [inline]
 

Set image width.

Parameters:
w image width


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:05:28 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3