42 #include <vtkCamera.h>
43 #include <vtkCellArray.h>
44 #include <vtkColorTransferFunction.h>
45 #include <vtkGeneralTransform.h>
46 #include <vtkImageChangeInformation.h>
47 #include <vtkImageData.h>
48 #include <vtkImageExtractComponents.h>
49 #include <vtkImageReslice.h>
50 #include <vtkLookupTable.h>
51 #include <vtkMatrix4x4.h>
52 #include <vtkPlaneSource.h>
53 #include <vtkPoints.h>
54 #include <vtkPolyDataMapper.h>
55 #include <vtkProperty.h>
56 #include <vtkTransform.h>
59 #include <itkRGBAPixel.h>
70 this->InvokeEvent(itk::DeleteEvent());
76 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
78 float depth = this->CalculateLayerDepth(renderer);
81 localStorage->
m_Plane->SetOrigin(planeBounds[0], planeBounds[2], depth);
85 localStorage->
m_Plane->SetPoint1(planeBounds[1], planeBounds[2], depth);
86 localStorage->
m_Plane->SetPoint2(planeBounds[0], planeBounds[3], depth);
92 double maxRange = renderer->
GetVtkRenderer()->GetActiveCamera()->GetClippingRange()[1];
95 float depth = -maxRange * 0.01;
97 GetDataNode()->GetIntProperty(
"layer", layer, renderer);
103 MITK_WARN <<
"Layer value exceeds clipping range. Set to minimum instead.";
110 return static_cast<const mitk::Image *
>(GetDataNode()->GetData());
116 return m_LSH.GetLocalStorage(renderer)->m_Actors;
121 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
123 SetVtkMapperImmediateModeRendering(localStorage->
m_Mapper);
143 if (!RenderingGeometryIntersectsImage(worldGeometry, image->
GetSlicedGeometry()))
155 localStorage->
m_Reslicer->SetWorldGeometry(worldGeometry);
156 localStorage->
m_Reslicer->SetTimeStep(this->GetTimestep());
159 localStorage->
m_Reslicer->SetResliceTransformByGeometry(
163 bool inPlaneResampleExtentByGeometry =
false;
164 datanode->
GetBoolProperty(
"in plane resample extent by geometry", inPlaneResampleExtentByGeometry, renderer);
165 localStorage->
m_Reslicer->SetInPlaneResampleExtentByGeometry(inPlaneResampleExtentByGeometry);
172 datanode->
GetProperty(resliceInterpolationProperty,
"reslice interpolation", renderer);
174 int interpolationMode = VTK_RESLICE_NEAREST;
175 if (resliceInterpolationProperty != NULL)
180 switch (interpolationMode)
182 case VTK_RESLICE_NEAREST:
185 case VTK_RESLICE_LINEAR:
188 case VTK_RESLICE_CUBIC:
200 localStorage->
m_Reslicer->SetVtkOutputRequest(
true);
203 int thickSlicesMode = 0;
204 int thickSlicesNum = 1;
213 if (dn->
GetProperty(resliceMethodEnumProperty,
"reslice.thickslices", renderer) && resliceMethodEnumProperty)
214 thickSlicesMode = resliceMethodEnumProperty->
GetValueAsId();
217 if (dn->
GetProperty(intProperty,
"reslice.thickslices.num", renderer) && intProperty)
219 thickSlicesNum = intProperty->
GetValue();
220 if (thickSlicesNum < 1)
226 MITK_WARN <<
"no associated widget plane data tree node found";
232 if (thickSlicesMode > 0)
234 double dataZSpacing = 1.0;
240 if (abstractGeometry != NULL)
244 if (planeGeometry != NULL)
255 dataZSpacing = 1.0 / normInIndex.GetNorm();
257 localStorage->
m_Reslicer->SetOutputDimensionality(3);
258 localStorage->
m_Reslicer->SetOutputSpacingZDirection(dataZSpacing);
259 localStorage->
m_Reslicer->SetOutputExtentZDirection(-thickSlicesNum, 0 + thickSlicesNum);
264 localStorage->
m_TSFilter->SetThickSliceMode(thickSlicesMode - 1);
278 localStorage->
m_Reslicer->SetOutputDimensionality(2);
279 localStorage->
m_Reslicer->SetOutputSpacingZDirection(1.0);
280 localStorage->
m_Reslicer->SetOutputExtentZDirection(0, 0);
284 localStorage->
m_Reslicer->UpdateLargestPossibleRegion();
291 double sliceBounds[6];
292 for (
auto &sliceBound : sliceBounds)
296 localStorage->
m_Reslicer->GetClippedPlaneBounds(sliceBounds);
303 double textureClippingBounds[6];
304 for (
auto &textureClippingBound : textureClippingBounds)
306 textureClippingBound = 0.0;
313 textureClippingBounds[0] =
static_cast<int>(textureClippingBounds[0] / localStorage->
m_mmPerPixel[0] + 0.5);
314 textureClippingBounds[1] =
static_cast<int>(textureClippingBounds[1] / localStorage->
m_mmPerPixel[0] + 0.5);
315 textureClippingBounds[2] =
static_cast<int>(textureClippingBounds[2] / localStorage->
m_mmPerPixel[1] + 0.5);
316 textureClippingBounds[3] =
static_cast<int>(textureClippingBounds[3] / localStorage->
m_mmPerPixel[1] + 0.5);
323 int numberOfComponents = localStorage->
m_ReslicedImage->GetNumberOfScalarComponents();
326 bool binaryOutline =
false;
334 itk::ImageIOBase::IOComponentType componentType =
static_cast<itk::ImageIOBase::IOComponentType
>(image->
GetPixelType().
GetComponentType());
335 switch (componentType)
337 case itk::ImageIOBase::UCHAR:
339 localStorage->
m_OutlinePolyData = CreateOutlinePolyData<unsigned char>(renderer);
341 case itk::ImageIOBase::USHORT:
343 localStorage->
m_OutlinePolyData = CreateOutlinePolyData<unsigned short>(renderer);
346 binaryOutline =
false;
347 this->ApplyLookuptable(renderer);
348 MITK_WARN <<
"Type of all binary images should be unsigned char or unsigned short. Outline does not work on other pixel types!";
352 float binaryOutlineWidth = 1.0;
353 if (datanode->
GetFloatProperty(
"outline width", binaryOutlineWidth, renderer))
355 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
357 float binaryOutlineShadowWidth = 1.5;
358 datanode->
GetFloatProperty(
"outline shadow width", binaryOutlineShadowWidth, renderer);
360 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
362 ->SetLineWidth(binaryOutlineWidth * binaryOutlineShadowWidth);
364 localStorage->
m_Actor->GetProperty()->SetLineWidth(binaryOutlineWidth);
370 if (numberOfComponents != 1)
372 MITK_ERROR <<
"Rendering Error: Binary Images with more then 1 component are not supported!";
377 this->ApplyOpacity(renderer);
378 this->ApplyRenderingMode(renderer);
381 localStorage->
m_Texture->MapColorScalarsThroughLookupTableOff();
383 int displayedComponent = 0;
385 if (datanode->
GetIntProperty(
"Image.Displayed Component", displayedComponent, renderer) && numberOfComponents > 1)
399 bool textureInterpolation =
false;
400 GetDataNode()->GetBoolProperty(
"texture interpolation", textureInterpolation, renderer);
403 localStorage->
m_Texture->SetInterpolate(textureInterpolation);
408 this->TransformActor(renderer);
410 vtkActor *contourShadowActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
412 if (binary && binaryOutline)
416 localStorage->
m_Actor->SetTexture(
nullptr);
418 bool binaryOutlineShadow =
false;
419 datanode->
GetBoolProperty(
"outline binary shadow", binaryOutlineShadow, renderer);
420 if (binaryOutlineShadow)
422 contourShadowActor->SetVisibility(
true);
426 contourShadowActor->SetVisibility(
false);
432 this->GeneratePlane(renderer, sliceBounds);
434 localStorage->
m_Mapper->SetInputConnection(localStorage->
m_Plane->GetOutputPort());
438 contourShadowActor->SetVisibility(
false);
447 LocalStorage *localStorage = this->GetLocalStorage(renderer);
450 this->GetDataNode()->GetLevelWindow(levelWindow, renderer,
"levelwindow");
455 if (this->GetDataNode()->GetLevelWindow(opacLevelWindow, renderer,
"opaclevelwindow"))
471 LocalStorage *localStorage = this->GetLocalStorage(renderer);
473 float rgb[3] = {1.0f, 1.0f, 1.0f};
478 bool selected =
false;
480 GetDataNode()->GetBoolProperty(
"binaryimage.ishovering", hover, renderer);
481 GetDataNode()->GetBoolProperty(
"selected", selected, renderer);
482 GetDataNode()->GetBoolProperty(
"binary", binary, renderer);
483 if (binary && hover && !selected)
486 dynamic_cast<mitk::ColorProperty *
>(GetDataNode()->GetProperty(
"binaryimage.hoveringcolor", renderer));
487 if (colorprop.IsNotNull())
489 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
493 GetDataNode()->GetColor(rgb, renderer,
"color");
496 if (binary && selected)
499 dynamic_cast<mitk::ColorProperty *
>(GetDataNode()->GetProperty(
"binaryimage.selectedcolor", renderer));
500 if (colorprop.IsNotNull())
502 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
506 GetDataNode()->GetColor(rgb, renderer,
"color");
509 if (!binary || (!hover && !selected))
511 GetDataNode()->GetColor(rgb, renderer,
"color");
514 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
515 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
516 localStorage->
m_Actor->GetProperty()->SetColor(rgbConv);
518 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
520 float rgb[3] = {1.0f, 1.0f, 1.0f};
522 dynamic_cast<mitk::ColorProperty *
>(GetDataNode()->GetProperty(
"outline binary shadow color", renderer));
523 if (colorprop.IsNotNull())
525 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
527 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
528 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
534 LocalStorage *localStorage = this->GetLocalStorage(renderer);
535 float opacity = 1.0f;
537 GetDataNode()->GetOpacity(opacity, renderer,
"opacity");
539 localStorage->
m_Actor->GetProperty()->SetOpacity(opacity);
540 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
542 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
544 ->SetOpacity(opacity);
550 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
553 this->GetDataNode()->GetBoolProperty(
"binary", binary, renderer);
566 if (mode.IsNotNull())
568 renderingMode = mode->GetRenderingMode();
570 switch (renderingMode)
573 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_LookupTable_Color";
574 this->ApplyLookuptable(renderer);
575 this->ApplyLevelWindow(renderer);
578 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_ColorTransferFunction_Color";
579 this->ApplyColorTransferFunction(renderer);
580 this->ApplyLevelWindow(renderer);
583 MITK_DEBUG <<
"'Image Rendering.Mode' = LookupTable_Color";
584 this->ApplyLookuptable(renderer);
587 MITK_DEBUG <<
"'Image Rendering.Mode' = ColorTransferFunction_Color";
588 this->ApplyColorTransferFunction(renderer);
591 MITK_ERROR <<
"No valid 'Image Rendering.Mode' set. Using LOOKUPTABLE_LEVELWINDOW_COLOR instead.";
592 this->ApplyLookuptable(renderer);
593 this->ApplyLevelWindow(renderer);
598 this->ApplyColor(renderer);
603 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
610 if (lookupTableProp.IsNotNull())
612 usedLookupTable = lookupTableProp->GetLookupTable()->GetVtkLookupTable();
627 this->GetDataNode()->GetProperty(
"Image Rendering.Transfer Function", renderer));
629 if (transferFunctionProp.IsNull())
631 MITK_ERROR <<
"'Image Rendering.Mode'' was set to use a color transfer function but there is no property 'Image "
632 "Rendering.Transfer Function'. Nothing will be done.";
635 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
637 localStorage->
m_LevelWindowFilter->SetLookupTable(transferFunctionProp->GetValue()->GetColorTransferFunction());
639 transferFunctionProp->GetValue()->GetScalarOpacityFunction());
645 GetDataNode()->GetVisibility(visible, renderer,
"visible");
659 this->CalculateTimeStep(renderer);
663 if ((dataTimeGeometry == NULL) || (dataTimeGeometry->CountTimeSteps() == 0) ||
669 const DataNode *node = this->GetDataNode();
671 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
686 this->GenerateDataForRenderer(renderer);
705 if (image->IsRotated())
714 node->
AddProperty(
"Image Rendering.Mode", renderingModeProperty);
720 mitkLutProp->SetLookupTable(mitkLut);
723 std::string photometricInterpretation;
724 if (node->
GetStringProperty(
"dicom.pixel.PhotometricInterpretation", photometricInterpretation))
727 if (photometricInterpretation.find(
"MONOCHROME1") != std::string::npos)
731 mitkLutProp->SetLookupTable(mitkLut);
738 bool isBinaryImage(
false);
739 if (!node->
GetBoolProperty(
"binary", isBinaryImage) && image->GetPixelType().GetNumberOfComponents() == 1)
750 sliceSelector->SetInput(image);
751 sliceSelector->SetSliceNr(image->GetDimension(2) / 2);
752 sliceSelector->SetTimeNr(image->GetDimension(3) / 2);
753 sliceSelector->SetChannelNr(image->GetDimension(4) / 2);
754 sliceSelector->Update();
755 centralSliceImage = sliceSelector->GetOutput();
756 if (centralSliceImage.IsNotNull() && centralSliceImage->IsInitialized())
758 minValue = centralSliceImage->GetStatistics()->GetScalarValueMin();
759 maxValue = centralSliceImage->GetStatistics()->GetScalarValueMax();
760 min2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMin();
761 max2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMax();
763 if ((maxValue == min2ndValue && minValue == max2ndValue) || minValue == maxValue)
766 minValue = image->GetStatistics()->GetScalarValueMin();
767 maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
768 min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
769 max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
771 isBinaryImage = (maxValue == min2ndValue && minValue == max2ndValue);
774 std::string className = image->GetNameOfClass();
775 if (className !=
"TensorImage" && className !=
"QBallImage")
777 PixelType pixelType = image->GetPixelType();
780 if ((pixelType.
GetPixelType() == itk::ImageIOBase::VECTOR && numComponents > 1) || numComponents == 2 ||
807 if (image.IsNotNull() && image->IsInitialized())
809 if ((overwrite) || (node->
GetProperty(
"levelwindow", renderer) == NULL))
812 std::string sLevel =
"";
813 std::string sWindow =
"";
816 0x0028, 0x1050,
"dicom.voilut.WindowCenter", image->GetPropertyList(), sLevel) &&
818 0x0028, 0x1051,
"dicom.voilut.WindowWidth", image->GetPropertyList(), sWindow))
820 float level = atof(sLevel.c_str());
821 float window = atof(sWindow.c_str());
824 std::string sSmallestPixelValueInSeries;
825 std::string sLargestPixelValueInSeries;
829 "dicom.series.SmallestPixelValueInSeries",
830 image->GetPropertyList(),
831 sSmallestPixelValueInSeries) &&
834 "dicom.series.LargestPixelValueInSeries",
835 image->GetPropertyList(),
836 sLargestPixelValueInSeries))
838 float smallestPixelValueInSeries = atof(sSmallestPixelValueInSeries.c_str());
839 float largestPixelValueInSeries = atof(sLargestPixelValueInSeries.c_str());
841 largestPixelValueInSeries + 1);
846 contrast.SetAuto(static_cast<mitk::Image *>(node->
GetData()),
false,
true);
849 contrast.SetLevelWindow(level, window,
true);
853 if (((overwrite) || (node->
GetProperty(
"opaclevelwindow", renderer) == NULL)) &&
854 (image->GetPixelType().GetPixelType() == itk::ImageIOBase::RGBA) &&
855 (image->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR))
861 node->
SetProperty(
"opaclevelwindow", prop, renderer);
864 Superclass::SetDefaultProperties(node, renderer, overwrite);
869 return m_LSH.GetLocalStorage(renderer);
872 template <
typename TPixel>
875 LocalStorage *localStorage = this->GetLocalStorage(renderer);
879 int xMin = extent[0];
880 int xMax = extent[1];
881 int yMin = extent[2];
882 int yMax = extent[3];
890 float depth = CalculateLayerDepth(renderer);
896 TPixel* currentPixel =
static_cast<TPixel*
>(localStorage->
m_ReslicedImage->GetScalarPointer());
901 if ((currentPixel) && (*currentPixel != 0))
908 if (y > yMin && *(currentPixel - line) == 0)
916 lines->InsertNextCell(2);
917 lines->InsertCellPoint(p1);
918 lines->InsertCellPoint(p2);
922 if (y < yMax && *(currentPixel + line) == 0)
926 vtkIdType p2 = points->InsertNextPoint(
928 lines->InsertNextCell(2);
929 lines->InsertCellPoint(p1);
930 lines->InsertCellPoint(p2);
934 if ((x > xMin || y > yMin) && *(currentPixel - 1) == 0)
940 lines->InsertNextCell(2);
941 lines->InsertCellPoint(p1);
942 lines->InsertCellPoint(p2);
946 if ((y < yMax || (x < xMax)) && *(currentPixel + 1) == 0)
950 vtkIdType p2 = points->InsertNextPoint(
952 lines->InsertNextCell(2);
953 lines->InsertCellPoint(p1);
954 lines->InsertCellPoint(p2);
966 lines->InsertNextCell(2);
967 lines->InsertCellPoint(p1);
968 lines->InsertCellPoint(p2);
976 vtkIdType p2 = points->InsertNextPoint(
978 lines->InsertNextCell(2);
979 lines->InsertCellPoint(p1);
980 lines->InsertCellPoint(p2);
990 lines->InsertNextCell(2);
991 lines->InsertCellPoint(p1);
992 lines->InsertCellPoint(p2);
1000 vtkIdType p2 = points->InsertNextPoint(
1002 lines->InsertNextCell(2);
1003 lines->InsertCellPoint(p1);
1004 lines->InsertCellPoint(p2);
1025 polyData->SetPoints(points);
1027 polyData->SetLines(lines);
1033 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
1036 vtkSmartPointer<vtkMatrix4x4> matrix = localStorage->
m_Reslicer->GetResliceAxes();
1037 trans->SetMatrix(matrix);
1039 localStorage->
m_Actor->SetUserTransform(trans);
1043 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
1045 vtkActor *secondaryActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
1046 secondaryActor->SetUserTransform(trans);
1056 if (renderingGeometry == NULL || imageGeometry == NULL)
1061 for (
int i = 1; i < 8; i++)
1069 if (initialDistance * distance < 0)
1085 : m_VectorComponentExtractor(vtkSmartPointer<vtkImageExtractComponents>::
New())
1126 outlineShadowActor->SetMapper(
m_Mapper);
1128 m_Actors->AddPart(outlineShadowActor);
void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary=true)
virtual int GetInterpolation()
float CalculateLayerDepth(mitk::BaseRenderer *renderer)
This method uses the vtkCamera clipping range and the layer property to calcualte the depth of the ob...
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=NULL, bool overwrite=false)
Set the default properties for general image rendering.
The TransferFunctionProperty class Property class for the mitk::TransferFunction. ...
virtual DataNode * GetCurrentWorldPlaneGeometryNode()
Get a DataNode pointing to a data object containing the current 2D-worldgeometry. ...
ScalarType GetLowerWindowBound() const
void ApplyRenderingMode(mitk::BaseRenderer *renderer)
This method switches between different rendering modes (e.g. use a lookup table or a transfer functio...
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the map or the last change of one of the properties store in ...
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
void ApplyLookuptable(mitk::BaseRenderer *renderer)
This method applies (or modifies) the lookuptable for all types of images.
~LocalStorage()
Default deconstructor of the local storage.
void ApplyOpacity(mitk::BaseRenderer *renderer)
Set the opacity of the actor.
virtual bool IsValid() const
Is this BaseGeometry in a state that is valid?
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
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)
static bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds)
Calculate the bounding box of the resliced image. This is necessary for arbitrarily rotated planes in...
Organizes the rendering process.
virtual ScalarType SignedDistance(const Point3D &pt3d_mm) const
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.
bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry)
Calculates whether the given rendering geometry intersects the given SlicedGeometry3D.
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
itk::ImageIOBase::IOPixelType GetPixelType() const
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...
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer)
This method applies a color transfer function. Internally, a vtkColorTransferFunction is used...
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
Vector3D GetNormal() const
Normal of the plane.
vtkSmartPointer< vtkPropAssembly > m_Actors
bool GetStringProperty(const char *propertyKey, std::string &string, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for string properties (instances of StringProperty)
void SetRangeMinMax(ScalarType min, ScalarType max)
The LevelWindow class Class to store level/window values.
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containg all lines/points needed for outlining the contour. This container is used to...
The ColorProperty class RGB color property.
void AddProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with ...
The LookupTableProperty class Property to associate mitk::LookupTable to an mitk::DataNode.
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Does the actual resampling, without rendering the image yet. All the data is generated inside this me...
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
const mitk::Image * GetInput(void)
Get the Image to map.
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Image class for storing images.
virtual ~ImageVtkMapper2D()
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
void ApplyLevelWindow(mitk::BaseRenderer *renderer)
ApplyLevelWindow Apply the level window for the given renderer.
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
void ApplyColor(mitk::BaseRenderer *renderer)
Set the color of the image/polydata.
int GetComponentType() const
Get the component type (the scalar (!) type). Each element may contain m_NumberOfComponents (more tha...
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
Point3D GetCornerPoint(int id) const
Get the position of the corner number id (in world coordinates)
Describes the geometry of a data object consisting of slices.
void TransformActor(mitk::BaseRenderer *renderer)
Transforms the actor to the actual position in 3D.
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
bool HasReferenceGeometry() const
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
virtual bool IsInitialized() const
Check whether the data has been initialized, i.e., at least the Geometry and other header data has be...
vtkSmartPointer< vtkPolyData > CreateOutlinePolyData(mitk::BaseRenderer *renderer)
Generates a vtkPolyData object containing the outline of a given binary slice.
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
Describes a two-dimensional, rectangular plane.
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 ...
ScalarType GetUpperWindowBound() const
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6])
Generates a plane according to the size of the resliced image in milimeters.
virtual void UpdateOutputInformation() override
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
unsigned int GetDimension() const
Get dimension of the image.
vtkRenderer * GetVtkRenderer() const
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
bool MITKCORE_EXPORT GetBackwardsCompatibleDICOMProperty(unsigned int group, unsigned int element, std::string const &backwardsCompatiblePropertyName, PropertyList const *propertyList, std::string &propertyValue)
virtual bool IsValidTimeStep(TimeStepType timeStep) const =0
Test for the given time step if a geometry is availible.
LocalStorage()
Default constructor of the local storage.
Class for nodes of the DataTree.
Class for defining the data type of pixels.
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
virtual IdType GetValueAsId() const
virtual T GetValue() const
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.