VTK
Public Member Functions | Protected Member Functions | Protected Attributes
vtkNIFTIImageWriter Class Reference

Write NIfTI-1 and NIfTI-2 medical image files. More...

#include <vtkNIFTIImageWriter.h>

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

List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetNIFTIVersion (int)
virtual int GetNIFTIVersion ()
virtual void SetDescription (const char *)
virtual char * GetDescription ()
virtual int GetTimeDimension ()
virtual void SetTimeDimension (int)
virtual double GetTimeSpacing ()
virtual void SetTimeSpacing (double)
virtual void SetRescaleSlope (double)
virtual double GetRescaleSlope ()
virtual void SetRescaleIntercept (double)
virtual double GetRescaleIntercept ()
virtual void SetQFac (double)
virtual double GetQFac ()
void SetQFormMatrix (vtkMatrix4x4 *)
vtkMatrix4x4GetQFormMatrix ()
void SetSFormMatrix (vtkMatrix4x4 *)
vtkMatrix4x4GetSFormMatrix ()
void SetNIFTIHeader (vtkNIFTIImageHeader *hdr)
vtkNIFTIImageHeaderGetNIFTIHeader ()

Protected Member Functions

 vtkNIFTIImageWriter ()
 ~vtkNIFTIImageWriter ()
int GenerateHeader (vtkInformation *info, bool singleFile)
virtual int RequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)

Static Protected Member Functions

static char * ReplaceExtension (const char *fname, const char *ext1, const char *ext2)

Protected Attributes

double QFac
char * Description
int TimeDimension
double TimeSpacing
double RescaleIntercept
double RescaleSlope
vtkMatrix4x4QFormMatrix
vtkMatrix4x4SFormMatrix
vtkNIFTIImageHeaderNIFTIHeader
vtkNIFTIImageHeaderOwnHeader
int NIFTIVersion
typedef vtkImageWriter Superclass
static vtkNIFTIImageWriterNew ()
static int IsTypeOf (const char *type)
static vtkNIFTIImageWriterSafeDownCast (vtkObjectBase *o)
virtual int IsA (const char *type)
vtkNIFTIImageWriterNewInstance () const
virtual vtkObjectBaseNewInstanceInternal () const

Detailed Description

Write NIfTI-1 and NIfTI-2 medical image files.

This class writes NIFTI files, either in .nii format or as separate .img and .hdr files. If told to write a file that ends in ".gz", then the writer will automatically compress the file with zlib. Images of type unsigned char that have 3 or 4 scalar components will automatically be written as RGB or RGBA respectively. Images of type float or double that have 2 components will automatically be written as complex values.

Thanks:
This class was contributed to VTK by the Calgary Image Processing and Analysis Centre (CIPAC).
See also:
vtkNIFTIImageReader
Tests:
vtkNIFTIImageWriter (Tests)

Definition at line 44 of file vtkNIFTIImageWriter.h.


Member Typedef Documentation

Static method for construction.

Reimplemented from vtkImageWriter.

Definition at line 50 of file vtkNIFTIImageWriter.h.


Constructor & Destructor Documentation


Member Function Documentation

Static method for construction.

Reimplemented from vtkImageWriter.

static int vtkNIFTIImageWriter::IsTypeOf ( const char *  type) [static]

Static method for construction.

Reimplemented from vtkImageWriter.

virtual int vtkNIFTIImageWriter::IsA ( const char *  type) [virtual]

Static method for construction.

Reimplemented from vtkImageWriter.

Static method for construction.

Reimplemented from vtkImageWriter.

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

Static method for construction.

Reimplemented from vtkImageWriter.

Static method for construction.

Reimplemented from vtkImageWriter.

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

Print information about this object.

Reimplemented from vtkImageWriter.

virtual void vtkNIFTIImageWriter::SetNIFTIVersion ( int  ) [virtual]

Set the version number for the NIfTI file format to use. This can be 1, 2, or 0 (the default). If set to zero, then it will save as NIfTI version 1 unless SetNIFTIHeader() provided header information from a NIfTI version 2 file.

Set the version number for the NIfTI file format to use. This can be 1, 2, or 0 (the default). If set to zero, then it will save as NIfTI version 1 unless SetNIFTIHeader() provided header information from a NIfTI version 2 file.

virtual void vtkNIFTIImageWriter::SetDescription ( const char *  ) [virtual]

Set a short description (max 80 chars) of how the file was produced. The default description is "VTKX.Y" where X.Y is the VTK version.

virtual char* vtkNIFTIImageWriter::GetDescription ( ) [virtual]

Set a short description (max 80 chars) of how the file was produced. The default description is "VTKX.Y" where X.Y is the VTK version.

Set the time dimension to use in the NIFTI file (or zero if none). The number of components of the input data must be divisible by the time dimension if the time dimension is not set to zero. The vector dimension will be set to the number of components divided by the time dimension.

virtual void vtkNIFTIImageWriter::SetTimeDimension ( int  ) [virtual]

Set the time dimension to use in the NIFTI file (or zero if none). The number of components of the input data must be divisible by the time dimension if the time dimension is not set to zero. The vector dimension will be set to the number of components divided by the time dimension.

Set the time dimension to use in the NIFTI file (or zero if none). The number of components of the input data must be divisible by the time dimension if the time dimension is not set to zero. The vector dimension will be set to the number of components divided by the time dimension.

virtual void vtkNIFTIImageWriter::SetTimeSpacing ( double  ) [virtual]

