Slicer
5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
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>
Public Types | |
typedef std::map< std::string, std::pair< std::string, std::string > > | ConversionParameterListType |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkSegmentationConverterRule * | Clone () |
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 vtkSegmentationConverterRule * | CreateRuleInstance ()=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 vtkSegmentationConverterRule * | SafeDownCast (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 |
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.
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.
typedef vtkObject vtkSegmentationConverterRule::Superclass |
Definition at line 63 of file vtkSegmentationConverterRule.h.
|
protected |
|
overrideprotected |
|
virtual |
Create a new instance of this rule and copy its contents.
|
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.
|
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.
|
pure virtual |
Update the target representation based on the source representation Initializes the target representation and calls ConvertInternal
Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.
|
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.
|
protectedvirtual |
Update the target representation based on the source representation.
|
virtual |
|
inlinevirtual |
Get the cost of the conversion.
Reimplemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.
Definition at line 103 of file vtkSegmentationConverterRule.h.
|
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.
|
virtual |
Get a conversion parameter value.
|
virtual |
Get a conversion parameter description.
|
pure virtual |
Human-readable name of the converter rule.
Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.
|
virtual |
Get rule conversion parameters for aggregated path parameters. Existing values in the map are overwritten, missing name&values are added.
|
pure virtual |
Human-readable name of the source representation.
Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.
|
pure virtual |
Human-readable name of the target representation.
Implemented in vtkBinaryLabelmapToClosedSurfaceConversionRule, vtkClosedSurfaceToBinaryLabelmapConversionRule, vtkClosedSurfaceToFractionalLabelmapConversionRule, and vtkFractionalLabelmapToClosedSurfaceConversionRule.
bool vtkSegmentationConverterRule::HasConversionParameter | ( | const std::string & | name | ) |
Determine if the rule has a parameter with a certain name.
|
virtual |
|
static |
|
protected |
|
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.
|
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.
|
static |
|
virtual |
Set a conversion parameter.
|
friend |
Definition at line 157 of file vtkSegmentationConverterRule.h.
|
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.
|
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.