vtk-dicom  0.8.14
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkDICOMGenerator Class Reference

Generate DICOM data series for specific IOD classes. More...

#include <vtkDICOMGenerator.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkDICOMGeneratorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
 Print information about this object.
 
virtual bool GenerateInstance (vtkInformation *)
 Generate an instance of one of the supported classes. More...
 
vtkDICOMMetaDataGetMetaData ()
 Get the generated meta data. More...
 
virtual void SetExtended (int)
 Copy extended attributes from source (default: Off). More...
 
virtual void ExtendedOn ()
 
virtual void ExtendedOff ()
 
virtual int GetExtended ()
 
virtual void SetMultiFrame (int)
 Create a multi-frame object (default: Off). More...
 
virtual void MultiFrameOn ()
 
virtual void MultiFrameOff ()
 
virtual int GetMultiFrame ()
 
virtual void SetTimeAsVector (int)
 Write scalar components as the time dimension (default: Off). More...
 
virtual void TimeAsVectorOn ()
 
virtual void TimeAsVectorOff ()
 
virtual int GetTimeAsVector ()
 
virtual void SetTimeDimension (int)
 Set the time dimension to use in the DICOM file (or zero if none). More...
 
virtual int GetTimeDimension ()
 
virtual void SetTimeSpacing (double)
 
virtual double GetTimeSpacing ()
 
virtual void SetRescaleIntercept (double)
 Set the rescaling parameters, for example for CT. More...
 
virtual double GetRescaleIntercept ()
 
virtual void SetRescaleSlope (double)
 
virtual double GetRescaleSlope ()
 
virtual void SetNumberOfOverlays (int)
 Set the number of overlays to generate. More...
 
virtual int GetNumberOfOverlays ()
 
void SetPatientMatrix (vtkMatrix4x4 *)
 Set the matrix that places the image in DICOM patient coords. More...
 
vtkMatrix4x4 * GetPatientMatrix ()
 
virtual void SetOriginAtBottom (int)
 Let the generator know how the image is arranged in memory. More...
 
virtual int GetOriginAtBottom ()
 
virtual void SetReverseSliceOrder (int)
 Let the generator know how to order the slices. More...
 
virtual int GetReverseSliceOrder ()
 
void SetSourceMetaData (vtkDICOMMetaData *)
 Set some meta data for the constructor to use as a source. More...
 
vtkDICOMMetaDataGetSourceMetaData ()
 
void SetUIDGenerator (vtkDICOMUIDGenerator *)
 Set the UID generator, for generating unique IDs. More...
 
vtkDICOMUIDGeneratorGetUIDGenerator ()
 
vtkIntArray * GetSliceIndexArray ()
 Get an array that maps file and frame to slice. More...
 
vtkIntArray * GetComponentIndexArray ()
 Get an array that maps file and frame to component. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommand * GetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkDICOMGeneratorNew ()
 Static method for construction.
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkDICOMGeneratorSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Types

enum  {
  RepresentationUnsigned = 1u , RepresentationSigned = 2u , BitsStored1 = 1u , BitsStored6 = (1u << 5) ,
  BitsStored8 = (1u << 7) , BitsStored10 = (1u << 9) , BitsStored12 = (1u << 11) , BitsStored16 = (1u << 15) ,
  BitsStored32 = (1u << 31)
}
 Enumerated values for restricting pixel values.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkDICOMGenerator ()
 Protected constructor method.
 
std::string GenerateUID (vtkDICOMTag tag)
 Generate a UID for the provided tag.
 
void GenerateUIDs (vtkDICOMTag tag, vtkStringArray *uids)
 Generate a series of UIDs, sorted from low to high. More...
 
void SetPixelRestrictions (unsigned int pixelRepresentation, unsigned int bitsStored, int colorComponents)
 Used by subclasses to place restrictions on the pixel type.
 
virtual bool GenerateSOPCommonModule (vtkDICOMMetaData *meta, const char *SOPClass)
 Generate the DICOM SOP Common Module.
 
