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

Method LocalStorage

Modules/Annotation/src/mitkLabelAnnotation3D.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41mitk::LabelAnnotation3D::LocalStorage::LocalStorage()
42{
43 m_Points = vtkSmartPointer<vtkPolyData>::New();
44
45 // Add label array.
46 m_Labels = vtkSmartPointer<vtkStringArray>::New();
47 m_Labels->SetNumberOfValues(0);
48 m_Labels->SetName("labels");
49
50 // Add priority array.
51 m_Sizes = vtkSmartPointer<vtkIntArray>::New();
52 m_Sizes->SetNumberOfValues(0);
53 m_Sizes->SetName("sizes");
54
55 m_Points->GetPointData()->AddArray(m_Sizes);
56 m_Points->GetPointData()->AddArray(m_Labels);
57
58 m_PointSetToLabelHierarchyFilter = vtkSmartPointer<vtkPointSetToLabelHierarchy>::New();
59 m_PointSetToLabelHierarchyFilter->SetInputData(m_Points);
60 m_PointSetToLabelHierarchyFilter->SetLabelArrayName("labels");
61 m_PointSetToLabelHierarchyFilter->SetPriorityArrayName("sizes");
62 m_PointSetToLabelHierarchyFilter->Update();
63
64 m_LabelMapper = vtkSmartPointer<vtkLabelPlacementMapper>::New();
65 m_LabelMapper->SetInputConnection(m_PointSetToLabelHierarchyFilter->GetOutputPort());
66
67 m_LabelsActor = vtkSmartPointer<vtkActor2D>::New();
68 m_LabelsActor->SetMapper(m_LabelMapper);
69}
70
71void mitk::LabelAnnotation3D::UpdateVtkAnnotation(mitk::BaseRenderer *renderer)
72{

Callers

nothing calls this directly

Calls 5

SetInputConnectionMethod · 0.80
SetMapperMethod · 0.80
NewFunction · 0.50
SetNameMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected