Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlaneGeometryDataVtkMapper3D.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include "mitkImageVtkMapper2D.h"
21 #include "mitkNodePredicateOr.h"
23 #include "mitkSurface.h"
28 
29 #include <vtkAssembly.h>
30 #include <vtkDataSetMapper.h>
31 #include <vtkFeatureEdges.h>
32 #include <vtkHedgeHog.h>
33 #include <vtkImageData.h>
34 #include <vtkLinearTransform.h>
35 #include <vtkPolyData.h>
36 #include <vtkPolyDataMapper.h>
37 #include <vtkProp3DCollection.h>
38 #include <vtkProperty.h>
39 #include <vtkTransformPolyDataFilter.h>
40 #include <vtkTubeFilter.h>
41 
42 namespace mitk
43 {
45  {
48 
53 
54  m_Edges->BoundaryEdgesOn();
55  m_Edges->FeatureEdgesOff();
56  m_Edges->NonManifoldEdgesOff();
57  m_Edges->ManifoldEdgesOff();
58 
66 
68 
70 
71  m_Cleaner->PieceInvariantOn();
72  m_Cleaner->ConvertLinesToPointsOn();
73  m_Cleaner->ConvertPolysToLinesOn();
74  m_Cleaner->ConvertStripsToPolysOn();
75  m_Cleaner->PointMergingOn();
76 
77  // Make sure that the FeatureEdge algorithm is initialized with a "valid"
78  // (though empty) input
79  vtkPolyData *emptyPolyData = vtkPolyData::New();
80  m_Cleaner->SetInputData(emptyPolyData);
81  emptyPolyData->Delete();
82 
83  m_Edges->SetInputConnection(m_Cleaner->GetOutputPort());
84  m_EdgeTransformer->SetInputConnection(m_Edges->GetOutputPort());
85 
86  m_EdgeTuber->SetInputConnection(m_EdgeTransformer->GetOutputPort());
87  m_EdgeTuber->SetVaryRadiusToVaryRadiusOff();
88  m_EdgeTuber->SetNumberOfSides(12);
89  m_EdgeTuber->CappingOn();
90 
91  m_EdgeMapper->SetInputConnection(m_EdgeTuber->GetOutputPort());
92  m_EdgeMapper->ScalarVisibilityOff();
93 
94  m_BackgroundMapper->SetInputData(emptyPolyData);
95  m_BackgroundMapper->Update();
96 
97  m_EdgeActor->SetMapper(m_EdgeMapper);
98 
99  m_BackgroundActor->GetProperty()->SetAmbient(0.5);
100  m_BackgroundActor->GetProperty()->SetColor(0.0, 0.0, 0.0);
101  m_BackgroundActor->GetProperty()->SetOpacity(0.0);
103 
104  vtkProperty *backfaceProperty = m_BackgroundActor->MakeProperty();
105  backfaceProperty->SetColor(0.0, 0.0, 0.0);
106  m_BackgroundActor->SetBackfaceProperty(backfaceProperty);
107  backfaceProperty->Delete();
108 
111 
113  m_FrontNormalsMapper->SetInputConnection(m_FrontHedgeHog->GetOutputPort());
115 
116  m_Prop3DAssembly->AddPart(m_EdgeActor);
122 
125  }
126 
128  {
129  m_ImageAssembly->Delete();
130  m_Prop3DAssembly->Delete();
131  m_EdgeTuber->Delete();
132  m_EdgeMapper->Delete();
133  m_EdgeTransformer->Delete();
134  m_Cleaner->Delete();
135  m_Edges->Delete();
136  m_NormalsTransformer->Delete();
137  m_EdgeActor->Delete();
138  m_BackgroundMapper->Delete();
139  m_BackgroundActor->Delete();
140  m_FrontNormalsMapper->Delete();
141  m_FrontNormalsActor->Delete();
142  m_FrontHedgeHog->Delete();
143  m_BackNormalsMapper->Delete();
144  m_BackNormalsActor->Delete();
145  m_BackHedgeHog->Delete();
146 
147  for (ActorList::iterator it = m_ImageActors.begin(); it != m_ImageActors.end(); ++it)
148  it->second.m_Actor->ReleaseGraphicsResources(0);
149 
150  // Delete entries in m_ImageActors list one by one
151  m_ImageActors.clear();
152 
153  m_DataStorage = NULL;
154  }
155 
157  {
158  if ((this->GetDataNode() != NULL) && (m_ImageAssembly != NULL))
159  {
160  // Do not transform the entire Prop3D assembly, but only the image part
161  // here. The colored frame is transformed elsewhere (via m_EdgeTransformer),
162  // since only vertices should be transformed there, not the poly data
163  // itself, to avoid distortion for anisotropic datasets.
164  m_ImageAssembly->SetUserTransform(this->GetDataNode()->GetVtkTransform());
165  }
166  return m_Prop3DAssembly;
167  }
168 
170  {
171  m_ImageAssembly->SetUserTransform(this->GetDataNode()->GetVtkTransform(this->GetTimestep()));
172  }
173 
175  {
176  return static_cast<const PlaneGeometryData *>(GetDataNode()->GetData());
177  }
178 
180  {
181  if (storage != NULL && m_DataStorage != storage)
182  {
183  m_DataStorage = storage;
184  this->Modified();
185  }
186  }
187 
188  void PlaneGeometryDataVtkMapper3D::ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject & /*event*/)
189  {
190  ImageVtkMapper2D *imageMapper = dynamic_cast<ImageVtkMapper2D *>(caller);
191  if ((imageMapper != NULL))
192  {
193  if (m_ImageActors.count(imageMapper) > 0)
194  {
195  m_ImageActors[imageMapper].m_Sender = NULL; // sender is already destroying itself
196  m_ImageActors.erase(imageMapper);
197  }
198  }
199  }
200 
202  {
205 
206  // Remove all actors from the assembly, and re-initialize it with the
207  // edge actor
208  m_ImageAssembly->GetParts()->RemoveAllItems();
209 
210  bool visible = true;
211  GetDataNode()->GetVisibility(visible, renderer, "visible");
212 
213  if (!visible)
214  {
215  // visibility has explicitly to be set in the single actors
216  // due to problems when using cell picking:
217  // even if the assembly is invisible, the renderer contains
218  // references to the assemblies parts. During picking the
219  // visibility of each part is checked, and not only for the
220  // whole assembly.
221  m_ImageAssembly->VisibilityOff();
222  m_EdgeActor->VisibilityOff();
223  return;
224  }
225 
226  // visibility has explicitly to be set in the single actors
227  // due to problems when using cell picking:
228  // even if the assembly is invisible, the renderer contains
229  // references to the assemblies parts. During picking the
230  // visibility of each part is checked, and not only for the
231  // whole assembly.
232  m_ImageAssembly->VisibilityOn();
233  bool drawEdges = true;
234  this->GetDataNode()->GetBoolProperty("draw edges", drawEdges, renderer);
235  m_EdgeActor->SetVisibility(drawEdges);
236 
237  PlaneGeometryData::Pointer input = const_cast<PlaneGeometryData *>(this->GetInput());
238 
239  if (input.IsNotNull() && (input->GetPlaneGeometry() != NULL))
240  {
241  SmartPointerProperty::Pointer surfacecreatorprop;
242  surfacecreatorprop =
243  dynamic_cast<SmartPointerProperty *>(GetDataNode()->GetProperty("surfacegeometry", renderer));
244 
245  if ((surfacecreatorprop.IsNull()) || (surfacecreatorprop->GetSmartPointer().IsNull()) ||
246  ((m_SurfaceCreator =
247  dynamic_cast<PlaneGeometryDataToSurfaceFilter *>(surfacecreatorprop->GetSmartPointer().GetPointer()))
248  .IsNull()))
249  {
250  m_SurfaceCreator->PlaceByGeometryOn();
251  surfacecreatorprop = SmartPointerProperty::New(m_SurfaceCreator);
252  GetDataNode()->SetProperty("surfacegeometry", surfacecreatorprop);
253  }
254 
255  m_SurfaceCreator->SetInput(input);
256 
257  int res;
258  if (GetDataNode()->GetIntProperty("xresolution", res, renderer))
259  {
260  m_SurfaceCreator->SetXResolution(res);
261  }
262  if (GetDataNode()->GetIntProperty("yresolution", res, renderer))
263  {
264  m_SurfaceCreator->SetYResolution(res);
265  }
266 
267  double tubeRadius = 1.0; // Radius of tubular edge surrounding plane
268 
269  // Clip the PlaneGeometry with the reference geometry bounds (if available)
270  if (input->GetPlaneGeometry()->HasReferenceGeometry())
271  {
272  const BaseGeometry *referenceGeometry = input->GetPlaneGeometry()->GetReferenceGeometry();
273 
274  BoundingBox::PointType boundingBoxMin, boundingBoxMax;
275  boundingBoxMin = referenceGeometry->GetBoundingBox()->GetMinimum();
276  boundingBoxMax = referenceGeometry->GetBoundingBox()->GetMaximum();
277 
278  if (referenceGeometry->GetImageGeometry())
279  {
280  for (unsigned int i = 0; i < 3; ++i)
281  {
282  boundingBoxMin[i] -= 0.5;
283  boundingBoxMax[i] -= 0.5;
284  }
285  }
286 
287  m_SurfaceCreatorPointsContainer->CreateElementAt(0) = boundingBoxMin;
288  m_SurfaceCreatorPointsContainer->CreateElementAt(1) = boundingBoxMax;
289 
290  m_SurfaceCreatorBoundingBox->ComputeBoundingBox();
291 
293 
294  tubeRadius = referenceGeometry->GetDiagonalLength() / 450.0;
295  }
296 
297  // If no reference geometry is available, clip with the current global
298  // bounds
299  else if (m_DataStorage.IsNotNull())
300  {
301  m_SurfaceCreator->SetBoundingBox(m_DataStorage->ComputeVisibleBoundingBox(NULL, "includeInBoundingBox"));
302  tubeRadius = sqrt(m_SurfaceCreator->GetBoundingBox()->GetDiagonalLength2()) / 450.0;
303  }
304 
305  // Calculate the surface of the PlaneGeometry
306  m_SurfaceCreator->Update();
307  Surface *surface = m_SurfaceCreator->GetOutput();
308 
309  // Check if there's something to display, otherwise return
310  if ((surface->GetVtkPolyData() == 0) || (surface->GetVtkPolyData()->GetNumberOfCells() == 0))
311  {
312  m_ImageAssembly->VisibilityOff();
313  return;
314  }
315 
316  // add a graphical representation of the surface normals if requested
317  DataNode *node = this->GetDataNode();
318  bool displayNormals = false;
319  bool colorTwoSides = false;
320  bool invertNormals = false;
321  node->GetBoolProperty("draw normals 3D", displayNormals, renderer);
322  node->GetBoolProperty("color two sides", colorTwoSides, renderer);
323  node->GetBoolProperty("invert normals", invertNormals, renderer);
324 
325  // if we want to draw the display normals or render two sides we have to get the colors
326  if (displayNormals || colorTwoSides)
327  {
328  // get colors
329  float frontColor[3] = {0.0, 0.0, 1.0};
330  node->GetColor(frontColor, renderer, "front color");
331  float backColor[3] = {1.0, 0.0, 0.0};
332  node->GetColor(backColor, renderer, "back color");
333 
334  if (displayNormals)
335  {
336  m_NormalsTransformer->SetInputData(surface->GetVtkPolyData());
337  m_NormalsTransformer->SetTransform(node->GetVtkTransform(this->GetTimestep()));
338 
339  m_FrontHedgeHog->SetInputConnection(m_NormalsTransformer->GetOutputPort());
340  m_FrontHedgeHog->SetVectorModeToUseNormal();
341  m_FrontHedgeHog->SetScaleFactor(invertNormals ? 1.0 : -1.0);
342  m_FrontHedgeHog->Update();
343 
344  m_FrontNormalsActor->GetProperty()->SetColor(frontColor[0], frontColor[1], frontColor[2]);
345 
346  m_BackHedgeHog->SetInputConnection(m_NormalsTransformer->GetOutputPort());
347  m_BackHedgeHog->SetVectorModeToUseNormal();
348  m_BackHedgeHog->SetScaleFactor(invertNormals ? -1.0 : 1.0);
349  m_BackHedgeHog->Update();
350 
351  m_BackNormalsActor->GetProperty()->SetColor(backColor[0], backColor[1], backColor[2]);
352 
353  // if there is no actor added yet, add one
354  if (!m_NormalsActorAdded)
355  {
358  m_NormalsActorAdded = true;
359  }
360  }
361  // if we don't want to display normals AND there is an actor added remove the actor
362  else if (m_NormalsActorAdded)
363  {
366  m_NormalsActorAdded = false;
367  }
368 
369  if (colorTwoSides)
370  {
371  if (!invertNormals)
372  {
373  m_BackgroundActor->GetProperty()->SetColor(backColor[0], backColor[1], backColor[2]);
374  m_BackgroundActor->GetBackfaceProperty()->SetColor(frontColor[0], frontColor[1], frontColor[2]);
375  }
376  else
377  {
378  m_BackgroundActor->GetProperty()->SetColor(frontColor[0], frontColor[1], frontColor[2]);
379  m_BackgroundActor->GetBackfaceProperty()->SetColor(backColor[0], backColor[1], backColor[2]);
380  }
381  }
382  }
383 
384  // Add black background for all images (which may be transparent)
385  m_BackgroundMapper->SetInputData(surface->GetVtkPolyData());
387 
388  LayerSortedActorList layerSortedActors;
389 
390  // Traverse the data tree to find nodes resliced by ImageMapperGL2D
391  // use a predicate to get all data nodes which are "images" or inherit from mitk::Image
395  // process all found images
396  for (mitk::DataStorage::SetOfObjects::ConstIterator it = all->Begin(); it != all->End(); ++it)
397  {
398  DataNode *node = it->Value();
399  if (node != NULL)
400  this->ProcessNode(node, renderer, surface, layerSortedActors);
401  }
402 
403  // Add all image actors to the assembly, sorted according to
404  // layer property
405  LayerSortedActorList::iterator actorIt;
406  for (actorIt = layerSortedActors.begin(); actorIt != layerSortedActors.end(); ++actorIt)
407  {
408  m_ImageAssembly->AddPart(actorIt->second);
409  }
410 
411  // Configurate the tube-shaped frame: size according to the surface
412  // bounds, color as specified in the plane's properties
413  vtkPolyData *surfacePolyData = surface->GetVtkPolyData();
414  m_Cleaner->SetInputData(surfacePolyData);
415  m_EdgeTransformer->SetTransform(this->GetDataNode()->GetVtkTransform(this->GetTimestep()));
416 
417  // Adjust the radius according to extent
418  m_EdgeTuber->SetRadius(tubeRadius);
419 
420  // Get the plane's color and set the tube properties accordingly
421  ColorProperty::Pointer colorProperty;
422  colorProperty = dynamic_cast<ColorProperty *>(this->GetDataNode()->GetProperty("color"));
423  if (colorProperty.IsNotNull())
424  {
425  const Color &color = colorProperty->GetColor();
426  m_EdgeActor->GetProperty()->SetColor(color.GetRed(), color.GetGreen(), color.GetBlue());
427  }
428  else
429  {
430  m_EdgeActor->GetProperty()->SetColor(1.0, 1.0, 1.0);
431  }
432 
433  m_ImageAssembly->SetUserTransform(this->GetDataNode()->GetVtkTransform(this->GetTimestep()));
434  }
435 
436  VtkRepresentationProperty *representationProperty;
437  this->GetDataNode()->GetProperty(representationProperty, "material.representation", renderer);
438  if (representationProperty != NULL)
439  m_BackgroundActor->GetProperty()->SetRepresentation(representationProperty->GetVtkRepresentation());
440  }
441 
443  BaseRenderer *renderer,
444  Surface *surface,
445  LayerSortedActorList &layerSortedActors)
446  {
447  if (node != NULL)
448  {
449  // we need to get the information from the 2D mapper to render the texture on the 3D plane
450  ImageVtkMapper2D *imageMapper =
451  dynamic_cast<ImageVtkMapper2D *>(node->GetMapper(1)); // GetMapper(1) provides the 2D mapper for the data node
452 
453  // if there is a 2D mapper, which is not the standard image mapper...
454  if (!imageMapper && node->GetMapper(1))
455  { //... check if it is the composite mapper
456  std::string cname(node->GetMapper(1)->GetNameOfClass());
457  if (!cname.compare("CompositeMapper")) // string.compare returns 0 if the two strings are equal.
458  {
459  // get the standard image mapper.
460  // This is a special case in MITK and does only work for the CompositeMapper.
461  imageMapper = dynamic_cast<ImageVtkMapper2D *>(node->GetMapper(3));
462  }
463  }
464 
465  if ((node->IsVisible(renderer)) && imageMapper)
466  {
467  WeakPointerProperty::Pointer rendererProp =
468  dynamic_cast<WeakPointerProperty *>(GetDataNode()->GetPropertyList()->GetProperty("renderer"));
469 
470  if (rendererProp.IsNotNull())
471  {
472  BaseRenderer::Pointer planeRenderer =
473  dynamic_cast<BaseRenderer *>(rendererProp->GetWeakPointer().GetPointer());
474  // Retrieve and update image to be mapped
475  const ImageVtkMapper2D::LocalStorage *localStorage = imageMapper->GetLocalStorage(planeRenderer);
476 
477  if (planeRenderer.IsNotNull())
478  {
479  // perform update of imagemapper if needed (maybe the respective 2D renderwindow is not rendered/update
480  // before)
481  imageMapper->Update(planeRenderer);
482 
483  // If it has not been initialized already in a previous pass,
484  // generate an actor and a texture object to
485  // render the image associated with the ImageVtkMapper2D.
486  vtkActor *imageActor;
487  vtkDataSetMapper *dataSetMapper = NULL;
488  vtkTexture *texture;
489  if (m_ImageActors.count(imageMapper) == 0)
490  {
491  dataSetMapper = vtkDataSetMapper::New();
492  // Enable rendering without copying the image.
493  dataSetMapper->ImmediateModeRenderingOn();
494 
496  texture->RepeatOff();
497 
498  imageActor = vtkActor::New();
499  imageActor->SetMapper(dataSetMapper);
500  imageActor->SetTexture(texture);
501  imageActor->GetProperty()->SetOpacity(
502  0.999); // HACK! otherwise VTK wouldn't recognize this as translucent
503  // surface (if LUT values map to alpha < 255
504  // improvement: apply "opacity" property onle HERE and also in 2D image mapper. DO NOT change LUT to
505  // achieve
506  // translucent images (see method ChangeOpacity in image mapper 2D)
507 
508  // Make imageActor the sole owner of the mapper and texture
509  // objects
510  dataSetMapper->UnRegister(NULL);
511  texture->UnRegister(NULL);
512 
513  // Store the actor so that it may be accessed in following
514  // passes.
515  m_ImageActors[imageMapper].Initialize(imageActor, imageMapper, m_ImageMapperDeletedCommand);
516  }
517  else
518  {
519  // Else, retrieve the actor and associated objects from the
520  // previous pass.
521  imageActor = m_ImageActors[imageMapper].m_Actor;
522  dataSetMapper = (vtkDataSetMapper *)imageActor->GetMapper();
523  texture = imageActor->GetTexture();
524  }
525 
526  // Set poly data new each time its object changes (e.g. when
527  // switching between planar and curved geometries)
528  if ((dataSetMapper != NULL) && (dataSetMapper->GetInput() != surface->GetVtkPolyData()))
529  {
530  dataSetMapper->SetInputData(surface->GetVtkPolyData());
531  }
532 
533  dataSetMapper->Update();
534 
535  // Check if the m_ReslicedImage is NULL.
536  // This is the case when no image geometry is met by
537  // the reslicer. In that case, the texture has to be
538  // empty (black) and we don't have to do anything.
539  // See fixed bug #13275
540  if (localStorage->m_ReslicedImage != NULL)
541  {
542  texture->SetInputConnection(localStorage->m_LevelWindowFilter->GetOutputPort());
543 
544  // do not use a VTK lookup table (we do that ourselves in m_LevelWindowFilter)
545  texture->MapColorScalarsThroughLookupTableOff();
546 
547  // re-use properties from the 2D image mapper
548  imageActor->SetProperty(localStorage->m_Actor->GetProperty());
549  imageActor->GetProperty()->SetAmbient(0.5);
550 
551  // Set texture interpolation on/off
552  bool textureInterpolation = node->IsOn("texture interpolation", renderer);
553  texture->SetInterpolate(textureInterpolation);
554 
555  // Store this actor to be added to the actor assembly, sort
556  // by layer
557  int layer = 1;
558  node->GetIntProperty("layer", layer);
559  layerSortedActors.insert(std::pair<int, vtkActor *>(layer, imageActor));
560  }
561  }
562  }
563  }
564  }
565  }
566 
567  void PlaneGeometryDataVtkMapper3D::ActorInfo::Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command)
568  {
569  m_Actor = actor;
570  m_Sender = sender;
571  // Get informed when ImageMapper object is deleted, so that
572  // the data structures built here can be deleted as well
573  m_ObserverID = sender->AddObserver(itk::DeleteEvent(), command);
574  }
575 
576  PlaneGeometryDataVtkMapper3D::ActorInfo::ActorInfo() : m_Actor(NULL), m_Sender(NULL), m_ObserverID(0) {}
578  {
579  if (m_Sender != NULL)
580  {
581  m_Sender->RemoveObserver(m_ObserverID);
582  }
583  if (m_Actor != NULL)
584  {
585  m_Actor->ReleaseGraphicsResources(0);
586  m_Actor->Delete();
587  }
588  }
589 } // namespace mitk
vtkActor * m_FrontNormalsActor
Actor to hold the normals arrows.
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:32
mitk::Point3D PointType
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
mitk::BaseProperty * GetProperty(const std::string &propertyKey) const
Get a property by its name.
Data management class that handles 'was created by' relations.
PlaneGeometryDataToSurfaceFilter::Pointer m_SurfaceCreator
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
The DataStorage defines which part of the data tree is traversed for renderering. ...
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
virtual vtkPolyData * GetVtkPolyData(unsigned int t=0) const
static vtkNeverTranslucentTexture * New()
virtual void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
vtkTransformPolyDataFilter * m_NormalsTransformer
Transforms the suface before applying the glyph filter.
Organizes the rendering process.
virtual void GenerateDataForRenderer(BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
DataCollection - Class to facilitate loading/accessing structured data.
bool IsNotNull() const
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
void ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject &event)
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
Property containing a smart-pointer.
vtkPolyDataMapper * m_BackgroundMapper
Mapper for black plane background.
std::multimap< int, vtkActor * > LayerSortedActorList
Property containing a smart-pointer.
void Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command)
itk::SmartPointer< const Self > ConstPointer
int GetTimestep() const
Returns the current time step as calculated from the renderer.
Definition: mitkMapper.h:152
bool IsVisible(const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
Definition: mitkDataNode.h:453
The ColorProperty class RGB color property.
Mapper to resample and display 2D slices of a 3D image.
vtkAssembly * m_Prop3DAssembly
general PropAssembly to hold the entire scene
mitk::DataStorage::Pointer m_DataStorage
SetOfObjects::ConstPointer GetSubset(const NodePredicateBase *condition) const
returns a set of data objects that meet the given condition(s)
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
virtual const PlaneGeometryData * GetInput()
Get the PlaneGeometryData to map.
vtkPolyDataMapper * m_EdgeMapper
Mapper for the tube-shaped frame.
Data class containing PlaneGeometry objects.
vtkHedgeHog * m_FrontHedgeHog
Generates lines for surface normals.
void ProcessNode(DataNode *node, BaseRenderer *renderer, Surface *surface, LayerSortedActorList &layerSortedActors)
static void SetVtkMapperImmediateModeRendering(vtkMapper *mapper)
Re-issues all drawing commands required to describe the entire scene each time a new frame is require...
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
vtkLinearTransform * GetVtkTransform(int t=0) const
Get the transformation applied prior to displaying the data as a vtkTransform.
vtkAssembly * m_ImageAssembly
PropAssembly to hold the planes.
virtual void SetDataStorageForTexture(mitk::DataStorage *storage)
All images found when traversing the (sub-) tree starting at iterator which are resliced by an ImageV...
vtkFeatureEdges * m_Edges
Edge extractor for tube-shaped frame.
mitk::Mapper * GetMapper(MapperSlotId id) const
BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer
vtkTubeFilter * m_EdgeTuber
Source to create the tube-shaped frame.
bool IsOn(const char *propertyKey, const mitk::BaseRenderer *renderer, bool defaultIsOn=true) const
Convenience access method for boolean properties (instances of BoolProperty). Return value is the val...
Definition: mitkDataNode.h:434
vtkTransformPolyDataFilter * m_EdgeTransformer
Filter to apply object transform to the extracted edges.
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
double GetDiagonalLength() const
Get the length of the diagonal of the bounding-box in mm.
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
virtual void UpdateVtkTransform(mitk::BaseRenderer *renderer) override
Set the vtkTransform of the m_Prop3D for the current time step of renderer.
virtual DataNode * GetDataNode() const
Get the DataNode containing the data to map. Method only returns valid DataNode Pointer if the mapper...
Definition: mitkMapper.cpp:36
bool GetVisibility(bool &visible, const mitk::BaseRenderer *renderer, const char *propertyKey="visible") const
Convenience access method for visibility properties (instances of BoolProperty with property-key "vis...
Definition: mitkDataNode.h:413
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
vtkActor * m_BackgroundActor
Actor for black plane background.
mitk::BoundingBox::Pointer ComputeVisibleBoundingBox(const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
Compute the bounding box of all visible parts of the data tree structure, for general rendering or re...
virtual bool GetImageGeometry() const
Is this an ImageGeometry?
BaseGeometry Describes the geometry of a data object.
vtkPolyDataMapper * m_FrontNormalsMapper
Mapper for normals representation (thin lines)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
vtkActor * m_EdgeActor
Actor for the tube-shaped frame.
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
virtual const BoundingBoxType * GetBoundingBox()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.