Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
vtkSegmentationConverter Class Reference

Class that can convert between different representations of a segment. More...

#include <Libs/vtkSegmentationCore/vtkSegmentationConverter.h>

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

Public Types

typedef std::vector< ConversionPathAndCostTypeConversionPathAndCostListType
 
typedef std::pair< ConversionPathType, unsigned int > ConversionPathAndCostType
 
typedef std::vector< vtkSegmentationConverterRule * > ConversionPathType
 
typedef std::vector< vtkSmartPointer< vtkSegmentationConverterRule > > ConverterRulesListType
 
typedef vtkObject Superclass
 

Public Member Functions

void ApplyTransformOnReferenceImageGeometry (vtkAbstractTransform *transform)
 
virtual void DeepCopy (vtkSegmentationConverter *aConverter)
 Deep copy one converter into another. More...
 
void DeserializeConversionParameters (std::string conversionParametersString)
 
void GetAllConversionParameters (vtkSegmentationConverterRule::ConversionParameterListType &conversionParameters)
 Get all conversion parameters in this converter. Aggregates all parameters from all rules. More...
 
void GetAvailableRepresentationNames (std::set< std::string > &representationNames)
 Get all representations supported by the converter. More...
 
virtual const char * GetClassName ()
 
std::string GetConversionParameter (const std::string &name)
 
std::string GetConversionParameterDescription (const std::string &description)
 
void GetConversionParametersForPath (vtkSegmentationConverterRule::ConversionParameterListType &conversionParameters, const ConversionPathType &path)
 Get all conversion parameters used by the selected conversion path. More...
 
void GetPossibleConversions (const std::string &sourceRepresentationName, const std::string &targetRepresentationName, ConversionPathAndCostListType &pathsCosts)
 Get all possible conversions between two representations. More...
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
std::string SerializeAllConversionParameters ()
 
void SetConversionParameter (const std::string &name, const std::string &value, const std::string &description="")
 Set a conversion parameter to all rules having this parameter. More...
 
void SetConversionParameters (vtkSegmentationConverterRule::ConversionParameterListType parameters)
 Set a list of conversion parameters to all rules (cannot change the description, only the value) More...
 

Static Public Member Functions

static bool DeserializeImageGeometry (std::string geometryString, vtkOrientedImageData *orientedImageData, bool allocateScalars=true, int scalarType=VTK_VOID, int numberOfScalarsComponents=-1)
 
static bool DeserializeImageGeometry (std::string geometryString, vtkMatrix4x4 *geometryMatrix, int extent[6])
 
static ConversionPathType GetCheapestPath (const ConversionPathAndCostListType &pathsCosts)
 Return cheapest path from a list of paths with costs. More...
 
static const char * GetInterpolationTypeFieldName ()
 
static const std::string GetReferenceImageGeometryParameterName ()
 
static const char * GetScalarRangeFieldName ()
 Field names for 2D display parameters. More...
 
static const char * GetSegmentationBinaryLabelmapRepresentationName ()
 
static const char * GetSegmentationClosedSurfaceRepresentationName ()
 
static const char * GetSegmentationFractionalLabelmapRepresentationName ()
 
static const char * GetSegmentationPlanarContourRepresentationName ()
 
static const char * GetThresholdValueFieldName ()
 
static int IsTypeOf (const char *type)
 
static vtkSegmentationConverterNew ()
 
static vtkSegmentationConverterSafeDownCast (vtkObject *o)
 
static std::string SerializeImageGeometry (vtkOrientedImageData *orientedImageData)
 Utility function for serializing geometry of oriented image data. More...
 
static std::string SerializeImageGeometry (vtkMatrix4x4 *geometryMatrix, vtkImageData *imageData)
 Utility function for serializing geometry of a complete geometry matrix and regular image data (providing only extent) More...
 
