21 #ifndef __vtkSegmentationConverter_h 22 #define __vtkSegmentationConverter_h 25 #include <vtkObject.h> 26 #include <vtkSmartPointer.h> 35 #include "vtkSegmentationCoreConfigure.h" 39 class vtkAbstractTransform;
81 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
87 void GetAvailableRepresentationNames(std::set<std::string>& representationNames);
90 void GetPossibleConversions(
const std::string& sourceRepresentationName,
const std::string& targetRepresentationName,
ConversionPathAndCostListType &pathsCosts);
102 void SetConversionParameter(
const std::string& name,
const std::string& value,
const std::string& description=
"");
106 std::string GetConversionParameter(
const std::string& name);
110 std::string GetConversionParameterDescription(
const std::string& description);
114 std::string SerializeAllConversionParameters();
118 void DeserializeConversionParameters(std::string conversionParametersString);
123 void ApplyTransformOnReferenceImageGeometry(vtkAbstractTransform* transform);
134 static std::string SerializeImageGeometry(vtkMatrix4x4* geometryMatrix, vtkImageData* imageData);
137 static std::string SerializeImageGeometry(vtkMatrix4x4* geometryMatrix,
int extent[6]);
146 static bool DeserializeImageGeometry(std::string geometryString,
vtkOrientedImageData* orientedImageData,
bool allocateScalars=
true,
int scalarType=VTK_VOID,
int numberOfScalarsComponents=-1);
153 static bool DeserializeImageGeometry(std::string geometryString, vtkMatrix4x4* geometryMatrix,
int extent[6]);
157 void RebuildRulesGraph();
168 void FindPath(
const std::string& sourceRepresentationName,
const std::string& targetRepresentationName,
ConversionPathAndCostListType &pathsCosts, std::set<std::string>& skipRepresentations);
190 #endif // __vtkSegmentationConverter_h This class encapsulates a segment that is part of a segmentation.
static const char * GetThresholdValueFieldName()
static const char * GetInterpolationTypeFieldName()
static const std::string GetReferenceImageGeometryParameterName()
static const char * GetSegmentationBinaryLabelmapRepresentationName()
std::vector< ConversionPathAndCostType > ConversionPathAndCostListType
std::map< std::string, RulesListType > RepresentationToRepresentationToRuleMapType
For each "from" representation (first) stores an array of rules (second)
static const char * GetClosedSurfaceRepresentationName()
std::vector< vtkSmartPointer< vtkSegmentationConverterRule > > ConverterRulesListType
Image data containing orientation information.
std::vector< vtkSegmentationConverterRule * > RulesListType
For each "to" representation (first) stores a rule (second)
static const char * GetBinaryLabelmapRepresentationName()
static const char * GetSegmentationClosedSurfaceRepresentationName()
RepresentationToRepresentationToRuleMapType RulesGraph
Source representation to target representation rule graph.
std::vector< vtkSegmentationConverterRule * > ConversionPathType
static const char * GetSegmentationFractionalLabelmapRepresentationName()
static const char * GetFractionalLabelmapRepresentationName()
std::map< std::string, std::pair< std::string, std::string > > ConversionParameterListType
static const char * GetSegmentationPlanarContourRepresentationName()
static const char * GetPlanarContourRepresentationName()
static const char * GetScalarRangeFieldName()
Field names for 2D display parameters.
ConverterRulesListType ConverterRules
std::pair< ConversionPathType, unsigned int > ConversionPathAndCostType
Class that can convert between different representations of a segment.