41 #include <vtkCamera.h> 42 #include <vtkCellData.h> 43 #include <vtkColorTransferFunction.h> 44 #include <vtkGeneralTransform.h> 45 #include <vtkImageChangeInformation.h> 46 #include <vtkImageData.h> 47 #include <vtkImageExtractComponents.h> 48 #include <vtkImageReslice.h> 49 #include <vtkLookupTable.h> 50 #include <vtkMatrix4x4.h> 51 #include <vtkPlaneSource.h> 52 #include <vtkPoints.h> 53 #include <vtkPolyDataMapper.h> 54 #include <vtkProperty.h> 55 #include <vtkTransform.h> 56 #include <vtkUnsignedCharArray.h> 59 #include <itkRGBAPixel.h> 69 this->InvokeEvent(itk::DeleteEvent());
80 localStorage->
m_Plane->SetOrigin(planeBounds[0], planeBounds[2], depth);
84 localStorage->
m_Plane->SetPoint1(planeBounds[1], planeBounds[2], depth);
85 localStorage->
m_Plane->SetPoint2(planeBounds[0], planeBounds[3], depth);
91 double maxRange = renderer->
GetVtkRenderer()->GetActiveCamera()->GetClippingRange()[1];
94 float depth = -maxRange * 0.01;
102 MITK_WARN <<
"Layer value exceeds clipping range. Set to minimum instead.";
153 localStorage->
m_Reslicer->SetWorldGeometry(worldGeometry);
157 localStorage->
m_Reslicer->SetResliceTransformByGeometry(
161 bool inPlaneResampleExtentByGeometry =
false;
162 datanode->
GetBoolProperty(
"in plane resample extent by geometry", inPlaneResampleExtentByGeometry, renderer);
163 localStorage->
m_Reslicer->SetInPlaneResampleExtentByGeometry(inPlaneResampleExtentByGeometry);
170 datanode->
GetProperty(resliceInterpolationProperty,
"reslice interpolation");
172 int interpolationMode = VTK_RESLICE_NEAREST;
173 if (resliceInterpolationProperty !=
nullptr)
178 switch (interpolationMode)
180 case VTK_RESLICE_NEAREST:
183 case VTK_RESLICE_LINEAR:
186 case VTK_RESLICE_CUBIC:
198 localStorage->
m_Reslicer->SetVtkOutputRequest(
true);
201 int thickSlicesMode = 0;
202 int thickSlicesNum = 1;
211 if (dn->
GetProperty(resliceMethodEnumProperty,
"reslice.thickslices") && resliceMethodEnumProperty)
212 thickSlicesMode = resliceMethodEnumProperty->
GetValueAsId();
215 if (dn->
GetProperty(intProperty,
"reslice.thickslices.num") && intProperty)
217 thickSlicesNum = intProperty->
GetValue();
218 if (thickSlicesNum < 1)
220 if (thickSlicesNum > 10)
226 MITK_WARN <<
"no associated widget plane data tree node found";
232 if (thickSlicesMode > 0)
234 double dataZSpacing = 1.0;
238 if (planeGeometry !=
nullptr)
246 if (abstractGeometry !=
nullptr)
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 (
int i = 0; i < 6; ++i)
294 sliceBounds[i] = 0.0;
296 localStorage->
m_Reslicer->GetClippedPlaneBounds(sliceBounds);
303 double textureClippingBounds[6];
304 for (
int i = 0; i < 6; ++i)
306 textureClippingBounds[i] = 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();
325 bool showIsoLines =
false;
326 datanode->
GetBoolProperty(
"dose.showIsoLines", showIsoLines, renderer);
333 float binaryOutlineWidth(1.0);
334 if (datanode->
GetFloatProperty(
"outline width", binaryOutlineWidth, renderer))
336 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
338 float binaryOutlineShadowWidth(1.5);
339 datanode->
GetFloatProperty(
"outline shadow width", binaryOutlineShadowWidth, renderer);
341 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
343 ->SetLineWidth(binaryOutlineWidth * binaryOutlineShadowWidth);
346 localStorage->
m_Actor->GetProperty()->SetLineWidth(binaryOutlineWidth);
360 localStorage->
m_Texture->SetColorModeToDirectScalars();
362 int displayedComponent = 0;
364 if (datanode->
GetIntProperty(
"Image.Displayed Component", displayedComponent, renderer) && numberOfComponents > 1)
378 bool textureInterpolation =
false;
382 localStorage->
m_Texture->SetInterpolate(textureInterpolation);
389 vtkActor *contourShadowActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
395 localStorage->
m_Actor->SetTexture(
nullptr);
397 bool binaryOutlineShadow(
false);
398 datanode->
GetBoolProperty(
"outline binary shadow", binaryOutlineShadow, renderer);
400 if (binaryOutlineShadow)
401 contourShadowActor->SetVisibility(
true);
403 contourShadowActor->SetVisibility(
false);
410 localStorage->
m_Mapper->SetInputConnection(localStorage->
m_Plane->GetOutputPort());
414 contourShadowActor->SetVisibility(
false);
449 float rgb[3] = {1.0f, 1.0f, 1.0f};
454 bool selected =
false;
457 if (hover && !selected)
461 if (colorprop.IsNotNull())
463 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
474 if (colorprop.IsNotNull())
476 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
483 if (!hover && !selected)
488 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
489 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
490 localStorage->
m_Actor->GetProperty()->SetColor(rgbConv);
492 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
494 float rgb[3] = {1.0f, 1.0f, 1.0f};
497 if (colorprop.IsNotNull())
499 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
501 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
502 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
509 float opacity = 1.0f;
513 localStorage->
m_Actor->GetProperty()->SetOpacity(opacity);
514 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
516 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
518 ->SetOpacity(opacity);
540 if (mode.IsNotNull())
542 renderingMode = mode->GetRenderingMode();
544 switch (renderingMode)
547 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_LookupTable_Color";
552 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_ColorTransferFunction_Color";
557 MITK_DEBUG <<
"'Image Rendering.Mode' = LookupTable_Color";
561 MITK_DEBUG <<
"'Image Rendering.Mode' = ColorTransferFunction_Color";
565 MITK_ERROR <<
"No valid 'Image Rendering.Mode' set. Using LOOKUPTABLE_LEVELWINDOW_COLOR instead.";
584 if (lookupTableProp.IsNotNull())
586 usedLookupTable = lookupTableProp->GetLookupTable()->GetVtkLookupTable();
603 if (transferFunctionProp.IsNull())
605 MITK_ERROR <<
"'Image Rendering.Mode'' was set to use a color transfer function but there is no property 'Image " 606 "Rendering.Transfer Function'. Nothing will be done.";
611 localStorage->
m_LevelWindowFilter->SetLookupTable(transferFunctionProp->GetValue()->GetColorTransferFunction());
635 if ((dataTimeGeometry ==
nullptr) || (dataTimeGeometry->
CountTimeSteps() == 0) ||
679 if (image->IsRotated())
689 node->
AddProperty(
"Image Rendering.Mode", renderingModeProperty);
695 mitkLutProp->SetLookupTable(mitkLut);
698 std::string photometricInterpretation;
699 if (node->
GetStringProperty(
"dicom.pixel.PhotometricInterpretation", photometricInterpretation))
702 if (photometricInterpretation.find(
"MONOCHROME1") != std::string::npos)
706 mitkLutProp->SetLookupTable(mitkLut);
712 bool isBinaryImage(
false);
724 sliceSelector->SetInput(image);
725 sliceSelector->SetSliceNr(image->GetDimension(2) / 2);
726 sliceSelector->SetTimeNr(image->GetDimension(3) / 2);
727 sliceSelector->SetChannelNr(image->GetDimension(4) / 2);
728 sliceSelector->Update();
729 centralSliceImage = sliceSelector->GetOutput();
730 if (centralSliceImage.IsNotNull() && centralSliceImage->IsInitialized())
732 minValue = centralSliceImage->GetStatistics()->GetScalarValueMin();
733 maxValue = centralSliceImage->GetStatistics()->GetScalarValueMax();
734 min2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMin();
735 max2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMax();
737 if ((maxValue == min2ndValue && minValue == max2ndValue) || minValue == maxValue)
740 minValue = image->GetStatistics()->GetScalarValueMin();
741 maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
742 min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
743 max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
745 isBinaryImage = (maxValue == min2ndValue && minValue == max2ndValue);
767 std::string className = image->GetNameOfClass();
769 if (className !=
"TensorImage" && className !=
"OdfImage" && className !=
"ShImage")
771 PixelType pixelType = image->GetPixelType();
774 if ((pixelType.
GetPixelTypeAsString() ==
"vector" && numComponents > 1) || numComponents == 2 ||
780 if (image.IsNotNull() && image->IsInitialized())
782 if ((overwrite) || (node->
GetProperty(
"levelwindow", renderer) ==
nullptr))
789 0x0028, 0x1050,
"dicom.voilut.WindowCenter", image->GetPropertyList(), sLevel) &&
791 0x0028, 0x1051,
"dicom.voilut.WindowWidth", image->GetPropertyList(), sWindow))
793 float level = atof(sLevel.c_str());
794 float window = atof(sWindow.c_str());
797 std::string sSmallestPixelValueInSeries;
798 std::string sLargestPixelValueInSeries;
802 "dicom.series.SmallestPixelValueInSeries",
803 image->GetPropertyList(),
804 sSmallestPixelValueInSeries) &&
807 "dicom.series.LargestPixelValueInSeries",
808 image->GetPropertyList(),
809 sLargestPixelValueInSeries))
811 float smallestPixelValueInSeries = atof(sSmallestPixelValueInSeries.c_str());
812 float largestPixelValueInSeries = atof(sLargestPixelValueInSeries.c_str());
814 largestPixelValueInSeries + 1);
819 contrast.SetAuto(static_cast<mitk::Image *>(node->
GetData()),
false,
true);
822 contrast.SetLevelWindow(level, window,
true);
826 if (((overwrite) || (node->
GetProperty(
"opaclevelwindow", renderer) ==
nullptr)) &&
827 (image->GetPixelType().GetPixelType() == itk::ImageIOBase::RGBA) &&
828 (image->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR))
834 node->
SetProperty(
"opaclevelwindow", prop, renderer);
837 Superclass::SetDefaultProperties(node, renderer, overwrite);
847 vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
848 vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
849 vtkSmartPointer<vtkUnsignedCharArray> colors = vtkSmartPointer<vtkUnsignedCharArray>::New();
850 colors->SetNumberOfComponents(3);
851 colors->SetName(
"Colors");
858 mitk::IsoDoseLevelSet::Pointer isoDoseLevelSet = propIsoSet->GetValue();
863 if (doseIT->GetVisibleIsoLine())
865 this->CreateLevelOutline(renderer, &(doseIT.Value()), pref, points, lines, colors);
871 mitk::IsoDoseLevelVector::Pointer frereIsoDoseLevelVec = propfreeIsoVec->GetValue();
873 for (mitk::IsoDoseLevelVector::ConstIterator freeDoseIT = frereIsoDoseLevelVec->Begin();
874 freeDoseIT != frereIsoDoseLevelVec->End();
877 if (freeDoseIT->Value()->GetVisibleIsoLine())
879 this->CreateLevelOutline(renderer, freeDoseIT->Value(), pref, points, lines, colors);
884 vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
886 polyData->SetPoints(points);
888 polyData->SetLines(lines);
889 polyData->GetCellData()->SetScalars(colors);
896 vtkSmartPointer<vtkPoints> points,
897 vtkSmartPointer<vtkCellArray> lines,
898 vtkSmartPointer<vtkUnsignedCharArray> colors)
904 int xMin = extent[0];
905 int xMax = extent[1];
906 int yMin = extent[2];
907 int yMax = extent[3];
916 unsigned char colorLine[3] = {
static_cast<unsigned char>(isoColor.GetRed() * 255),
917 static_cast<unsigned char>(isoColor.GetGreen() * 255),
918 static_cast<unsigned char>(isoColor.GetBlue() * 255)};
925 currentPixel =
static_cast<float *
>(localStorage->
m_ReslicedImage->GetScalarPointer());
934 if ((currentPixel) && (*currentPixel >= doseValue))
941 if (y > yMin && *(currentPixel - line) < doseValue)
949 lines->InsertNextCell(2);
950 lines->InsertCellPoint(p1);
951 lines->InsertCellPoint(p2);
952 colors->InsertNextTypedTuple(colorLine);
956 if (y < yMax && *(currentPixel + line) < doseValue)
960 vtkIdType p2 = points->InsertNextPoint(
962 lines->InsertNextCell(2);
963 lines->InsertCellPoint(p1);
964 lines->InsertCellPoint(p2);
965 colors->InsertNextTypedTuple(colorLine);
969 if ((x > xMin || y > yMin) && *(currentPixel - 1) < doseValue)
975 lines->InsertNextCell(2);
976 lines->InsertCellPoint(p1);
977 lines->InsertCellPoint(p2);
978 colors->InsertNextTypedTuple(colorLine);
982 if ((y < yMax || (x < xMax)) && *(currentPixel + 1) < doseValue)
986 vtkIdType p2 = points->InsertNextPoint(
988 lines->InsertNextCell(2);
989 lines->InsertCellPoint(p1);
990 lines->InsertCellPoint(p2);
991 colors->InsertNextTypedTuple(colorLine);
1003 lines->InsertNextCell(2);
1004 lines->InsertCellPoint(p1);
1005 lines->InsertCellPoint(p2);
1006 colors->InsertNextTypedTuple(colorLine);
1014 vtkIdType p2 = points->InsertNextPoint(
1016 lines->InsertNextCell(2);
1017 lines->InsertCellPoint(p1);
1018 lines->InsertCellPoint(p2);
1019 colors->InsertNextTypedTuple(colorLine);
1029 lines->InsertNextCell(2);
1030 lines->InsertCellPoint(p1);
1031 lines->InsertCellPoint(p2);
1032 colors->InsertNextTypedTuple(colorLine);
1040 vtkIdType p2 = points->InsertNextPoint(
1042 lines->InsertNextCell(2);
1043 lines->InsertCellPoint(p1);
1044 lines->InsertCellPoint(p2);
1045 colors->InsertNextTypedTuple(colorLine);
1068 vtkSmartPointer<vtkTransform> trans = vtkSmartPointer<vtkTransform>::New();
1069 vtkSmartPointer<vtkMatrix4x4> matrix = localStorage->
m_Reslicer->GetResliceAxes();
1070 trans->SetMatrix(matrix);
1072 localStorage->
m_Actor->SetUserTransform(trans);
1076 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
1078 vtkActor *secondaryActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
1079 secondaryActor->SetUserTransform(trans);
1089 if (renderingGeometry ==
nullptr || imageGeometry ==
nullptr)
1094 for (
int i = 1; i < 8; i++)
1102 if (initialDistance * distance < 0)
1118 : m_VectorComponentExtractor(vtkSmartPointer<vtkImageExtractComponents>::
New())
1123 m_Plane = vtkSmartPointer<vtkPlaneSource>::New();
1124 m_Texture = vtkSmartPointer<vtkNeverTranslucentTexture>::New().GetPointer();
1128 m_Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
1129 m_Actor = vtkSmartPointer<vtkActor>::New();
1130 m_Actors = vtkSmartPointer<vtkPropAssembly>::New();
1132 m_TSFilter = vtkSmartPointer<vtkMitkThickSlicesFilter>::New();
1158 vtkSmartPointer<vtkActor> outlineShadowActor = vtkSmartPointer<vtkActor>::New();
1159 outlineShadowActor->SetMapper(
m_Mapper);
1161 m_Actors->AddPart(outlineShadowActor);
void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary=true)
void ApplyLookuptable(mitk::BaseRenderer *renderer)
This method applies (or modifies) the lookuptable for all types of images.
virtual int GetInterpolation()
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr, bool fallBackOnDataProperties=true) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
virtual IdType GetValueAsId() const
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
virtual ScalarType SignedDistance(const Point3D &pt3d_mm) const
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. ...
L * GetLocalStorage(mitk::BaseRenderer *forRenderer)
Retrieves a LocalStorage for a specific BaseRenderer.
virtual TimeStepType CountTimeSteps() const =0
Returns the number of time steps.
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
virtual ColorType GetColor() const
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
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 ...
vtkRenderer * GetVtkRenderer() const
static const std::string REFERENCE_DOSE_PROPERTY_NAME
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
bool GetStringProperty(const char *propertyKey, std::string &string, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for string properties (instances of StringProperty)
virtual DataNode * GetDataNode() const
Get the DataNode containing the data to map. Method only returns valid DataNode Pointer if the mapper...
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
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...
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
~LocalStorage() override
Default deconstructor of the local storage.
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
Organizes the rendering process.
const mitk::Image * GetInput(void)
Get the Image to map.
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
virtual DoseValueType GetDoseValue() const
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Set the default properties for general image rendering.
Point3D GetCornerPoint(int id) const
Get the position of the corner number id (in world coordinates)
static const std::string DOSE_FREE_ISO_VALUES_PROPERTY_NAME
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
static const std::string DOSE_ISO_LEVELS_PROPERTY_NAME
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
Property class for dose iso level sets.
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6])
Generates a plane according to the size of the resliced image in milimeters.
unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
void ApplyColor(mitk::BaseRenderer *renderer)
Set the color of the image/polydata.
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
vtkSmartPointer< vtkPolyData > CreateOutlinePolyData(mitk::BaseRenderer *renderer)
Generates a vtkPolyData object containing the outline of a given binary slice.
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer)
This method applies a color transfer function. Internally, a vtkColorTransferFunction is used...
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
void SetRangeMinMax(ScalarType min, ScalarType max)
virtual T GetValue() const
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
The LevelWindow class Class to store level/window values.
bool HasReferenceGeometry() const
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Add new or change existent property.
float CalculateLayerDepth(mitk::BaseRenderer *renderer)
This method uses the vtkCamera clipping range and the layer property to calcualte the depth of the ob...
The ColorProperty class RGB color property.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Stores values needed for the representation/visualization of dose iso levels.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
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.
unsigned int GetDimension() const
Get dimension of the image.
Property class for dose iso level vector.
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
ScalarType GetUpperWindowBound() const
void ApplyLevelWindow(mitk::BaseRenderer *renderer)
ApplyLevelWindow Apply the level window for the given renderer.
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Image class for storing images.
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...
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
virtual void CalculateTimeStep(BaseRenderer *renderer)
Updates the time step, which is sometimes needed in subclasses.
void ApplyOpacity(mitk::BaseRenderer *renderer)
Set the opacity of the actor.
mitk::Image::Pointer image
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Describes the geometry of a data object consisting of slices.
::itk::RGBPixel< float > ColorType
void TransformActor(mitk::BaseRenderer *renderer)
Transforms the actor to the actual position in 3D.
bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry)
Calculates whether the given rendering geometry intersects the given SlicedGeometry3D.
virtual bool IsValid() const
Is this BaseGeometry in a state that is valid?
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is nullptr, the BaseRenderer-independent PropertyLi...
Vector3D GetNormal() const
Normal of the plane.
~DoseImageVtkMapper2D() override
virtual bool IsInitialized() const
Check whether the data has been initialized, i.e., at least the Geometry and other header data has be...
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
int GetTimestep() const
Returns the current time step as calculated from the renderer.
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containg all lines/points needed for outlining the contour. This container is used to...
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
void ApplyRenderingMode(mitk::BaseRenderer *renderer)
This method switches between different rendering modes (e.g. use a lookup table or a transfer functio...
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Does the actual resampling, without rendering the image yet. All the data is generated inside this me...
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
Describes a two-dimensional, rectangular plane.
void UpdateOutputInformation() override
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
bool GetLevelWindow(mitk::LevelWindow &levelWindow, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="levelwindow") const
Convenience access method for level-window properties (instances of LevelWindowProperty) ...
LocalStorage()
Default constructor of the local storage.
ScalarType GetLowerWindowBound() const
std::string GetPixelTypeAsString() const
Returns a string containing the ITK pixel type name.
bool MITKCORE_EXPORT GetBackwardsCompatibleDICOMProperty(unsigned int group, unsigned int element, std::string const &backwardsCompatiblePropertyName, PropertyList const *propertyList, std::string &propertyValue)
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
virtual bool IsValidTimeStep(TimeStepType timeStep) const =0
Test for the given time step if a geometry is availible.
Class for nodes of the DataTree.
Class for defining the data type of pixels.
vtkSmartPointer< vtkPropAssembly > m_Actors