|
Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Render a labelmap as smooth surfaces, computed on the GPU. More...
#include <Modules/Loadable/Segmentations/MRMLDM/vtkSegmentationLabelmapSurfaceMapper.h>


Public Types | |
| typedef vtkMRMLRayCastMapper | Superclass |
Public Member Functions | |
| virtual void | CapClippedSurfaceOff () |
| virtual void | CapClippedSurfaceOn () |
| virtual void | ClippingOutlineOff () |
| virtual void | ClippingOutlineOn () |
| double * | GetBounds () VTK_SIZEHINT(6) override |
| virtual bool | GetCapClippedSurface () |
| virtual double | GetCapOpacity () |
| virtual const char * | GetClassName () |
| virtual bool | GetClippingOutline () |
| virtual double | GetImageSampleDistance () |
| virtual bool | GetKeepWhereAnyClippingPlaneKeeps () |
| vtkOrientedImageData * | GetLabelmap () |
| virtual vtkIdType | GetMaximumNumberOfVoxels () |
| virtual int | GetNumberOfDistanceFieldComputations () |
| Number of times the signed distance field has been computed (for testing). | |
| virtual double * | GetOutlineColor () |
| virtual void | GetOutlineColor (double &, double &, double &) |
| virtual void | GetOutlineColor (double[3]) |
| virtual double | GetOutlineWidth () |
| int | GetShownLabelAtPosition (const double ijk[3], double maximumDistance=1.5) |
| virtual double | GetSmoothingFactor () |
| 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 |
| virtual int | IsA (const char *type) |
| virtual void | KeepWhereAnyClippingPlaneKeepsOff () |
| virtual void | KeepWhereAnyClippingPlaneKeepsOn () |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| void | ReleaseGraphicsResources (vtkWindow *window) override |
| void | RemoveAllLabelColors () |
| Remove all label colors (all labels are hidden). | |
| void | Render (vtkRenderer *ren, vtkActor *actor) override |
| virtual void | SetCapClippedSurface (bool) |
| virtual void | SetCapOpacity (double) |
| Opacity of the cap surface, relative to the opacity of the segment. | |
| virtual void | SetClippingOutline (bool) |
| Show the outline of the segments on clipping planes: the curve where the planes cut the surface (disabled by default). | |
| virtual void | SetImageSampleDistance (double) |
| virtual void | SetKeepWhereAnyClippingPlaneKeeps (bool) |
| void | SetLabelColor (int labelValue, double r, double g, double b, double opacity=1.0) |
| void | SetLabelmap (vtkOrientedImageData *labelmap) |
| Labelmap to render. Geometry (spacing, directions) is taken into account when computing distances. | |
| virtual void | SetMaximumNumberOfVoxels (vtkIdType) |
| virtual void | SetOutlineColor (double, double, double) |
| Color of the clipping outline. | |
| virtual void | SetOutlineColor (double[3]) |
| virtual void | SetOutlineWidth (double) |
| Width of the clipping outline, in pixels. | |
| virtual void | SetSmoothingFactor (double) |
Public Member Functions inherited from vtkMRMLRayCastMapper | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| vtkAbstractTypeMacro (vtkMRMLRayCastMapper, vtkMapper) | |
Static Public Member Functions | |
| static int | IsTypeOf (const char *type) |
| static vtkSegmentationLabelmapSurfaceMapper * | New () |
| static vtkSegmentationLabelmapSurfaceMapper * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
| int | FillInputPortInformation (int port, vtkInformation *info) override |
| vtkSegmentationLabelmapSurfaceMapper () | |
| ~vtkSegmentationLabelmapSurfaceMapper () override | |
Protected Member Functions inherited from vtkMRMLRayCastMapper | |
| vtkMRMLRayCastMapper ()=default | |
| ~vtkMRMLRayCastMapper () override=default | |
Protected Attributes | |
| bool | CapClippedSurface { true } |
| double | CapOpacity { 1.0 } |
| bool | ClippingOutline { false } |
| double | ImageSampleDistance { 1.0 } |
| bool | KeepWhereAnyClippingPlaneKeeps { false } |
| vtkIdType | MaximumNumberOfVoxels { 32 * 1024 * 1024 } |
| int | NumberOfDistanceFieldComputations { 0 } |
| double | OutlineColor [3] { 0.0, 0.0, 0.0 } |
| double | OutlineWidth { 1.0 } |
| double | SmoothingFactor { 0.5 } |
Render a labelmap as smooth surfaces, computed on the GPU.
The mapper computes a signed distance field of the labelmap on the GPU (jump flooding algorithm, in fragment shader passes that write 3D texture slices, followed by Gaussian smoothing) and ray casts its zero level set. No polygonal mesh is generated, so the surface is updated quickly when the labelmap changes.
Labels that are not added by SetLabelColor are treated as background. Model coordinates of the mapper are the IJK coordinates of the labelmap (the actor's matrix is expected to map them to world coordinates).
Uses only OpenGL features that are available in both OpenGL 3.2 and OpenGL ES 3.0 (WebGL2), with 16-bit floating-point render targets (EXT_color_buffer_float on WebGL2).
Definition at line 44 of file vtkSegmentationLabelmapSurfaceMapper.h.
Definition at line 48 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
|
overrideprotected |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
overrideprotected |
|
override |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| vtkOrientedImageData * vtkSegmentationLabelmapSurfaceMapper::GetLabelmap | ( | ) |
|
virtual |
|
virtual |
Number of times the signed distance field has been computed (for testing).
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| int vtkSegmentationLabelmapSurfaceMapper::GetShownLabelAtPosition | ( | const double | ijk[3], |
| double | maximumDistance = 1.5 ) |
Get the label of the shown segment that is at the specified position (in IJK coordinates of the labelmap), or the nearest one within the specified distance (in voxels). Returns 0 if there is no shown segment there.
|
virtual |
|
overridevirtual |
Intersect a ray (in IJK coordinates of the labelmap, between P1 + T1 * (P2 - P1) and P1 + T2 * (P2 - P1)) with the surface of the shown segments (computed from the labelmap on the CPU, the surface follows the boundary of voxels, not smoothed). Returns true if there is an intersection, and its parametric coordinate, position and normal. The ray is clipped as the mapper clips what it renders, in all of its clipping modes (KeepWhereAnyClippingPlaneKeeps): what the clipping planes clip away is not hit, and where they cut a segment the cap is hit if it is shown (CapClippedSurface, with a CapOpacity above 0). toWorld is the matrix of the actor (IJK to world), which the clipping planes are transformed with; if it is nullptr then the clipping planes are ignored. vtkMRMLAccuratePicker picks the surface with this.
Implements vtkMRMLRayCastMapper.
|
virtual |
|
static |
|
virtual |
|
virtual |
|
static |
|
override |
|
override |
| void vtkSegmentationLabelmapSurfaceMapper::RemoveAllLabelColors | ( | ) |
Remove all label colors (all labels are hidden).
|
override |
|
static |
|
virtual |
Show the surface where clipping planes cut segments (enabled by default). Clipping planes are set by SetClippingPlanes, in world coordinates; the kept region is where all plane functions are positive (as for other VTK mappers), or where any of them is, see KeepWhereAnyClippingPlaneKeeps.
|
virtual |
Opacity of the cap surface, relative to the opacity of the segment.
|
virtual |
Show the outline of the segments on clipping planes: the curve where the planes cut the surface (disabled by default).
|
virtual |
Rays are cast for every n-th pixel across and down (1: every pixel), and the image is scaled up to the viewport, as with ImageSampleDistance of vtkGPUVolumeRayCastMapper. Larger values make rendering faster at the expense of detail, for example while the camera is moving.
|
virtual |
Keep the region where any clipping plane function is positive, instead of where all of them are (disabled by default). This is the ClipIntersection clip type of vtkMRMLClipNode (which clips away the intersection of the clipped spaces).
| void vtkSegmentationLabelmapSurfaceMapper::SetLabelColor | ( | int | labelValue, |
| double | r, | ||
| double | g, | ||
| double | b, | ||
| double | opacity = 1.0 ) |
Show the voxels that have the specified label value with the specified color and opacity. Surfaces of segments that touch each other are only shown where they touch if they are in different mappers.
| void vtkSegmentationLabelmapSurfaceMapper::SetLabelmap | ( | vtkOrientedImageData * | labelmap | ) |
Labelmap to render. Geometry (spacing, directions) is taken into account when computing distances.
|
virtual |
The labelmap is downsampled if its distance field would have more voxels than this. Larger values preserve more details, but need more GPU memory: about 11 bytes per voxel while the distance field is computed, 3 bytes per voxel after that. Each mapper instance holds its own distance field and color textures, so the memory is multiplied by the number of mappers that show the same labelmap (the segmentations displayable manager uses one mapper for the opaque segments of a segmentation and one for each distinct translucent opacity). A downsampled voxel is shown if any of its labelmap voxels is shown, which is checked in at most 4 voxels along each axis: if the downsampling factor is above 4 along an axis (labelmap larger than about 1300^3 voxels at the default limit), the block is sampled at evenly spaced voxels and small structures between them may be missed.
|
virtual |
Color of the clipping outline.
|
virtual |
|
virtual |
Width of the clipping outline, in pixels.
|
virtual |
Smoothing of the surface, between 0 (no smoothing, surface follows voxel boundaries) and 1 (strong smoothing). Same meaning as the "Smoothing factor" conversion parameter of closed surface representation. The distance field is smoothed by a Gaussian (standard deviation is 1.7 * SmoothingFactor times the largest voxel size, the same in all directions in physical space), combined with the result of applying it twice ("twicing"), so that curved surfaces do not shrink and thin structures are preserved. Gaps between segments that are narrower than the standard deviation are filled.
|
protected |
Definition at line 147 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 148 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 150 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 146 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 149 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 153 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 154 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 151 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 152 of file vtkSegmentationLabelmapSurfaceMapper.h.
|
protected |
Definition at line 145 of file vtkSegmentationLabelmapSurfaceMapper.h.