virtual bool GeneratePatientModule (vtkDICOMMetaData *source)
 Generate the DICOM Patient Module.
 
virtual bool GenerateClinicalTrialSubjectModule (vtkDICOMMetaData *source)
 Generate the DICOM Clinical Trial Subject Module.
 
virtual bool GenerateGeneralStudyModule (vtkDICOMMetaData *source)
 Generate the DICOM General Study Module.
 
virtual bool GeneratePatientStudyModule (vtkDICOMMetaData *source)
 Generate the DICOM Patient Study Module.
 
virtual bool GenerateClinicalTrialStudyModule (vtkDICOMMetaData *source)
 Generate the DICOM Clinical Trial Study Module.
 
virtual bool GenerateGeneralSeriesModule (vtkDICOMMetaData *source)
 Generate the DICOM Series Module.
 
virtual bool GenerateClinicalTrialSeriesModule (vtkDICOMMetaData *source)
 Generate the DICOM Clinical Trial Series Module.
 
virtual bool GenerateFrameOfReferenceModule (vtkDICOMMetaData *source)
 Generate the DICOM Frame of Reference Module.
 
virtual bool GenerateGeneralEquipmentModule (vtkDICOMMetaData *source)
 Generate the DICOM Equipment Module.
 
virtual bool GenerateGeneralImageModule (vtkDICOMMetaData *source)
 Generate the DICOM Image Module.
 
virtual bool GenerateImagePlaneModule (vtkDICOMMetaData *source)
 Generate the DICOM Plane Module.
 
virtual bool GenerateImagePixelModule (vtkDICOMMetaData *source)
 Generate the DICOM Pixel Module.
 
virtual bool GenerateContrastBolusModule (vtkDICOMMetaData *source)
 Generate The DICOM Contrast/Bolus Module.
 
virtual bool GenerateMultiFrameModule (vtkDICOMMetaData *source)
 Generate The DICOM Multi-frame Module.
 
virtual bool GenerateDeviceModule (vtkDICOMMetaData *source)
 Generate The DICOM Device Module.
 
virtual bool GenerateSpecimenModule (vtkDICOMMetaData *source)
 Generate The DICOM Specimen Module.
 
virtual bool GenerateOverlayPlaneModule (vtkDICOMMetaData *source)
 Generate the DICOM Overlay Plane Module.
 
virtual bool GenerateVOILUTModule (vtkDICOMMetaData *source)
 Generate the DICOM VOI LUT Module.
 
virtual bool CopyRequiredAttributes (const DC::EnumType *tags, vtkDICOMMetaData *source)
 Copy required attributes into the meta data. More...
 
virtual bool CopyOptionalAttributes (const DC::EnumType *tags, vtkDICOMMetaData *source)
 Copy optional attributes into the meta data. More...
 
virtual bool CopyAttributes (const DC::EnumType *blacklist, vtkDICOMMetaData *source)
 Copy all attributes into the meta data, excluding blacklisted ones. More...
 
void ComputeAdjustedMatrix (double matrix[16], double origin[3], double spacing[3])
 Compute the matrix, needed for Position and Orientation.
 
virtual void ComputeDimensions (vtkInformation *info, int *nframes, int dims[5], double spacing[5], double origin[5])
 Compute the dimensions. More...
 
virtual void ComputePixelValueRange (vtkInformation *info, int seriesRange[2])
 Compute the range of the data. More...
 
virtual void MatchInstances (vtkDICOMMetaData *source)
 Attempt to match each slice to a source meta data slice.
 
virtual void InitializeMetaData (vtkInformation *info)
 Initialize the meta data and compute the slice index array. More...
 
- Protected Member Functions inherited from vtkObject
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static void ComputeAspectRatio (const double spacing[2], int aspect[2])
 Compute aspect ratio from spacing.
 
