vtkgdcm
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkGDCMImageReader2 Class Reference

read DICOM Image files (Pixel Data) More...

#include <vtkGDCMImageReader2.h>

Inherits vtkMedicalImageReader2.

Public Types

typedef vtkMedicalImageReader2 Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
virtual int CanReadFile (const char *fname)
 
virtual const char * GetFileExtensions ()
 Valid extensions. More...
 
virtual const char * GetDescriptiveName ()
 A descriptive name for this format. More...
 
virtual vtkMatrix4x4 * GetDirectionCosines ()
 Get the Image Position (Patient) as stored in the DICOM file This is a read-only data member. More...
 
virtual void SetMedicalImageProperties (vtkMedicalImageProperties *pd)
 
virtual int GetLoadOverlays ()
 Specifically request to load the overlay into the gdcm-VTK layer (gdcm always loads them when found). More...
 
virtual void SetLoadOverlays (int)
 
virtual void LoadOverlaysOn ()
 
virtual void LoadOverlaysOff ()
 
virtual int GetLoadIconImage ()
 Set/Get whether or not to load the Icon as vtkImageData (if found in the DICOM file) More...
 
virtual void SetLoadIconImage (int)
 
virtual void LoadIconImageOn ()
 
virtual void LoadIconImageOff ()
 
virtual int GetLossyFlag ()
 Set/Get whether or not the image was compressed using a lossy compression algorithm. More...
 
virtual void SetLossyFlag (int)
 
virtual void LossyFlagOn ()
 
virtual void LossyFlagOff ()
 
virtual int GetNumberOfOverlays ()
 Read only: number of overlays as found in this image (multiple overlays per slice is allowed) Only valid when LoadOverlays is true. More...
 
virtual int GetNumberOfIconImages ()
 Read only: number of icon image (there can only be zero or one icon per file) Only valid when LoadIconImage is true. More...
 
vtkAlgorithmOutput * GetOverlayPort (int index)
 Get Overlay/IconImage Remember to ALWAYS use those methods in your code, as the internal number for the output port is not garantee to remain the same, as features are added to the reader. More...
 
vtkAlgorithmOutput * GetIconImagePort ()
 
vtkImageData * GetOverlay (int i)
 
vtkImageData * GetIconImage ()
 
virtual int GetApplyLookupTable ()
 Load image with its associated Lookup Table. More...
 
virtual void SetApplyLookupTable (int)
 
virtual void ApplyLookupTableOn ()
 
virtual void ApplyLookupTableOff ()
 
virtual int GetApplyYBRToRGB ()
 Load image as YBR. More...
 
virtual void SetApplyYBRToRGB (int)
 
virtual void ApplyYBRToRGBOn ()
 
virtual void ApplyYBRToRGBOff ()
 
virtual int GetImageFormat ()
 Return VTK_LUMINANCE, VTK_INVERSE_LUMINANCE, VTK_RGB, VTK_RGBA, VTK_LOOKUP_TABLE, VTK_YBR or VTK_CMYK or 0 when ImageFormat is not handled. More...
 
virtual int GetPlanarConfiguration ()
 Return the Planar Configuration. More...
 
virtual double * GetImagePositionPatient ()
 Return the 'raw' information stored in the DICOM file: In case of a series of multiple files, only the first file is considered. More...
 
virtual void GetImagePositionPatient (double &, double &, double &)
 
virtual void GetImagePositionPatient (double[3])
 
virtual double * GetImageOrientationPatient ()
 
virtual void GetImageOrientationPatient (double &, double &, double &, double &, double &, double &)
 
virtual void GetImageOrientationPatient (double[6])
 
virtual vtkPolyData * GetCurve ()
 Set/Get the first Curve Data: More...
 
virtual void SetCurve (vtkPolyData *pd)
 
virtual double GetShift ()
 \DEPRECATED: Modality LUT Value returned by GetShift/GetScale might be innacurate since Shift/Scale could be varying along the Series read. More...
 
virtual double GetScale ()
 

Static Public Member Functions

static vtkGDCMImageReader2New ()
 
static int IsTypeOf (const char *type)
 
static vtkGDCMImageReader2SafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkGDCMImageReader2 ()
 
 ~vtkGDCMImageReader2 ()
 
virtual void SetImageOrientationPatient (double, double, double, double, double, double)
 
virtual void SetImageOrientationPatient (double[6])
 
void FillMedicalImageInformation (const gdcm::ImageReader &reader)
 
int RequestInformationCompat ()
 
