21#ifndef __vtkSegmentationConverterRule_h
22#define __vtkSegmentationConverterRule_h
24#include "vtkSegmentationCoreConfigure.h"
37#ifndef vtkSegmentationConverterRuleNewMacro
38#define vtkSegmentationConverterRuleNewMacro(newClass) \
39 vtkStandardNewMacro(newClass); \
40 vtkSegmentationConverterRule* newClass::CreateRuleInstance() \
42 return newClass::New(); \
64 void PrintSelf(ostream& os, vtkIndent indent)
override;
100 virtual unsigned int GetConversionCost(vtkDataObject* sourceRepresentation=
nullptr, vtkDataObject* targetRepresentation=
nullptr)
102 (void)(sourceRepresentation);
103 (void)(targetRepresentation);
122 virtual void SetConversionParameter(
const std::string& name,
const std::string& value,
const std::string& description=
"");
153 bool ReplaceTargetRepresentation{
false};
This class encapsulates a segment that is part of a segmentation.
Store a list of conversion parameters.
Abstract converter rule class. Subclasses perform conversions between specific representation types....
vtkNew< vtkSegmentationConversionParameters > ConversionParameters
virtual bool PreConvert(vtkSegmentation *vtkNotUsed(segmentation))
virtual unsigned int GetConversionCost(vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr)
virtual bool Convert(vtkSegment *segment)=0
static unsigned int GetConversionInfiniteCost()
virtual vtkSegmentationConverterRule * Clone()
Create a new instance of this rule and copy its contents.
bool HasConversionParameter(const std::string &name)
Determine if the rule has a parameter with a certain name.
vtkSegmentationConverterRule()
~vtkSegmentationConverterRule() override
virtual bool PostConvert(vtkSegmentation *vtkNotUsed(segmentation))
void operator=(const vtkSegmentationConverterRule &)
virtual void GetRuleConversionParameters(vtkSegmentationConversionParameters *conversionParameters) VTK_EXPECTS(conversionParameters !
virtual void SetConversionParameter(const std::string &name, const std::string &value, const std::string &description="")
Set a conversion parameter.
virtual const char * GetSourceRepresentationName()=0
Human-readable name of the source representation.
virtual const char * GetTargetRepresentationName()=0
Human-readable name of the target representation.
virtual vtkDataObject * ConstructRepresentationObjectByRepresentation(std::string representationName)=0
virtual const char * GetName()=0
Human-readable name of the converter rule.
virtual std::string GetConversionParameterDescription(const std::string &name)
Get a conversion parameter description.
virtual vtkDataObject * ConstructRepresentationObjectByClass(std::string className)=0
virtual std::string GetConversionParameter(const std::string &name)
Get a conversion parameter value.
virtual bool CreateTargetRepresentation(vtkSegment *segment)
Update the target representation based on the source representation.
virtual vtkSegmentationConverterRule * CreateRuleInstance()=0
void PrintSelf(ostream &os, vtkIndent indent) override
Class that can convert between different representations of a segment.
This class encapsulates a segmentation that can contain multiple segments and multiple representation...