static void ComputePositionAndOrientation (const double origin[3], const double matrix[16], double position[3], double orientation[6])
 Compute the position and orientation for a slice. More...
 

Protected Attributes

vtkDICOMMetaDataMetaData
 The generated meta data.
 
vtkDICOMMetaDataSourceMetaData
 The source meta data.
 
vtkDICOMUIDGeneratorUIDGenerator
 The UID generator.
 
int Extended
 Whether to copy attributes that aren't in the base SOP class.
 
int MultiFrame
 Whether to prefer multi-frame files over single-frame.
 
int OriginAtBottom
 Whether VTK image data is not top-to-bottom yet.
 
int ReverseSliceOrder
 Whether to reverse the slices as compared to input data.
 
int TimeAsVector
 Whether time is stored in slices or in scalar components.
 
int TimeDimension
 Time dimension suggested by the writer.
 
double TimeSpacing
 
double RescaleIntercept
 Data rescaling parameters.
 
double RescaleSlope
 
int NumberOfOverlays
 The number of overlays to generate.
 
int ScalarType
 The VTK scalar type of the data, set by InitializeMetaData().
 
int NumberOfColorComponents
 The number of color components, for color scalars. More...
 
unsigned int AllowedPixelRepresentation
 The permitted pixel representation and bits stored, as bitfields.
 
unsigned int AllowedBitsStored
 
int NumberOfFrames
 The number of frames. More...
 
int Dimensions [5]
 The actual dimensions to write to the file. More...
 
double Spacing [5]
 
double Origin [5]
 
int PixelValueRange [2]
 The smallest and largest pixel values in the image data. More...
 
vtkMatrix4x4 * PatientMatrix
 The orientation matrix for the DICOM file.
 
vtkIntArray * SliceIndexArray
 The file-and-frame to slice-and-component maps.
 
vtkIntArray * ComponentIndexArray
 
vtkIntArray * SourceInstanceArray
 Map from output files to input files.
 
vtkIntArray * RangeArray
 Map from frame to image min/max.
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Generate DICOM data series for specific IOD classes.

Every DICOM data set must conform to a specific class, where the properties of all the classes are defined in the DICOM standard. There are specific IOD classes for MR, CT, ultrasound X-ray, etc., in fact there are several dozen classes in total. IOD is the acronym for Information Object Description, and refers to the attributes that a data set belonging to a particular IOD class can or must have. The vtkDICOMGenerator is an abstract base class that provides support for most of the common modules in the DICOM standard (i.e. modules that are shared between modalities). Subclasses of vtkDICOMGenerator are concrete classes that provide generation of data sets belonging to specific modalities.

Member Function Documentation

◆ ComputeDimensions()

virtual void vtkDICOMGenerator::ComputeDimensions ( vtkInformation *  info,
int *  nframes,
int  dims[5],
double  spacing[5],
double  origin[5] 
)
protectedvirtual

Compute the dimensions.

This will compute the dimensions of the data, given the information supplied by the reader.

◆ ComputePixelValueRange()

virtual void vtkDICOMGenerator::ComputePixelValueRange ( vtkInformation *  info,
int  seriesRange[2] 
)
protectedvirtual

Compute the range of the data.

If the image data is present, compute the range of all frames as well as a suitable window/level for each frame.

◆ ComputePositionAndOrientation()

static void vtkDICOMGenerator::ComputePositionAndOrientation ( const double  origin[3],
const double  matrix[16],
double  position[3],
double  orientation[6] 
)
staticprotected

Compute the position and orientation for a slice.

Given the origin of a slice (the position of the corner of the slice in VTK data coordinates), and a 4x4 matrix (which may be NULL), compute the ImagePositionPatient and the ImageOrientationPatient.

◆ CopyAttributes()

virtual bool vtkDICOMGenerator::CopyAttributes ( const DC::EnumType *  blacklist,
vtkDICOMMetaData source 
)
protectedvirtual

Copy all attributes into the meta data, excluding blacklisted ones.