int RequestDataCompat ()
 
int ProcessRequest (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
int RequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
int LoadSingleFile (const char *filename, char *pointer, unsigned long &outlen)
 
void SetFilePrefix (const char *)
 
virtual char * GetFilePrefix ()
 
void SetFilePattern (const char *)
 
virtual char * GetFilePattern ()
 

Protected Attributes

vtkMatrix4x4 * DirectionCosines
 
int LoadOverlays
 
int NumberOfOverlays
 
int LoadIconImage
 
int NumberOfIconImages
 
int IconImageDataExtent [6]
 
double ImagePositionPatient [3]
 
double ImageOrientationPatient [6]
 
vtkPolyData * Curve
 
int ImageFormat
 
int ApplyInverseVideo
 
int ApplyLookupTable
 
int ApplyYBRToRGB
 
int ApplyPlanarConfiguration
 
int ApplyShiftScale
 
double Shift
 
double Scale
 
int IconDataScalarType
 
int IconNumberOfScalarComponents
 
int PlanarConfiguration
 
int LossyFlag
 
int ForceRescale
 

Detailed Description

read DICOM Image files (Pixel Data)

vtkGDCMImageReader2 is a source object that reads some DICOM files this reader is single threaded.

Attention
upside down as VTK would expect, use this option only if you know what you are doing.
expected to provide an ordered list of filenames. No sorting will be applied afterward.
from a tag in a 2D DICOM file should be correct, there has been reports that this value can be missing, or incorrect, in which case users are advised to override this value using the return value from gdcm::IPPSorter::GetZSpacing() and set it via vtkImageChangeInformation on the reader itself.
Todo:

This reader does not handle a series of 3D images, only a single 3D (multi frame) or a list of 2D files are supported for now.

Did not implement SetFilePattern / SetFilePrefix API, move it to protected section for now.

Bug:
Overlay are assumed to have the same extent as image. Right now if overlay origin is not 0,0 the overlay will have an offset... Only the very first overlay is loaded at the VTK level, for now (even if there are more than one in the file)
DataOrigin:
When the reader is instanciated with FileLowerLeftOn the DataOrigin and Image Position (Patient) are identical. But when FileLowerLeft is Off, we have to reorder the Y-line of the image, and thus the DataOrigin is then translated to the other side of the image.
Spacing:
When reading a 3D volume, the spacing along the Z dimension might be negative (so as to respect up-side-down) as specified in the Image Orientation (Patient) tag. When Z-spacing is 0, this means the multi-frame object contains image which do not represent uniform volume.
Warning
When using vtkGDCMPolyDataReader in conjonction with vtkGDCMImageReader2 it is required that FileLowerLeft is set to ON as coordinate system would be inconsistent in between the two data structures.
Color Space mapping::
  • VTK_LUMINANCE <-> MONOCHROME2
  • VTK_LUMINANCE_ALPHA <-> Not supported
  • VTK_RGB <-> RGB
  • VTK_RGBA <-> ARGB (deprecated, DICOM 2008)
  • VTK_INVERSE_LUMINANCE <-> MONOCHROME1
  • VTK_LOOKUP_TABLE <-> PALETTE COLOR
  • VTK_YBR <-> YBR_FULL
Color Space mapping::
For detailed information on color space transformation and true lossless transformation see: http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations
See also
vtkMedicalImageReader2 vtkMedicalImageProperties vtkGDCMPolyDataReader vtkGDCMImageWriter vtkDICOMImageReader

Definition at line 98 of file vtkGDCMImageReader2.h.

Member Typedef Documentation

◆ Superclass

typedef vtkMedicalImageReader2 vtkGDCMImageReader2::Superclass

Definition at line 102 of file vtkGDCMImageReader2.h.

Constructor & Destructor Documentation

◆ vtkGDCMImageReader2()

vtkGDCMImageReader2::vtkGDCMImageReader2 ( )
protected

◆ ~vtkGDCMImageReader2()

vtkGDCMImageReader2::~vtkGDCMImageReader2 ( )
protected

Member Function Documentation

◆ New()

static vtkGDCMImageReader2* vtkGDCMImageReader2::New ( )
static

◆ GetClassName()

virtual const char* vtkGDCMImageReader2::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkGDCMImageReader2::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkGDCMImageReader2::IsA ( const char *  type)
virtual

◆ SafeDownCast()

static vtkGDCMImageReader2* vtkGDCMImageReader2::SafeDownCast ( vtkObject *  o)
static

◆ PrintSelf()

virtual void vtkGDCMImageReader2::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

◆ CanReadFile()

virtual int vtkGDCMImageReader2::CanReadFile ( const char *  fname)
virtual

◆ GetFileExtensions()

virtual const char* vtkGDCMImageReader2::GetFileExtensions ( )
inlinevirtual

Valid extensions.

Definition at line 110 of file vtkGDCMImageReader2.h.

◆ GetDescriptiveName()

virtual const char* vtkGDCMImageReader2::GetDescriptiveName ( )
inlinevirtual

A descriptive name for this format.

Definition at line 119 of file vtkGDCMImageReader2.h.

◆ GetDirectionCosines()

virtual vtkMatrix4x4* vtkGDCMImageReader2::GetDirectionCosines ( )
virtual

Get the Image Position (Patient) as stored in the DICOM file This is a read-only data member.

◆ SetMedicalImageProperties()

virtual void vtkGDCMImageReader2::SetMedicalImageProperties ( vtkMedicalImageProperties *  pd)
virtual

◆ GetLoadOverlays()

virtual int vtkGDCMImageReader2::GetLoadOverlays ( )
virtual

Specifically request to load the overlay into the gdcm-VTK layer (gdcm always loads them when found).

If no overlay is found in the image, then the vtkImageData for the overlay will be empty.

◆ SetLoadOverlays()

virtual void vtkGDCMImageReader2::SetLoadOverlays ( int  )
virtual

◆ LoadOverlaysOn()

virtual void vtkGDCMImageReader2::LoadOverlaysOn ( )
virtual

◆ LoadOverlaysOff()

virtual void vtkGDCMImageReader2::LoadOverlaysOff ( )
virtual

◆ GetLoadIconImage()

virtual int vtkGDCMImageReader2::GetLoadIconImage ( )
virtual

Set/Get whether or not to load the Icon as vtkImageData (if found in the DICOM file)

◆ SetLoadIconImage()

virtual void vtkGDCMImageReader2::SetLoadIconImage ( int  )
virtual

◆ LoadIconImageOn()

virtual void vtkGDCMImageReader2::LoadIconImageOn ( )
virtual

◆ LoadIconImageOff()

virtual void vtkGDCMImageReader2::LoadIconImageOff ( )
virtual

◆ GetLossyFlag()

virtual int vtkGDCMImageReader2::GetLossyFlag ( )
virtual

Set/Get whether or not the image was compressed using a lossy compression algorithm.

◆ SetLossyFlag()

virtual void vtkGDCMImageReader2::SetLossyFlag ( int  )
virtual

◆ LossyFlagOn()

virtual void vtkGDCMImageReader2::LossyFlagOn ( )
virtual

◆ LossyFlagOff()

virtual void vtkGDCMImageReader2::LossyFlagOff ( )
virtual

◆ GetNumberOfOverlays()

virtual int vtkGDCMImageReader2::GetNumberOfOverlays ( )
virtual

Read only: number of overlays as found in this image (multiple overlays per slice is allowed) Only valid when LoadOverlays is true.

◆ GetNumberOfIconImages()

virtual int vtkGDCMImageReader2::GetNumberOfIconImages ( )
virtual

Read only: number of icon image (there can only be zero or one icon per file) Only valid when LoadIconImage is true.

◆ GetOverlayPort()

vtkAlgorithmOutput* vtkGDCMImageReader2::GetOverlayPort ( int  index)

Get Overlay/IconImage Remember to ALWAYS use those methods in your code, as the internal number for the output port is not garantee to remain the same, as features are added to the reader.

◆ GetIconImagePort()

vtkAlgorithmOutput* vtkGDCMImageReader2::GetIconImagePort ( )

◆ GetOverlay()

vtkImageData* vtkGDCMImageReader2::GetOverlay ( int  i)

◆ GetIconImage()

vtkImageData* vtkGDCMImageReader2::GetIconImage ( )

◆ GetApplyLookupTable()

virtual int vtkGDCMImageReader2::GetApplyLookupTable ( )
virtual

Load image with its associated Lookup Table.

◆ SetApplyLookupTable()

virtual void vtkGDCMImageReader2::SetApplyLookupTable ( int  )
virtual

◆ ApplyLookupTableOn()

virtual void vtkGDCMImageReader2::ApplyLookupTableOn ( )
virtual

◆ ApplyLookupTableOff()

virtual void vtkGDCMImageReader2::ApplyLookupTableOff ( )
virtual

◆ GetApplyYBRToRGB()

virtual int vtkGDCMImageReader2::GetApplyYBRToRGB ( )
virtual

Load image as YBR.

◆ SetApplyYBRToRGB()

virtual void vtkGDCMImageReader2::SetApplyYBRToRGB ( int  )
virtual

◆ ApplyYBRToRGBOn()

virtual void vtkGDCMImageReader2::ApplyYBRToRGBOn ( )
virtual

◆ ApplyYBRToRGBOff()

virtual void vtkGDCMImageReader2::ApplyYBRToRGBOff ( )
virtual

◆ GetImageFormat()

virtual int vtkGDCMImageReader2::GetImageFormat ( )
virtual

Return VTK_LUMINANCE, VTK_INVERSE_LUMINANCE, VTK_RGB, VTK_RGBA, VTK_LOOKUP_TABLE, VTK_YBR or VTK_CMYK or 0 when ImageFormat is not handled.

Warning: For color image, PlanarConfiguration need to be taken into account.

◆ GetPlanarConfiguration()

virtual int vtkGDCMImageReader2::GetPlanarConfiguration ( )
virtual

Return the Planar Configuration.

This simply means that the internal DICOM image was stored using a particular planar configuration (most of the time: 0) For monochrome image, PlanarConfiguration is always 0

◆ GetImagePositionPatient() [1/3]

virtual double* vtkGDCMImageReader2::GetImagePositionPatient ( )
virtual

Return the 'raw' information stored in the DICOM file: In case of a series of multiple files, only the first file is considered.

The Image Orientation (Patient) is garantee to remain the same, and image Image Position (Patient) in other slice can be computed using the ZSpacing (3rd dimension) (0020,0032) DS [87.774866-182.908510\168.629671] # 32, 3 ImagePositionPatient (0020,0037) DS [0.001479\0.999989-0.004376-0.002039-0.004372-0.999988] # 58, 6 ImageOrientationPatient

◆ GetImagePositionPatient() [2/3]

virtual void vtkGDCMImageReader2::GetImagePositionPatient ( double &  ,
double &  ,
double &   
)
virtual

◆ GetImagePositionPatient() [3/3]

virtual void vtkGDCMImageReader2::GetImagePositionPatient ( double  [3])
virtual

◆ GetImageOrientationPatient() [1/3]

virtual double* vtkGDCMImageReader2::GetImageOrientationPatient ( )
virtual

◆ GetImageOrientationPatient() [2/3]

virtual void vtkGDCMImageReader2::GetImageOrientationPatient ( double &  ,
double &  ,
double &  ,
double &  ,
double &  ,
double &   
)
virtual

◆ GetImageOrientationPatient() [3/3]

virtual void vtkGDCMImageReader2::GetImageOrientationPatient ( double  [6])
virtual

◆ GetCurve()

virtual vtkPolyData* vtkGDCMImageReader2::GetCurve ( )
virtual

Set/Get the first Curve Data:

◆ SetCurve()

virtual void vtkGDCMImageReader2::SetCurve ( vtkPolyData *  pd)
virtual

◆ GetShift()

virtual double vtkGDCMImageReader2::GetShift ( )
virtual

\DEPRECATED: Modality LUT Value returned by GetShift/GetScale might be innacurate since Shift/Scale could be varying along the Series read.

Therefore user are advices not to use those functions anymore

◆ GetScale()

virtual double vtkGDCMImageReader2::GetScale ( )
virtual

◆ SetImageOrientationPatient() [1/2]

virtual void vtkGDCMImageReader2::SetImageOrientationPatient ( double  ,
double  ,
double  ,
double  ,
double  ,
double   
)
protectedvirtual

◆ SetImageOrientationPatient() [2/2]

virtual void vtkGDCMImageReader2::SetImageOrientationPatient ( double  [6])
protectedvirtual

◆ FillMedicalImageInformation()

void vtkGDCMImageReader2::FillMedicalImageInformation ( const gdcm::ImageReader &  reader)
protected

◆ RequestInformationCompat()

int vtkGDCMImageReader2::RequestInformationCompat ( )
protected

◆ RequestDataCompat()

int vtkGDCMImageReader2::RequestDataCompat ( )
protected

◆ ProcessRequest()

int vtkGDCMImageReader2::ProcessRequest ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protected

◆ RequestInformation()

int vtkGDCMImageReader2::RequestInformation ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protected

◆ RequestData()

int vtkGDCMImageReader2::RequestData ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protected

◆ LoadSingleFile()

int vtkGDCMImageReader2::LoadSingleFile ( const char *  filename,
char *  pointer,
unsigned long &  outlen 
)
protected

◆ SetFilePrefix()

void vtkGDCMImageReader2::SetFilePrefix ( const char *  )
inlineprotected

Definition at line 313 of file vtkGDCMImageReader2.h.

◆ GetFilePrefix()

virtual char* vtkGDCMImageReader2::GetFilePrefix ( )
protectedvirtual

◆ SetFilePattern()

void vtkGDCMImageReader2::SetFilePattern ( const char *  )
inlineprotected

Definition at line 315 of file vtkGDCMImageReader2.h.

◆ GetFilePattern()

virtual char* vtkGDCMImageReader2::GetFilePattern ( )
protectedvirtual

Member Data Documentation

◆ DirectionCosines

vtkMatrix4x4* vtkGDCMImageReader2::DirectionCosines
protected

Definition at line 282 of file vtkGDCMImageReader2.h.

◆ LoadOverlays

int vtkGDCMImageReader2::LoadOverlays
protected

Definition at line 283 of file vtkGDCMImageReader2.h.

◆ NumberOfOverlays

int vtkGDCMImageReader2::NumberOfOverlays
protected

Definition at line 284 of file vtkGDCMImageReader2.h.

◆ LoadIconImage

int vtkGDCMImageReader2::LoadIconImage
protected

Definition at line 285 of file vtkGDCMImageReader2.h.

◆ NumberOfIconImages

int vtkGDCMImageReader2::NumberOfIconImages
protected

Definition at line 286 of file vtkGDCMImageReader2.h.

◆ IconImageDataExtent

int vtkGDCMImageReader2::IconImageDataExtent[6]
protected

Definition at line 287 of file vtkGDCMImageReader2.h.

◆ ImagePositionPatient

double vtkGDCMImageReader2::ImagePositionPatient[3]
protected

Definition at line 288 of file vtkGDCMImageReader2.h.

◆ ImageOrientationPatient

double vtkGDCMImageReader2::ImageOrientationPatient[6]
protected

Definition at line 289 of file vtkGDCMImageReader2.h.

◆ Curve

vtkPolyData* vtkGDCMImageReader2::Curve
protected

Definition at line 290 of file vtkGDCMImageReader2.h.

◆ ImageFormat

int vtkGDCMImageReader2::ImageFormat
protected

Definition at line 292 of file vtkGDCMImageReader2.h.

◆ ApplyInverseVideo

int vtkGDCMImageReader2::ApplyInverseVideo
protected

Definition at line 294 of file vtkGDCMImageReader2.h.

◆ ApplyLookupTable

int vtkGDCMImageReader2::ApplyLookupTable
protected

Definition at line 295 of file vtkGDCMImageReader2.h.

◆ ApplyYBRToRGB

int vtkGDCMImageReader2::ApplyYBRToRGB
protected

Definition at line 296 of file vtkGDCMImageReader2.h.

◆ ApplyPlanarConfiguration

int vtkGDCMImageReader2::ApplyPlanarConfiguration
protected

Definition at line 298 of file vtkGDCMImageReader2.h.

◆ ApplyShiftScale

int vtkGDCMImageReader2::ApplyShiftScale
protected

Definition at line 299 of file vtkGDCMImageReader2.h.

◆ Shift

double vtkGDCMImageReader2::Shift
protected

Definition at line 303 of file vtkGDCMImageReader2.h.

◆ Scale

double vtkGDCMImageReader2::Scale
protected

Definition at line 304 of file vtkGDCMImageReader2.h.

◆ IconDataScalarType

int vtkGDCMImageReader2::IconDataScalarType
protected

Definition at line 305 of file vtkGDCMImageReader2.h.

◆ IconNumberOfScalarComponents

int vtkGDCMImageReader2::IconNumberOfScalarComponents
protected

Definition at line 306 of file vtkGDCMImageReader2.h.

◆ PlanarConfiguration

int vtkGDCMImageReader2::PlanarConfiguration
protected

Definition at line 307 of file vtkGDCMImageReader2.h.

◆ LossyFlag

int vtkGDCMImageReader2::LossyFlag
protected

Definition at line 308 of file vtkGDCMImageReader2.h.

◆ ForceRescale

int vtkGDCMImageReader2::ForceRescale
protected

Definition at line 309 of file vtkGDCMImageReader2.h.


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