21 #ifndef __vtkSegmentationConverterRule_h 22 #define __vtkSegmentationConverterRule_h 24 #include "vtkSegmentationCoreConfigure.h" 28 #include <vtkObject.h> 37 #ifndef vtkSegmentationConverterRuleNewMacro 38 #define vtkSegmentationConverterRuleNewMacro(newClass) \ 39 vtkStandardNewMacro(newClass); \ 40 vtkSegmentationConverterRule* newClass::CreateRuleInstance() \ 42 return newClass::New(); \ 60 static unsigned int GetConversionInfiniteCost() {
return 10000000; };
65 void PrintSelf(ostream& os, vtkIndent indent)
override;
77 virtual vtkDataObject* ConstructRepresentationObjectByRepresentation(std::string representationName) = 0;
82 virtual vtkDataObject* ConstructRepresentationObjectByClass(std::string className) = 0;
101 virtual unsigned int GetConversionCost(vtkDataObject* sourceRepresentation=
nullptr, vtkDataObject* targetRepresentation=
nullptr)
103 (void)(sourceRepresentation);
104 (void)(targetRepresentation);
109 virtual const char* GetName() = 0;
112 virtual const char* GetSourceRepresentationName() = 0;
115 virtual const char* GetTargetRepresentationName() = 0;
123 virtual void SetConversionParameter(
const std::string& name,
const std::string& value,
const std::string& description=
"");
126 virtual std::string GetConversionParameter(
const std::string& name);
129 virtual std::string GetConversionParameterDescription(
const std::string& name);
132 bool HasConversionParameter(
const std::string& name);
136 virtual bool CreateTargetRepresentation(
vtkSegment* segment);
154 bool ReplaceTargetRepresentation{
false};
159 #endif // __vtkSegmentationConverterRule_h This class encapsulates a segment that is part of a segmentation.
virtual bool PostConvert(vtkSegmentation *vtkNotUsed(segmentation))
Abstract converter rule class. Subclasses perform conversions between specific representation types...
virtual unsigned int GetConversionCost(vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr)
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
virtual bool PreConvert(vtkSegmentation *vtkNotUsed(segmentation))
Store a list of conversion parameters.
vtkNew< vtkSegmentationConversionParameters > ConversionParameters
Class that can convert between different representations of a segment.