The blacklist must be terminated with DC::ItemDelimitationItem. The blacklist may be set to NULL.

◆ CopyOptionalAttributes()

virtual bool vtkDICOMGenerator::CopyOptionalAttributes ( const DC::EnumType *  tags,
vtkDICOMMetaData source 
)
protectedvirtual

Copy optional attributes into the meta data.

The list of tags must be terminated with DC::ItemDelimitationItem.

◆ CopyRequiredAttributes()

virtual bool vtkDICOMGenerator::CopyRequiredAttributes ( const DC::EnumType *  tags,
vtkDICOMMetaData source 
)
protectedvirtual

Copy required attributes into the meta data.

Required attributes must be set, so if no value is available, then an empty zero-length attribute will be created for them. The list of tags must be terminated with DC::ItemDelimitationItem.

◆ GenerateInstance()

virtual bool vtkDICOMGenerator::GenerateInstance ( vtkInformation *  )
virtual

Generate an instance of one of the supported classes.

This is the primary interface method of this class. Given the information for a vtkImageData object, it will populate the attributes of the supplied vtkDICOMMetaData object.

Reimplemented in vtkDICOMSCGenerator, vtkDICOMMRGenerator, and vtkDICOMCTGenerator.

◆ GenerateUIDs()

void vtkDICOMGenerator::GenerateUIDs ( vtkDICOMTag  tag,
vtkStringArray *  uids 
)
protected

Generate a series of UIDs, sorted from low to high.

Before passing the string array, call SetNumberOfValues() on the array to specify the number of UIDs that you want to be stored in it. The stored UIDs will be sorted, low to high. Generating a batch of UIDs is more efficient than calling GenerateUID() repeatedly.

◆ GetComponentIndexArray()

vtkIntArray* vtkDICOMGenerator::GetComponentIndexArray ( )
inline

Get an array that maps file and frame to component.

Once the generator has created the metadata, this array lets the writer know which component to write out as which frame in which file. This will be a 2D array, with the file as the first index and the frame as the second index.

◆ GetMetaData()

vtkDICOMMetaData* vtkDICOMGenerator::GetMetaData ( )

Get the generated meta data.

Every time GenerateInstance() is called, it will generate a new meta data object that can be retrieved with this method.

◆ GetSliceIndexArray()

vtkIntArray* vtkDICOMGenerator::GetSliceIndexArray ( )
inline

Get an array that maps file and frame to slice.

Once the generator has created the metadata, this array lets the writer know which slice to write out as which frame in which file. This will be a 2D array, with the file as the first index and the frame as the second index.

◆ InitializeMetaData()

virtual void vtkDICOMGenerator::InitializeMetaData ( vtkInformation *  info)
protectedvirtual

Initialize the meta data and compute the slice index array.

This must be done before any of the meta data has been generated. It creates a mapping between the files and frames that will be written, and the slices that make up the image data.

◆ IsA()

virtual vtkTypeBool vtkDICOMGenerator::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 vtkObjectBase.

Reimplemented in vtkDICOMSCGenerator, vtkDICOMMRGenerator, and vtkDICOMCTGenerator.

◆ SetExtended()

virtual void vtkDICOMGenerator::SetExtended ( int  )
virtual

Copy extended attributes from source (default: Off).

If this is off (the default), then only attributes that are part of the base SOP class will be copied from the source. Otherwise, all attributes (standard and private) will be copied. No validation is performed on attributes that aren't part of the base SOP class.

◆ SetMultiFrame()

virtual void vtkDICOMGenerator::SetMultiFrame ( int  )
virtual

Create a multi-frame object (default: Off).

If this is on, the one multi-frame data set will be created. If this is off, then each slice will be put into a different data set. The latter is more likely to be compatible with older software.

◆ SetNumberOfOverlays()

virtual void vtkDICOMGenerator::SetNumberOfOverlays ( int  )
virtual

Set the number of overlays to generate.

