Slicer  5.0
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 Member Functions | Protected Attributes | Friends
vtkSegmentationConverterRule Class Referenceabstract

Abstract converter rule class. Subclasses perform conversions between specific representation types. They define source and target type and provide ways to create those types of objects. More...

#include <Libs/vtkSegmentationCore/vtkSegmentationConverterRule.h>

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

Public Types

typedef std::map< std::string, std::pair< std::string, std::string > > ConversionParameterListType
 
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkSegmentationConverterRuleClone ()
 Create a new instance of this rule and copy its contents. More...
 
virtual vtkDataObject * ConstructRepresentationObjectByClass (std::string className)=0
 
virtual vtkDataObject * ConstructRepresentationObjectByRepresentation (std::string representationName)=0
 
virtual bool Convert (vtkSegment *segment)=0
 
virtual vtkSegmentationConverterRuleCreateRuleInstance ()=0
 
virtual const char * GetClassName ()
 
virtual unsigned int GetConversionCost (vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr)
 
virtual std::string GetConversionParameter (const std::string &name)
 Get a conversion parameter value. More...
 
virtual std::string GetConversionParameterDescription (const std::string &name)
 Get a conversion parameter description. More...
 
virtual const char * GetName ()=0
 Human-readable name of the converter rule. More...
 
virtual void GetRuleConversionParameters (ConversionParameterListType &conversionParameters)
 
virtual const char * GetSourceRepresentationName ()=0
 Human-readable name of the source representation. More...
 
virtual const char * GetTargetRepresentationName ()=0
 Human-readable name of the target representation. More...
 
bool HasConversionParameter (const std::string &name)
 Determine if the rule has a parameter with a certain name. More...
 
virtual int IsA (const char *type)
 
virtual bool PostConvert (vtkSegmentation *vtkNotUsed(segmentation))
 
virtual bool PreConvert (vtkSegmentation *vtkNotUsed(segmentation))
 
virtual void SetConversionParameter (const std::string &name, const std::string &value, const std::string &description="")
 Set a conversion parameter. More...
 

Static Public Member Functions

static unsigned int GetConversionInfiniteCost ()
 
static int IsTypeOf (const char *type)
 
static vtkSegmentationConverterRuleSafeDownCast (vtkObject *o)
 

Protected Member Functions

virtual bool CreateTargetRepresentation (vtkSegment *segment)
 Update the target representation based on the source representation. More...
 
void operator= (const vtkSegmentationConverterRule &)
 
 vtkSegmentationConverterRule ()
 
 ~vtkSegmentationConverterRule () override
 

Protected Attributes

ConversionParameterListType ConversionParameters
 
bool ReplaceTargetRepresentation {false}
 

Friends

class vtkSegmentationConverter
 

Detailed Description

Abstract converter rule class. Subclasses perform conversions between specific representation types. They define source and target type and provide ways to create those types of objects.

Definition at line 52 of file vtkSegmentationConverterRule.h.

Member Typedef Documentation

◆ ConversionParameterListType

typedef std::map<std::string, std::pair<std::string, std::string> > vtkSegmentationConverterRule::ConversionParameterListType

Conversion parameter list type. Maps the conversion parameter name to a pair consisting of the value of the parameter (the default value if it is defined in the converter rule) and the description of the parameter that appears as tooltip in the conversion parameters widget ( name => (value, description) )

Definition at line 59 of file vtkSegmentationConverterRule.h.

◆ Superclass

Definition at line 63 of file vtkSegmentationConverterRule.h.

Constructor & Destructor Documentation

◆ vtkSegmentationConverterRule()

vtkSegmentationConverterRule::vtkSegmentationConverterRule ( )
protected

◆ ~vtkSegmentationConverterRule()

vtkSegmentationConverterRule::~vtkSegmentationConverterRule ( )
overrideprotected

Member Function Documentation

◆ Clone()

virtual vtkSegmentationConverterRule* vtkSegmentationConverterRule::Clone ( )
virtual

Create a new instance of this rule and copy its contents.

◆ ConstructRepresentationObjectByClass()

virtual vtkDataObject* vtkSegmentationConverterRule::ConstructRepresentationObjectByClass ( std::string  className)
pure virtual

Constructs representation object from class name for the supported representation classes (typically source and target representation VTK classes, subclasses of vtkDataObject) Note: Need to take ownership of the created object! For example using vtkSmartPointer<vtkDataObject>::Take

Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ ConstructRepresentationObjectByRepresentation()

virtual vtkDataObject* vtkSegmentationConverterRule::ConstructRepresentationObjectByRepresentation ( std::string  representationName)
pure virtual

Constructs representation object from representation name for the supported representation classes (typically source and target representation VTK classes, subclasses of vtkDataObject) Note: Need to take ownership of the created object! For example using vtkSmartPointer<vtkDataObject>::Take

Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ Convert()

virtual bool vtkSegmentationConverterRule::Convert ( vtkSegment segment)
pure virtual

