MCPcopy Create free account
hub / github.com/MITK/MITK / Extract

Method Extract

Modules/Multilabel/src/mitkMultiLabelSurfaceNetsExtractor.cpp:74–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74vtkSmartPointer<vtkPolyData> mitk::MultiLabelSurfaceNetsExtractor::Extract(
75 vtkImageData* groupImage,
76 const std::vector<LabelValueType>& labelValues)
77{
78 auto output = vtkSmartPointer<vtkPolyData>::New();
79
80 if (groupImage == nullptr || labelValues.empty())
81 {
82 return output;
83 }
84
85 PrepareInput(groupImage);
86
87 m_SurfaceNets->SetInputData(groupImage);
88 this->ConfigureLabels(labelValues);
89 m_SurfaceNets->InitializeSelectedLabelsList();
90 m_SurfaceNets->SetOutputStyleToDefault();
91 // TODO(VTK 9.5.2): force re-extraction. vtkSurfaceNets3D::RequestData reuses its
92 // cache based on Superclass::GetMTime(), which SetLabel/SetInputData do not always
93 // bump; the cached path then leaves newScalars null and TransformMeshType crashes.
94 // Drop this Modified() when VTK is upgraded past 9.5.2.
95 m_SurfaceNets->Modified();
96
97 m_NormalsFilter->Update();
98 output->DeepCopy(m_NormalsFilter->GetOutput());
99
100 return output;
101}
102
103std::map<mitk::MultiLabelSurfaceNetsExtractor::LabelValueType, vtkSmartPointer<vtkPolyData>>
104mitk::MultiLabelSurfaceNetsExtractor::ExtractPerLabel(

Calls 8

ConfigureLabelsMethod · 0.95
PrepareInputFunction · 0.85
DeepCopyMethod · 0.80
NewFunction · 0.50
emptyMethod · 0.45
ModifiedMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45