Set the time dimension to use in the NIFTI file (or zero if none). The number of components of the input data must be divisible by the time dimension if the time dimension is not set to zero. The vector dimension will be set to the number of components divided by the time dimension.

virtual void vtkNIFTIImageWriter::SetRescaleSlope ( double  ) [virtual]

Set the slope and intercept for calibrating the scalar values. Other programs that read the NIFTI file can use the equation v = u*RescaleSlope + RescaleIntercept to rescale the data to real values. If both the slope and the intercept are zero, then the SclSlope and SclIntercept in the header info provided via SetNIFTIHeader() are used instead.

Set the slope and intercept for calibrating the scalar values. Other programs that read the NIFTI file can use the equation v = u*RescaleSlope + RescaleIntercept to rescale the data to real values. If both the slope and the intercept are zero, then the SclSlope and SclIntercept in the header info provided via SetNIFTIHeader() are used instead.

virtual void vtkNIFTIImageWriter::SetRescaleIntercept ( double  ) [virtual]

Set the slope and intercept for calibrating the scalar values. Other programs that read the NIFTI file can use the equation v = u*RescaleSlope + RescaleIntercept to rescale the data to real values. If both the slope and the intercept are zero, then the SclSlope and SclIntercept in the header info provided via SetNIFTIHeader() are used instead.

Set the slope and intercept for calibrating the scalar values. Other programs that read the NIFTI file can use the equation v = u*RescaleSlope + RescaleIntercept to rescale the data to real values. If both the slope and the intercept are zero, then the SclSlope and SclIntercept in the header info provided via SetNIFTIHeader() are used instead.

virtual void vtkNIFTIImageWriter::SetQFac ( double  ) [virtual]

The QFac sets the ordering of the slices in the NIFTI file. If QFac is -1, then the slice ordering in the file will be reversed as compared to VTK. Use with caution.

virtual double vtkNIFTIImageWriter::GetQFac ( ) [virtual]

The QFac sets the ordering of the slices in the NIFTI file. If QFac is -1, then the slice ordering in the file will be reversed as compared to VTK. Use with caution.

Set the "qform" orientation and offset for the image data. The 3x3 portion of the matrix must be orthonormal and have a positive determinant, it will be used to compute the quaternion. The last column of the matrix will be used for the offset. In the NIFTI header, the qform_code will be set to 1.

Set the "qform" orientation and offset for the image data. The 3x3 portion of the matrix must be orthonormal and have a positive determinant, it will be used to compute the quaternion. The last column of the matrix will be used for the offset. In the NIFTI header, the qform_code will be set to 1.

Definition at line 112 of file vtkNIFTIImageWriter.h.

Set a matrix for the "sform" transformation stored in the file. Unlike the qform matrix, the sform matrix can contain scaling information. Before being stored in the NIFTI header, the first three columns of the matrix will be multipled by the voxel spacing. In the NIFTI header, the sform_code will be set to 2.

Set a matrix for the "sform" transformation stored in the file. Unlike the qform matrix, the sform matrix can contain scaling information. Before being stored in the NIFTI header, the first three columns of the matrix will be multipled by the voxel spacing. In the NIFTI header, the sform_code will be set to 2.

Definition at line 122 of file vtkNIFTIImageWriter.h.

Set the NIFTI header information to use when writing the file. The data dimensions and pixdim from the supplied header will be ignored. Likewise, the QForm and SForm information in the supplied header will be ignored if you have called SetQFormMatrix() or SetSFormMatrix() to provide the orientation information for the file.

Set the NIFTI header information to use when writing the file. The data dimensions and pixdim from the supplied header will be ignored. Likewise, the QForm and SForm information in the supplied header will be ignored if you have called SetQFormMatrix() or SetSFormMatrix() to provide the orientation information for the file.

int vtkNIFTIImageWriter::GenerateHeader ( vtkInformation info,
bool  singleFile 
) [protected]

Generate the header information for the file.

virtual int vtkNIFTIImageWriter::RequestData ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

The main execution method, which writes the file.

Reimplemented from vtkImageWriter.

static char* vtkNIFTIImageWriter::ReplaceExtension ( const char *  fname,
const char *  ext1,
const char *  ext2 
) [static, protected]

Make a new filename by replacing extension "ext1" with "ext2". The extensions must include a period, must be three characters long, and must be lower case. A new string is returned that must be deleted by the caller.


Member Data Documentation

The size and spacing of the Time dimension to use in the file.

Definition at line 160 of file vtkNIFTIImageWriter.h.

The size and spacing of the Time dimension to use in the file.

Definition at line 161 of file vtkNIFTIImageWriter.h.

Information for rescaling data to quantitative units.

Definition at line 166 of file vtkNIFTIImageWriter.h.

Information for rescaling data to quantitative units.

Definition at line 167 of file vtkNIFTIImageWriter.h.

Is -1 if VTK slice order is opposite to NIFTI slice order, +1 otherwise.

Definition at line 172 of file vtkNIFTIImageWriter.h.

The orientation matrices for the NIFTI file.

Definition at line 176 of file vtkNIFTIImageWriter.h.

The orientation matrices for the NIFTI file.

Definition at line 177 of file vtkNIFTIImageWriter.h.

A description of how the file was produced.

Definition at line 181 of file vtkNIFTIImageWriter.h.

The header information.

Definition at line 185 of file vtkNIFTIImageWriter.h.

The header information.

Definition at line 186 of file vtkNIFTIImageWriter.h.

The header information.

Definition at line 187 of file vtkNIFTIImageWriter.h.


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