static std::string SerializeImageGeometry (vtkMatrix4x4 *geometryMatrix, int extent[6])
 Utility function for serializing geometry of a complete geometry matrix and given extents. More...
 

Protected Types

typedef std::map< std::string, RulesListTypeRepresentationToRepresentationToRuleMapType
 For each "from" representation (first) stores an array of rules (second) More...
 
typedef std::vector< vtkSegmentationConverterRule * > RulesListType
 For each "to" representation (first) stores a rule (second) More...
 

Protected Member Functions

void FindPath (const std::string &sourceRepresentationName, const std::string &targetRepresentationName, ConversionPathAndCostListType &pathsCosts, std::set< std::string > &skipRepresentations)
 
void operator= (const vtkSegmentationConverter &)
 
void RebuildRulesGraph ()
 Build a graph from ConverterRules list to facilitate faster finding of rules from a specific representation. More...
 
 vtkSegmentationConverter ()
 
 ~vtkSegmentationConverter ()
 

Protected Attributes

ConverterRulesListType ConverterRules
 
RepresentationToRepresentationToRuleMapType RulesGraph
 Source representation to target representation rule graph. More...
 

Detailed Description

Class that can convert between different representations of a segment.

Definition at line 47 of file vtkSegmentationConverter.h.

Member Typedef Documentation

◆ ConversionPathAndCostListType

Definition at line 54 of file vtkSegmentationConverter.h.

◆ ConversionPathAndCostType

Definition at line 53 of file vtkSegmentationConverter.h.

◆ ConversionPathType

Definition at line 52 of file vtkSegmentationConverter.h.

◆ ConverterRulesListType

Definition at line 50 of file vtkSegmentationConverter.h.

◆ RepresentationToRepresentationToRuleMapType

For each "from" representation (first) stores an array of rules (second)

Definition at line 180 of file vtkSegmentationConverter.h.

◆ RulesListType

For each "to" representation (first) stores a rule (second)

Definition at line 178 of file vtkSegmentationConverter.h.

◆ Superclass

Definition at line 76 of file vtkSegmentationConverter.h.

Constructor & Destructor Documentation

◆ vtkSegmentationConverter()

vtkSegmentationConverter::vtkSegmentationConverter ( )
protected

◆ ~vtkSegmentationConverter()

vtkSegmentationConverter::~vtkSegmentationConverter ( )
protected

Member Function Documentation

◆ ApplyTransformOnReferenceImageGeometry()

void vtkSegmentationConverter::ApplyTransformOnReferenceImageGeometry ( vtkAbstractTransform *  transform)

Apply a transform on the reference image geometry Linear: simply multiply the geometry matrix with the applied matrix, extent stays the same Non-linear: calculate new extents and change only the extents

◆ DeepCopy()

virtual void vtkSegmentationConverter::DeepCopy ( vtkSegmentationConverter aConverter)
virtual

Deep copy one converter into another.

◆ DeserializeConversionParameters()

void vtkSegmentationConverter::DeserializeConversionParameters ( std::string  conversionParametersString)

Parse conversion parameters in string and set it to the converter Such a string can be constructed in a segmentation converter object using /sa SerializeAllConversionParameters

◆ DeserializeImageGeometry() [1/2]

static bool vtkSegmentationConverter::DeserializeImageGeometry ( std::string  geometryString,
vtkOrientedImageData orientedImageData,
bool  allocateScalars = true,
int  scalarType = VTK_VOID,
int  numberOfScalarsComponents = -1 
)
static

Utility function for de-serializing reference image geometry into a dummy oriented image data

Parameters
geometryStringString containing the serialized image geometry
orientedImageDataDummy oriented image data containing the de-serialized geometry information
allocateScalarsReallocate scalar array to match the new geometry. Can be set to false if image buffer is not used (e.g., an image is only created to parse image geometry)
scalarTypeIf specified then scalar type will be set to the requested value, otherwise current value will be kept.
numberOfScalarsComponentsIf specified then the number of scalar components will be set to the requested value, otherwise current value will be kept.
Returns
Success flag