This will cause overlay attributes to be copied from the source meta data to the output meta data. It is up to the writer to ensure that the values are consistent with each other.

◆ SetOriginAtBottom()

virtual void vtkDICOMGenerator::SetOriginAtBottom ( int  )
virtual

Let the generator know how the image is arranged in memory.

The generator needs to know how to interpret the geometry of the image that is described in the vtkInformation object that accompanies the image. For example, VTK display coordinates place the Origin at the lower left corner of the screen, while DICOM assumes that images will be displayed with the "origin" at the top left corner. By default, OriginAtBottom is On.

◆ SetPatientMatrix()

void vtkDICOMGenerator::SetPatientMatrix ( vtkMatrix4x4 *  )

Set the matrix that places the image in DICOM patient coords.

The 3x3 portion of the matrix must be orthonormal, and the last column of the matrix is understood to be in millimetres.

◆ SetRescaleIntercept()

virtual void vtkDICOMGenerator::SetRescaleIntercept ( double  )
virtual

Set the rescaling parameters, for example for CT.

CT, PET, and some other modalities require rescaling parameters so that the integer pixel values can be converted into physical units.

◆ SetReverseSliceOrder()

virtual void vtkDICOMGenerator::SetReverseSliceOrder ( int  )
virtual

Let the generator know how to order the slices.

By default, the generator will try to keep the same slice order as the meta data set by SetSourceMetaData(), but if no ordering can be discerned from the meta data, then the slices will be ordered according to this flag.

◆ SetSourceMetaData()

void vtkDICOMGenerator::SetSourceMetaData ( vtkDICOMMetaData )

Set some meta data for the constructor to use as a source.

The supplied meta data can provide some general properties of the data set, such as the patient information and study information. Only portions of the meta data that are permitted by the generated IOD will be included.

◆ SetTimeAsVector()

virtual void vtkDICOMGenerator::SetTimeAsVector ( int  )
virtual

Write scalar components as the time dimension (default: Off).

If this is on, then each time slot is stored in a different scalar component of the image data. If it is off, then each block of N adjacent slices correspond to the N time slots of the time dimension.

◆ SetTimeDimension()

virtual void vtkDICOMGenerator::SetTimeDimension ( int  )
virtual

Set the time dimension to use in the DICOM 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. This will be ignored if the SOP Class IOD does not permit a time dimension.

◆ SetUIDGenerator()

void vtkDICOMGenerator::SetUIDGenerator ( vtkDICOMUIDGenerator )

Set the UID generator, for generating unique IDs.

If no UID generator is supplied, then the default UID generator will be used.

Member Data Documentation

◆ Dimensions

int vtkDICOMGenerator::Dimensions[5]
protected

The actual dimensions to write to the file.

The ordering of the dimensions is x,y,z,t followed by a vector dimension that encompasses everything else. These are set by the InitializeMetaData() method. The dimension is set to zero for any dimensions that are not used.

◆ NumberOfColorComponents

int vtkDICOMGenerator::NumberOfColorComponents
protected

The number of color components, for color scalars.

Scalars of type "unsigned char" are interpreted as colors by VTK unless there is some indication that they should be interpreted otherwise. VTK color scalars come in these flavors: grayscale, greyscale+alpha, RGB, and RGBA. DICOM supports grayscale and RGB, so alpha will be discarded when VTK images are written as DICOM. So if NumberOfColorComponents is 2, then only the first component will be written to the file, and if NumberOfColorComponents is 4, then only the first three components will be written.

◆ NumberOfFrames

int vtkDICOMGenerator::NumberOfFrames
protected

The number of frames.

If this is nonzero, then the DICOM file will be a multi-frame file, overriding the MultiFrame variable. Some SOP classes are exclusively multi-frame while others are not. The value of this variable is computed InitializeMetaData().

◆ PixelValueRange

int vtkDICOMGenerator::PixelValueRange[2]
protected

The smallest and largest pixel values in the image data.

This is computed in the InitializeMetaData method.


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