Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSegmentationLabelmapSurfaceMapper.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 The signed distance field computation (jump flooding) and the ray casting
16 are based on SlicerLive by Steve Pieper (https://github.com/pieper/SlicerLive,
17 Apache License 2.0).
18
19==============================================================================*/
20
21#ifndef __vtkSegmentationLabelmapSurfaceMapper_h
22#define __vtkSegmentationLabelmapSurfaceMapper_h
23
24#include "vtkSlicerSegmentationsModuleMRMLDisplayableManagerExport.h"
25
26// MRMLDisplayableManager includes
28
30
44class VTK_SLICER_SEGMENTATIONS_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT vtkSegmentationLabelmapSurfaceMapper : public vtkMRMLRayCastMapper
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
54
57 void SetLabelColor(int labelValue, double r, double g, double b, double opacity = 1.0);
60
67 vtkSetClampMacro(SmoothingFactor, double, 0.0, 1.0);
68 vtkGetMacro(SmoothingFactor, double);
69
78 vtkSetClampMacro(MaximumNumberOfVoxels, vtkIdType, 4096, VTK_ID_MAX);
79 vtkGetMacro(MaximumNumberOfVoxels, vtkIdType);
80
84 vtkSetMacro(CapClippedSurface, bool);
85 vtkGetMacro(CapClippedSurface, bool);
86 vtkBooleanMacro(CapClippedSurface, bool);
87
89 vtkSetClampMacro(CapOpacity, double, 0.0, 1.0);
90 vtkGetMacro(CapOpacity, double);
91
96 vtkBooleanMacro(KeepWhereAnyClippingPlaneKeeps, bool);
97
99 vtkSetMacro(ClippingOutline, bool);
100 vtkGetMacro(ClippingOutline, bool);
101 vtkBooleanMacro(ClippingOutline, bool);
102
104 vtkSetVector3Macro(OutlineColor, double);
105 vtkGetVector3Macro(OutlineColor, double);
106
108 vtkSetClampMacro(OutlineWidth, double, 0.5, 100.0);
109 vtkGetMacro(OutlineWidth, double);
110
114 vtkSetClampMacro(ImageSampleDistance, double, 1.0, 8.0);
115 vtkGetMacro(ImageSampleDistance, double);
116
119
128 bool IntersectWithRay(const double p1[3], const double p2[3], double t1, double t2, vtkMatrix4x4* toWorld, double& t, double xyz[3], double n[3]) override;
129
132 int GetShownLabelAtPosition(const double ijk[3], double maximumDistance = 1.5);
133
134 void Render(vtkRenderer* ren, vtkActor* actor) override;
135 void ReleaseGraphicsResources(vtkWindow* window) override;
136 using Superclass::GetBounds;
137 double* GetBounds() VTK_SIZEHINT(6) override;
138
139protected:
142
143 int FillInputPortInformation(int port, vtkInformation* info) override;
144
145 double SmoothingFactor{ 0.5 };
146 double ImageSampleDistance{ 1.0 };
147 bool CapClippedSurface{ true };
148 double CapOpacity{ 1.0 };
150 bool ClippingOutline{ false };
151 double OutlineColor[3]{ 0.0, 0.0, 0.0 };
152 double OutlineWidth{ 1.0 };
153 vtkIdType MaximumNumberOfVoxels{ 32 * 1024 * 1024 };
155
156private:
158 void operator=(const vtkSegmentationLabelmapSurfaceMapper&) = delete;
159
160 class vtkInternal;
161 vtkInternal* Internal;
162};
163
164#endif
vtkMRMLRayCastMapper()=default
Image data containing orientation information.
Render a labelmap as smooth surfaces, computed on the GPU.
int GetShownLabelAtPosition(const double ijk[3], double maximumDistance=1.5)
void Render(vtkRenderer *ren, vtkActor *actor) override
static vtkSegmentationLabelmapSurfaceMapper * New()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkOrientedImageData * GetLabelmap()
double * GetBounds() VTK_SIZEHINT(6) override
int FillInputPortInformation(int port, vtkInformation *info) override
void RemoveAllLabelColors()
Remove all label colors (all labels are hidden).
void ReleaseGraphicsResources(vtkWindow *window) override
void SetLabelmap(vtkOrientedImageData *labelmap)
Labelmap to render. Geometry (spacing, directions) is taken into account when computing distances.
bool IntersectWithRay(const double p1[3], const double p2[3], double t1, double t2, vtkMatrix4x4 *toWorld, double &t, double xyz[3], double n[3]) override
void SetLabelColor(int labelValue, double r, double g, double b, double opacity=1.0)