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 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 (vtkDataObject *sourceRepresentation, vtkDataObject *targetRepresentation)=0
 Update the target representation based on the source representation. More...
 
virtual vtkSegmentationConverterRuleCreateRuleInstance ()=0
 
virtual const char * GetClassName ()
 
virtual unsigned int GetConversionCost (vtkDataObject *sourceRepresentation=NULL, vtkDataObject *targetRepresentation=NULL)
 
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 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

void operator= (const vtkSegmentationConverterRule &)
 
 vtkSegmentationConverterRule ()
 
 ~vtkSegmentationConverterRule ()
 

Protected Attributes

ConversionParameterListType ConversionParameters
 

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 49 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 56 of file vtkSegmentationConverterRule.h.

◆ Superclass

Definition at line 60 of file vtkSegmentationConverterRule.h.

Constructor & Destructor Documentation

◆ vtkSegmentationConverterRule()

vtkSegmentationConverterRule::vtkSegmentationConverterRule ( )
protected

◆ ~vtkSegmentationConverterRule()

vtkSegmentationConverterRule::~vtkSegmentationConverterRule ( )
protected

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 vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkBinaryLabelmapToClosedSurfaceConversionRule, 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 vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ Convert()

virtual bool vtkSegmentationConverterRule::Convert ( vtkDataObject *  sourceRepresentation,
vtkDataObject *  targetRepresentation 
)
pure virtual

◆ 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 vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

◆ GetClassName()

virtual const char* vtkSegmentationConverterRule::GetClassName ( )
virtual

◆ GetConversionCost()

virtual unsigned int vtkSegmentationConverterRule::GetConversionCost ( vtkDataObject *  sourceRepresentation = NULL,
vtkDataObject *  targetRepresentation = NULL 
)
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 vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.

Definition at line 90 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 60 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

◆ 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 135 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 133 of file vtkSegmentationConverterRule.h.


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