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

Index a DICOM series to allow proper dimensional ordering. More...

#include <vtkDICOMSliceSorter.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkDICOMSliceSorterNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
 
void SetDesiredStackID (const char *stackId)
 Set the Stack ID of the stack to use, for named stacks. More...
 
const char * GetDesiredStackID ()
 
vtkStringArray * GetStackIDs ()
 Get a list of the stacks that are present. More...
 
vtkIntArray * GetFileIndexArray ()
 Get an array that converts slice index to input file index. More...
 
vtkIntArray * GetFrameIndexArray ()
 Get an array that converts slice index to frame index. More...
 
void SetMetaData (vtkDICOMMetaData *meta)
 Set the meta data for the DICOM files. More...
 
vtkDICOMMetaDataGetMetaData ()
 
virtual int GetRepeatsAsTime ()
 Force repeated slices to be at different times (default: Off). More...
 
virtual void SetRepeatsAsTime (int)
 
virtual void RepeatsAsTimeOn ()
 
virtual void RepeatsAsTimeOff ()
 
virtual int GetTimeAsVector ()
 Read the time dimension as scalar components (default: Off). More...
 
virtual void SetTimeAsVector (int)
 
virtual void TimeAsVectorOn ()
 
virtual void TimeAsVectorOff ()
 
int GetTimeDimension ()
 Get the time dimension if the DICOM series has one.
 
double GetTimeSpacing ()
 
virtual void SetDesiredTimeIndex (int)
 Set the desired time index (set to -1 for all).
 
virtual int GetDesiredTimeIndex ()
 
void SetTimeTag (vtkDICOMTag tag)
 Set the DICOM tag to use for time measurement. More...
 
vtkDICOMTag GetTimeTag ()
 
void SetTimeSequence (vtkDICOMTag tag)
 Set the DICOM sequence to use for timing information. More...
 
vtkDICOMTag GetTimeSequence ()
 
virtual int GetReverseSlices ()
 Set whether to reverse the slice order. More...
 
virtual void SetReverseSlices (int)
 
virtual void ReverseSlicesOn ()
 
virtual void ReverseSlicesOff ()
 
double GetSliceSpacing ()
 Get the slice spacing for the volume.
 
void Update ()
 Update the arrays.
 
- 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 vtkTypeBool IsTypeOf (const char *type)
 
static vtkDICOMSliceSorterSafeDownCast (vtkObjectBase *o)
 
static vtkDICOMSliceSorterNew ()
 
- 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 Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
virtual void SortFiles (vtkIntArray *fileArray, vtkIntArray *frameArray)
 
- 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 &)
 

Protected Attributes

vtkDICOMMetaDataMetaData
 
vtkIntArray * FileIndexArray
 
vtkIntArray * FrameIndexArray
 
vtkStringArray * StackIDs
 
int RepeatsAsTime
 
int TimeAsVector
 
int TimeDimension
 
int DesiredTimeIndex
 
double TimeSpacing
 
char DesiredStackID [20]
 
int ReverseSlices
 
double SliceSpacing
 
vtkDICOMTag TimeTag
 
vtkDICOMTag TimeSequence
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Index a DICOM series to allow proper dimensional ordering.

Given a vtkDICOMMetaData object for a DICOM series, this class will index the files and frames in the series so that they can be sorted into a multi-dimensional volume.

Member Function Documentation

◆ GetFileIndexArray()

vtkIntArray* vtkDICOMSliceSorter::GetFileIndexArray ( )
inline

Get an array that converts slice index to input file index.

The array can be two-dimensional and calling array->GetComponent(i,j) will return the file index for slice i and scalar component j for monochrome images, or for slice i and scalar component 3*j for RGB images (or more precisely, at scalar component N*j where N is the SamplesPerPixel value from the DICOM metadata). If the data has just one component, then use j=0. Use this array to index into the MetaData object to get the metadata for a particular slice.

◆ GetFrameIndexArray()

vtkIntArray* vtkDICOMSliceSorter::GetFrameIndexArray ( )
inline

Get an array that converts slice index to frame index.

The purpose of this array is to identify individual frames in multi-frame DICOM files. The dimensions of this array are identical to the FileIndexArray. Use FileIndexArray to identify the file, then use FrameIndexArray to identify the frame within that file.

◆ GetRepeatsAsTime()

virtual int vtkDICOMSliceSorter::GetRepeatsAsTime ( )
virtual

Force repeated slices to be at different times (default: Off).

If this is on, then repeated slices at the same spatial position will always be considered to be at different time points. If this is off, then the repeated slices will either become the temporal dimension or the vector dimension, depending on the presence of temporal attributes in the meta data.

◆ GetReverseSlices()

virtual int vtkDICOMSliceSorter::GetReverseSlices ( )
virtual

Set whether to reverse the slice order.

This is desired if the images are to be flipped.

◆ GetStackIDs()

vtkStringArray* vtkDICOMSliceSorter::GetStackIDs ( )
inline

Get a list of the stacks that are present.

A stack is a contiguous array of slices that form a volume.

◆ GetTimeAsVector()

virtual int vtkDICOMSliceSorter::GetTimeAsVector ( )
virtual

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

If this is on, then each time point will be stored as a scalar component in the image data. If the data has both a time dimension and a vector dimension, then the number of components will be the product of these two dimensions, i.e. the components will store a sequence of vectors, one vector for each time point.

◆ IsA()

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

◆ PrintSelf()

void vtkDICOMSliceSorter::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 vtkObjectBase.

◆ SetDesiredStackID()

void vtkDICOMSliceSorter::SetDesiredStackID ( const char *  stackId)

Set the Stack ID of the stack to use, for named stacks.

If the series has multiple stacks, then by default only the first stack will be used. This method allows you to select a different stack, if you know the DICOM StackID for the stack.

◆ SetMetaData()

void vtkDICOMSliceSorter::SetMetaData ( vtkDICOMMetaData meta)

Set the meta data for the DICOM files.

The Get() method of vtkDICOMMetaData takes optional file and frame indices, which specify the file and the frame within that file to get the attribute from. If you have a slice index rather than a file file index and frame index, then use the FileIndexArray and FrameIndexArray to convert the slice index into file and frame indices.

◆ SetTimeSequence()

void vtkDICOMSliceSorter::SetTimeSequence ( vtkDICOMTag  tag)

Set the DICOM sequence to use for timing information.

This is only used for enhanced multi-frame images. If used, then SetTimeTag() must also be used to specify which tag in the sequence to use for temporal sorting. By default, the following sequence/tag combinations are automatically detected and applied:

  • CardiacSynchronizationSequence/NominalCardiacTriggerDelayTime
  • TemporalPositionSequence/TemporalPositionTimeOffset
  • FrameContentSequence/TemporalPositionIndex
  • MREchoSequence/EffectiveEchoTime

◆ SetTimeTag()

void vtkDICOMSliceSorter::SetTimeTag ( vtkDICOMTag  tag)

Set the DICOM tag to use for time measurement.

This method can be used to explicitly set the tag to use for temporal sorting. By default (i.e. if this method is not used), the sorter will search the meta-data for the following temporal tags and will automatically apply them if present:

  • TriggerTime (for cardiac images)
  • EchoTime (for relaxometry)
  • TemporalPositionIdentifier (fMRI)

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