Update the target representation based on the source representation Initializes the target representation and calls ConvertInternal

See also
ConvertInternal

Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ CreateRuleInstance()

virtual vtkSegmentationConverterRule* vtkSegmentationConverterRule::CreateRuleInstance ( )
pure virtual

Create instance of the default node. Similar to New but virtual method. Subclasses should implement this method by

Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ CreateTargetRepresentation()

virtual bool vtkSegmentationConverterRule::CreateTargetRepresentation ( vtkSegment segment)
protectedvirtual

Update the target representation based on the source representation.

◆ GetClassName()

virtual const char* vtkSegmentationConverterRule::GetClassName ( )
virtual

◆ GetConversionCost()

virtual unsigned int vtkSegmentationConverterRule::GetConversionCost ( vtkDataObject *  sourceRepresentation = nullptr,
vtkDataObject *  targetRepresentation = nullptr 
)
inlinevirtual

Get the cost of the conversion.

Returns
Expected duration of the conversion in milliseconds. If the arguments are omitted, then a rough average can be given just to indicate the relative computational cost of the algorithm. If the objects are given, then a more educated guess can be made based on the object properties (dimensions, number of points, etc).

Reimplemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

Definition at line 103 of file vtkSegmentationConverterRule.h.

◆ GetConversionInfiniteCost()

static unsigned int vtkSegmentationConverterRule::GetConversionInfiniteCost ( )
inlinestatic

Constant to use for converter rules with "infinite" computational cost (i.e. disabled) It's about UINT_MAX / 400 (allows us to have a few hundred disabled rules)

Definition at line 63 of file vtkSegmentationConverterRule.h.

◆ GetConversionParameter()

virtual std::string vtkSegmentationConverterRule::GetConversionParameter ( const std::string &  name)
virtual

Get a conversion parameter value.

◆ GetConversionParameterDescription()

virtual std::string vtkSegmentationConverterRule::GetConversionParameterDescription ( const std::string &  name)
virtual

Get a conversion parameter description.

◆ GetName()

virtual const char* vtkSegmentationConverterRule::GetName ( )
pure virtual

◆ GetRuleConversionParameters()

virtual void vtkSegmentationConverterRule::GetRuleConversionParameters ( ConversionParameterListType conversionParameters)
virtual

Get rule conversion parameters for aggregated path parameters. Existing values in the map are overwritten, missing name&values are added.

◆ GetSourceRepresentationName()

virtual const char* vtkSegmentationConverterRule::GetSourceRepresentationName ( )
pure virtual

◆ GetTargetRepresentationName()

virtual const char* vtkSegmentationConverterRule::GetTargetRepresentationName ( )
pure virtual

◆ HasConversionParameter()

bool vtkSegmentationConverterRule::HasConversionParameter ( const std::string &  name)

Determine if the rule has a parameter with a certain name.

◆ IsA()

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

◆ IsTypeOf()

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

◆ operator=()

void vtkSegmentationConverterRule::operator= ( const vtkSegmentationConverterRule )
protected

◆ PostConvert()

virtual bool vtkSegmentationConverterRule::PostConvert ( vtkSegmentation vtkNotUsedsegmentation)
inlinevirtual

Perform post-conversion steps across the specified segments in the segmentation This step should be unnecessary if only converting a single segment

Reimplemented in vtkClosedSurfaceToFractionalLabelmapConversionRule.

Definition at line 97 of file vtkSegmentationConverterRule.h.

◆ PreConvert()

virtual bool vtkSegmentationConverterRule::PreConvert ( vtkSegmentation vtkNotUsedsegmentation)
inlinevirtual

Perform pre-conversion steps across the specified segments in the segmentation This step should be unnecessary if only converting a single segment

Definition at line 88 of file vtkSegmentationConverterRule.h.

◆ SafeDownCast()

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

◆ SetConversionParameter()

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

Set a conversion parameter.

Friends And Related Function Documentation

◆ vtkSegmentationConverter

friend class vtkSegmentationConverter
friend

Definition at line 157 of file vtkSegmentationConverterRule.h.

Member Data Documentation

◆ ConversionParameters

ConversionParameterListType vtkSegmentationConverterRule::ConversionParameters
protected

Dictionary of conversion parameters in form of name -> default value, description. Each conversion rule defines its required/possible conversion parameters, and sets possible default values whenever applicable. Required parameters have empty defaults. When the user changes the parameter value, then the default is being overwritten to contain the custom value, but for new segmentations, it is initially the default.

Definition at line 149 of file vtkSegmentationConverterRule.h.

◆ ReplaceTargetRepresentation

bool vtkSegmentationConverterRule::ReplaceTargetRepresentation {false}
protected

Used when calling createTargetRepresentation If true, replaces the target representation of the segment with a new object, even if one already exists If false, will only create a target representation if one already doesn't exist. False by default.

Definition at line 155 of file vtkSegmentationConverterRule.h.


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