Medical Imaging Interaction Toolkit  2024.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkMultiLabelSegmentationVtkMapper3D.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMultiLabelSegmentationVtkMapper3D_h
14 #define mitkMultiLabelSegmentationVtkMapper3D_h
15 
16 // MITK
17 #include "MitkMultilabelExports.h"
18 #include "mitkCommon.h"
19 
20 // MITK Rendering
21 #include "mitkBaseRenderer.h"
22 #include "mitkExtractSliceFilter.h"
23 #include "mitkLabelSetImage.h"
24 #include "mitkVtkMapper.h"
25 
26 // VTK
27 #include <vtkSmartPointer.h>
28 
29 class vtkPolyDataMapper;
30 class vtkImageData;
31 class vtkLookupTable;
32 class vtkVolumeProperty;
33 class vtkVolume;
34 class vtkSmartVolumeMapper;
35 
36 namespace mitk
37 {
38 
54  {
55  public:
58 
60  itkNewMacro(Self);
61 
64  void Update(mitk::BaseRenderer *renderer) override;
65 
66  //### methods of MITK-VTK rendering pipeline
67  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
68  //### end of methods of MITK-VTK rendering pipeline
69 
78  {
79  public:
81 
82  std::vector<vtkSmartPointer<vtkSmartVolumeMapper>> m_LayerVolumeMappers;
83  std::vector<vtkSmartPointer<vtkImageData>> m_LayerImages;
84  std::vector<vtkSmartPointer<vtkVolume>> m_LayerVolumes;
85 
86  std::vector <vtkSmartPointer<vtkColorTransferFunction> > m_TransferFunctions;
87  std::vector <vtkSmartPointer<vtkPiecewiseFunction> > m_OpacityTransferFunctions;
88 
93  std::vector<const Image*> m_GroupImageIDs;
94 
96  itk::TimeStamp m_LastDataUpdateTime;
98  itk::TimeStamp m_LastPropertyUpdateTime;
99 
102 
103  unsigned int m_NumberOfGroups;
104 
106  LocalStorage();
108  ~LocalStorage() override;
109  };
110 
113 
115  LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
116 
118  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
119 
120  protected:
125 
138  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
139 
140  bool GenerateVolumeMapping(mitk::BaseRenderer* renderer, const std::vector<mitk::LabelSetImage::GroupIndexType>& outdatedGroupIDs);
141 
144  void GenerateLookupTable(mitk::BaseRenderer* renderer);
145  };
146 
147 } // namespace mitk
148 
149 #endif
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LayerImages
std::vector< vtkSmartPointer< vtkImageData > > m_LayerImages
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:83
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LastDataUpdateTime
itk::TimeStamp m_LastDataUpdateTime
Timestamp of last update of stored data.
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:96
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_NumberOfGroups
unsigned int m_NumberOfGroups
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:103
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LabelLookupTable
mitk::LookupTable::Pointer m_LabelLookupTable
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:101
vtkSmartPointer< vtkPropAssembly >
itk::SmartPointer< Self >
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_OpacityTransferFunctions
std::vector< vtkSmartPointer< vtkPiecewiseFunction > > m_OpacityTransferFunctions
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:87
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::LocalStorageHandler< LocalStorage >
mitk::MultiLabelSegmentationVtkMapper3D::m_LSH
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:112
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LastPropertyUpdateTime
itk::TimeStamp m_LastPropertyUpdateTime
Timestamp of last update of a property.
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:98
mitk::Mapper::BaseLocalStorage
Base class for mapper specific rendering resources.
Definition: mitkMapper.h:190
mitkCommon.h
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_GroupImageIDs
std::vector< const Image * > m_GroupImageIDs
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:93
mitkVtkMapper.h
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LayerVolumes
std::vector< vtkSmartPointer< vtkVolume > > m_LayerVolumes
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:84
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkExtractSliceFilter.h
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_Actors
vtkSmartPointer< vtkPropAssembly > m_Actors
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:80
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:77
mitk::MultiLabelSegmentationVtkMapper3D
Mapper to resample and display 2D slices of a 3D labelset image.
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:53
mitkBaseRenderer.h
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_LayerVolumeMappers
std::vector< vtkSmartPointer< vtkSmartVolumeMapper > > m_LayerVolumeMappers
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:82
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.
mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage::m_TransferFunctions
std::vector< vtkSmartPointer< vtkColorTransferFunction > > m_TransferFunctions
Definition: mitkMultiLabelSegmentationVtkMapper3D.h:86
MitkMultilabelExports.h
mitkLabelSetImage.h