◆ DeserializeImageGeometry() [2/2]

static bool vtkSegmentationConverter::DeserializeImageGeometry ( std::string  geometryString,
vtkMatrix4x4 *  geometryMatrix,
int  extent[6] 
)
static

Utility function for de-serializing reference image geometry into a matrix and a dimensions vector

Parameters
geometryStringString containing the serialized image geometry
geometryMatrixMatrix containing the de-serialized directions, scaling and origin
extentVector containing the de-serialized extent
Returns
Success flag

◆ FindPath()

void vtkSegmentationConverter::FindPath ( const std::string &  sourceRepresentationName,
const std::string &  targetRepresentationName,
ConversionPathAndCostListType pathsCosts,
std::set< std::string > &  skipRepresentations 
)
protected

Find a transform path between the specified coordinate frames.

Parameters
sourceRepresentationNamerepresentation to convert from
targetRepresentationNamerepresentation to convert to
conversionListStores the list of converter rules to get from source to the target representation (if not found then returns with empty list). The caller should pass an empty list (when the method is called recursively the list is not empty).
skipRepresentationsRepresentations that should be ignored (e.g., because they are used already). The caller should pass an empty set (when the method is called recursively the set is not empty).

◆ GetAllConversionParameters()

void vtkSegmentationConverter::GetAllConversionParameters ( vtkSegmentationConverterRule::ConversionParameterListType conversionParameters)

Get all conversion parameters in this converter. Aggregates all parameters from all rules.

◆ GetAvailableRepresentationNames()

void vtkSegmentationConverter::GetAvailableRepresentationNames ( std::set< std::string > &  representationNames)

Get all representations supported by the converter.

◆ GetCheapestPath()

static ConversionPathType vtkSegmentationConverter::GetCheapestPath ( const ConversionPathAndCostListType pathsCosts)
static

Return cheapest path from a list of paths with costs.

◆ GetClassName()

virtual const char* vtkSegmentationConverter::GetClassName ( )
virtual

◆ GetConversionParameter()

std::string vtkSegmentationConverter::GetConversionParameter ( const std::string &  name)

Get a conversion parameter value from first rule containing this parameter Note: all parameters with the same name should contain the same value

◆ GetConversionParameterDescription()

std::string vtkSegmentationConverter::GetConversionParameterDescription ( const std::string &  description)

Get a conversion parameter description from first rule containing this parameter Note: all parameters with the same name should contain the same value

◆ GetConversionParametersForPath()

void vtkSegmentationConverter::GetConversionParametersForPath ( vtkSegmentationConverterRule::ConversionParameterListType conversionParameters,
const ConversionPathType path 
)

Get all conversion parameters used by the selected conversion path.

◆ GetInterpolationTypeFieldName()

static const char* vtkSegmentationConverter::GetInterpolationTypeFieldName ( )
inlinestatic

Definition at line 72 of file vtkSegmentationConverter.h.

◆ GetPossibleConversions()

void vtkSegmentationConverter::GetPossibleConversions ( const std::string &  sourceRepresentationName,
const std::string &  targetRepresentationName,
ConversionPathAndCostListType pathsCosts 
)

Get all possible conversions between two representations.

◆ GetReferenceImageGeometryParameterName()

static const std::string vtkSegmentationConverter::GetReferenceImageGeometryParameterName ( )
inlinestatic

Reference image geometry conversion parameter Contains serialized matrix and extent

Definition at line 67 of file vtkSegmentationConverter.h.

◆ GetScalarRangeFieldName()

static const char* vtkSegmentationConverter::GetScalarRangeFieldName ( )
inlinestatic

Field names for 2D display parameters.

Definition at line 70 of file vtkSegmentationConverter.h.

◆ GetSegmentationBinaryLabelmapRepresentationName()

static const char* vtkSegmentationConverter::GetSegmentationBinaryLabelmapRepresentationName ( )
inlinestatic

Default representation types In binary and fractional labelmaps values <=0 are considered background voxels (outside), values>0 are foreground (inside).

Definition at line 58 of file vtkSegmentationConverter.h.

◆ GetSegmentationClosedSurfaceRepresentationName()

static const char* vtkSegmentationConverter::GetSegmentationClosedSurfaceRepresentationName ( )
inlinestatic

Definition at line 61 of file vtkSegmentationConverter.h.

◆ GetSegmentationFractionalLabelmapRepresentationName()

static const char* vtkSegmentationConverter::GetSegmentationFractionalLabelmapRepresentationName ( )
inlinestatic

Definition at line 59 of file vtkSegmentationConverter.h.

◆ GetSegmentationPlanarContourRepresentationName()

static const char* vtkSegmentationConverter::GetSegmentationPlanarContourRepresentationName ( )
inlinestatic

Definition at line 60 of file vtkSegmentationConverter.h.

◆ GetThresholdValueFieldName()

static const char* vtkSegmentationConverter::GetThresholdValueFieldName ( )
inlinestatic

Definition at line 71 of file vtkSegmentationConverter.h.

◆ IsA()

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

◆ IsTypeOf()

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

◆ New()

static vtkSegmentationConverter* vtkSegmentationConverter::New ( )
static

◆ operator=()

void vtkSegmentationConverter::operator= ( const vtkSegmentationConverter )
protected

◆ PrintSelf()

void vtkSegmentationConverter::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

◆ RebuildRulesGraph()

void vtkSegmentationConverter::RebuildRulesGraph ( )
protected

Build a graph from ConverterRules list to facilitate faster finding of rules from a specific representation.

◆ SafeDownCast()

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

◆ SerializeAllConversionParameters()

std::string vtkSegmentationConverter::SerializeAllConversionParameters ( )

Serialize all conversion parameters. The resulting string can be parsed in a segmentation converter object using /sa DeserializeConversionParameters

◆ SerializeImageGeometry() [1/3]

static std::string vtkSegmentationConverter::SerializeImageGeometry ( vtkOrientedImageData orientedImageData)
static

Utility function for serializing geometry of oriented image data.

◆ SerializeImageGeometry() [2/3]

static std::string vtkSegmentationConverter::SerializeImageGeometry ( vtkMatrix4x4 *  geometryMatrix,
vtkImageData *  imageData 
)
static

Utility function for serializing geometry of a complete geometry matrix and regular image data (providing only extent)

◆ SerializeImageGeometry() [3/3]

static std::string vtkSegmentationConverter::SerializeImageGeometry ( vtkMatrix4x4 *  geometryMatrix,
int  extent[6] 
)
static

Utility function for serializing geometry of a complete geometry matrix and given extents.

◆ SetConversionParameter()

void vtkSegmentationConverter::SetConversionParameter ( const std::string &  name,
const std::string &  value,
const std::string &  description = "" 
)

Set a conversion parameter to all rules having this parameter.

◆ SetConversionParameters()

void vtkSegmentationConverter::SetConversionParameters ( vtkSegmentationConverterRule::ConversionParameterListType  parameters)

Set a list of conversion parameters to all rules (cannot change the description, only the value)

Member Data Documentation

◆ ConverterRules

ConverterRulesListType vtkSegmentationConverter::ConverterRules
protected

Converter rules. When the class is created it contains just the default converter rules but then rules may be customized with parameters and may store segment-specific information. Therefore, the rules should not be reused in other segments.

Definition at line 175 of file vtkSegmentationConverter.h.

◆ RulesGraph

RepresentationToRepresentationToRuleMapType vtkSegmentationConverter::RulesGraph
protected

Source representation to target representation rule graph.

Definition at line 183 of file vtkSegmentationConverter.h.


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