38 #include <vtkCamera.h> 39 #include <vtkCellArray.h> 40 #include <vtkColorTransferFunction.h> 41 #include <vtkGeneralTransform.h> 42 #include <vtkImageChangeInformation.h> 43 #include <vtkImageData.h> 44 #include <vtkImageExtractComponents.h> 45 #include <vtkImageReslice.h> 46 #include <vtkLookupTable.h> 47 #include <vtkMatrix4x4.h> 48 #include <vtkPlaneSource.h> 49 #include <vtkPoints.h> 50 #include <vtkPolyDataMapper.h> 51 #include <vtkProperty.h> 52 #include <vtkTransform.h> 55 #include <itkRGBAPixel.h> 66 this->InvokeEvent(itk::DeleteEvent());
77 localStorage->
m_Plane->SetOrigin(planeBounds[0], planeBounds[2], depth);
81 localStorage->
m_Plane->SetPoint1(planeBounds[1], planeBounds[2], depth);
82 localStorage->
m_Plane->SetPoint2(planeBounds[0], planeBounds[3], depth);
88 double maxRange = renderer->
GetVtkRenderer()->GetActiveCamera()->GetClippingRange()[1];
91 float depth = -maxRange * 0.01;
99 MITK_WARN <<
"Layer value exceeds clipping range. Set to minimum instead.";
121 if (
nullptr ==
image || !
image->IsInitialized())
149 localStorage->
m_Reslicer->SetWorldGeometry(worldGeometry);
153 localStorage->
m_Reslicer->SetResliceTransformByGeometry(
157 bool inPlaneResampleExtentByGeometry =
false;
158 datanode->
GetBoolProperty(
"in plane resample extent by geometry", inPlaneResampleExtentByGeometry, renderer);
159 localStorage->
m_Reslicer->SetInPlaneResampleExtentByGeometry(inPlaneResampleExtentByGeometry);
163 if ((
image->GetDimension() >= 3) && (
image->GetDimension(2) > 1))
166 datanode->
GetProperty(resliceInterpolationProperty,
"reslice interpolation", renderer);
168 int interpolationMode = VTK_RESLICE_NEAREST;
169 if (resliceInterpolationProperty !=
nullptr)
174 switch (interpolationMode)
176 case VTK_RESLICE_NEAREST:
179 case VTK_RESLICE_LINEAR:
182 case VTK_RESLICE_CUBIC:
194 localStorage->
m_Reslicer->SetVtkOutputRequest(
true);
197 int thickSlicesMode = 0;
198 int thickSlicesNum = 1;
200 if (
image->GetPixelType().GetNumberOfComponents() == 1)
207 if (dn->
GetProperty(resliceMethodEnumProperty,
"reslice.thickslices", renderer) && resliceMethodEnumProperty)
208 thickSlicesMode = resliceMethodEnumProperty->
GetValueAsId();
211 if (dn->
GetProperty(intProperty,
"reslice.thickslices.num", renderer) && intProperty)
213 thickSlicesNum = intProperty->
GetValue();
214 if (thickSlicesNum < 1)
220 MITK_WARN <<
"no associated widget plane data tree node found";
224 const auto *planeGeometry =
dynamic_cast<const PlaneGeometry *
>(worldGeometry);
226 if (thickSlicesMode > 0)
228 double dataZSpacing = 1.0;
232 const auto *abstractGeometry =
234 if (abstractGeometry !=
nullptr)
235 normal = abstractGeometry->GetPlane()->GetNormal();
238 if (planeGeometry !=
nullptr)
240 normal = planeGeometry->GetNormal();
247 image->GetTimeGeometry()->GetGeometryForTimeStep(this->
GetTimestep())->WorldToIndex(normal, normInIndex);
249 dataZSpacing = 1.0 / normInIndex.GetNorm();
251 localStorage->
m_Reslicer->SetOutputDimensionality(3);
252 localStorage->
m_Reslicer->SetOutputSpacingZDirection(dataZSpacing);
253 localStorage->
m_Reslicer->SetOutputExtentZDirection(-thickSlicesNum, 0 + thickSlicesNum);
258 localStorage->
m_TSFilter->SetThickSliceMode(thickSlicesMode - 1);
272 localStorage->
m_Reslicer->SetOutputDimensionality(2);
273 localStorage->
m_Reslicer->SetOutputSpacingZDirection(1.0);
274 localStorage->
m_Reslicer->SetOutputExtentZDirection(0, 0);
278 localStorage->
m_Reslicer->UpdateLargestPossibleRegion();
285 double sliceBounds[6];
286 for (
auto &sliceBound : sliceBounds)
290 localStorage->
m_Reslicer->GetClippedPlaneBounds(sliceBounds);
297 double textureClippingBounds[6];
298 for (
auto &textureClippingBound : textureClippingBounds)
300 textureClippingBound = 0.0;
307 textureClippingBounds[0] =
static_cast<int>(textureClippingBounds[0] / localStorage->
m_mmPerPixel[0] + 0.5);
308 textureClippingBounds[1] =
static_cast<int>(textureClippingBounds[1] / localStorage->
m_mmPerPixel[0] + 0.5);
309 textureClippingBounds[2] =
static_cast<int>(textureClippingBounds[2] / localStorage->
m_mmPerPixel[1] + 0.5);
310 textureClippingBounds[3] =
static_cast<int>(textureClippingBounds[3] / localStorage->
m_mmPerPixel[1] + 0.5);
317 int numberOfComponents = localStorage->
m_ReslicedImage->GetNumberOfScalarComponents();
320 bool binaryOutline =
false;
328 itk::ImageIOBase::IOComponentType componentType =
static_cast<itk::ImageIOBase::IOComponentType
>(
image->GetPixelType().GetComponentType());
329 switch (componentType)
331 case itk::ImageIOBase::UCHAR:
333 localStorage->
m_OutlinePolyData = CreateOutlinePolyData<unsigned char>(renderer);
335 case itk::ImageIOBase::USHORT:
337 localStorage->
m_OutlinePolyData = CreateOutlinePolyData<unsigned short>(renderer);
340 binaryOutline =
false;
342 MITK_WARN <<
"Type of all binary images should be unsigned char or unsigned short. Outline does not work on other pixel types!";
346 float binaryOutlineWidth = 1.0;
347 if (datanode->
GetFloatProperty(
"outline width", binaryOutlineWidth, renderer))
349 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
351 float binaryOutlineShadowWidth = 1.5;
352 datanode->
GetFloatProperty(
"outline shadow width", binaryOutlineShadowWidth, renderer);
354 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
356 ->SetLineWidth(binaryOutlineWidth * binaryOutlineShadowWidth);
358 localStorage->
m_Actor->GetProperty()->SetLineWidth(binaryOutlineWidth);
364 if (numberOfComponents != 1)
366 MITK_ERROR <<
"Rendering Error: Binary Images with more then 1 component are not supported!";
375 localStorage->
m_Texture->SetColorModeToDirectScalars();
377 int displayedComponent = 0;
379 if (datanode->
GetIntProperty(
"Image.Displayed Component", displayedComponent, renderer) && numberOfComponents > 1)
393 bool textureInterpolation =
false;
397 localStorage->
m_Texture->SetInterpolate(textureInterpolation);
404 auto *contourShadowActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
406 if (binary && binaryOutline)
410 localStorage->
m_Actor->SetTexture(
nullptr);
412 bool binaryOutlineShadow =
false;
413 datanode->
GetBoolProperty(
"outline binary shadow", binaryOutlineShadow, renderer);
414 if (binaryOutlineShadow)
416 contourShadowActor->SetVisibility(
true);
420 contourShadowActor->SetVisibility(
false);
428 localStorage->
m_Mapper->SetInputConnection(localStorage->
m_Plane->GetOutputPort());
432 contourShadowActor->SetVisibility(
false);
467 float rgb[3] = {1.0f, 1.0f, 1.0f};
472 bool selected =
false;
477 if (binary && hover && !selected)
481 if (colorprop.IsNotNull())
483 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
490 if (binary && selected)
494 if (colorprop.IsNotNull())
496 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
503 if (!binary || (!hover && !selected))
508 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
509 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
510 localStorage->
m_Actor->GetProperty()->SetColor(rgbConv);
512 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
514 float rgb[3] = {1.0f, 1.0f, 1.0f};
517 if (colorprop.IsNotNull())
519 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
521 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
522 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
529 float opacity = 1.0f;
533 localStorage->
m_Actor->GetProperty()->SetOpacity(opacity);
534 if (localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1)
536 dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0))
538 ->SetOpacity(opacity);
560 if (mode.IsNotNull())
562 renderingMode = mode->GetRenderingMode();
564 switch (renderingMode)
567 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_LookupTable_Color";
572 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_ColorTransferFunction_Color";
577 MITK_DEBUG <<
"'Image Rendering.Mode' = LookupTable_Color";
581 MITK_DEBUG <<
"'Image Rendering.Mode' = ColorTransferFunction_Color";
585 MITK_ERROR <<
"No valid 'Image Rendering.Mode' set. Using LOOKUPTABLE_LEVELWINDOW_COLOR instead.";
604 if (lookupTableProp.IsNotNull())
606 usedLookupTable = lookupTableProp->GetLookupTable()->GetVtkLookupTable();
623 if (transferFunctionProp.IsNull())
625 MITK_ERROR <<
"'Image Rendering.Mode'' was set to use a color transfer function but there is no property 'Image " 626 "Rendering.Transfer Function'. Nothing will be done.";
631 localStorage->
m_LevelWindowFilter->SetLookupTable(transferFunctionProp->GetValue()->GetColorTransferFunction());
633 transferFunctionProp->GetValue()->GetScalarOpacityFunction());
656 const TimeGeometry *dataTimeGeometry = data->GetTimeGeometry();
657 if ((dataTimeGeometry ==
nullptr) || (dataTimeGeometry->
CountTimeSteps() == 0) ||
664 data->UpdateOutputInformation();
695 if (image->IsRotated())
704 node->
AddProperty(
"Image Rendering.Mode", renderingModeProperty);
710 mitkLutProp->SetLookupTable(mitkLut);
711 node->
SetProperty(
"LookupTable", mitkLutProp, renderer);
713 std::string photometricInterpretation;
714 if (node->
GetStringProperty(
"dicom.pixel.PhotometricInterpretation", photometricInterpretation))
717 if (photometricInterpretation.find(
"MONOCHROME1") != std::string::npos)
721 mitkLutProp->SetLookupTable(mitkLut);
722 node->
SetProperty(
"LookupTable", mitkLutProp, renderer);
728 bool isBinaryImage(
false);
729 if (!node->
GetBoolProperty(
"binary", isBinaryImage) && image->GetPixelType().GetNumberOfComponents() == 1)
740 sliceSelector->SetInput(image);
741 sliceSelector->SetSliceNr(image->GetDimension(2) / 2);
742 sliceSelector->SetTimeNr(image->GetDimension(3) / 2);
743 sliceSelector->SetChannelNr(image->GetDimension(4) / 2);
744 sliceSelector->Update();
745 centralSliceImage = sliceSelector->GetOutput();
746 if (centralSliceImage.IsNotNull() && centralSliceImage->IsInitialized())
748 minValue = centralSliceImage->GetStatistics()->GetScalarValueMin();
749 maxValue = centralSliceImage->GetStatistics()->GetScalarValueMax();
750 min2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMin();
751 max2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMax();
753 if ((maxValue == min2ndValue && minValue == max2ndValue) || minValue == maxValue)
756 minValue = image->GetStatistics()->GetScalarValueMin();
757 maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
758 min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
759 max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
761 isBinaryImage = (maxValue == min2ndValue && minValue == max2ndValue);
764 std::string className = image->GetNameOfClass();
765 if (className !=
"TensorImage" && className !=
"OdfImage" && className !=
"ShImage")
767 PixelType pixelType = image->GetPixelType();
770 if ((pixelType.
GetPixelType() == itk::ImageIOBase::VECTOR && numComponents > 1) || numComponents == 2 ||
797 if (image.IsNotNull() && image->IsInitialized())
799 if ((overwrite) || (node->
GetProperty(
"levelwindow", renderer) ==
nullptr))
804 std::string sLevel =
"";
805 std::string sWindow =
"";
807 0x0028, 0x1050,
"dicom.voilut.WindowCenter", image->GetPropertyList(), sLevel) &&
809 0x0028, 0x1051,
"dicom.voilut.WindowWidth", image->GetPropertyList(), sWindow))
811 float level = atof(sLevel.c_str());
812 float window = atof(sWindow.c_str());
814 std::string sSmallestPixelValueInSeries;
815 std::string sLargestPixelValueInSeries;
819 "dicom.series.SmallestPixelValueInSeries",
820 image->GetPropertyList(),
821 sSmallestPixelValueInSeries) &&
824 "dicom.series.LargestPixelValueInSeries",
825 image->GetPropertyList(),
826 sLargestPixelValueInSeries))
828 float smallestPixelValueInSeries = atof(sSmallestPixelValueInSeries.c_str());
829 float largestPixelValueInSeries = atof(sLargestPixelValueInSeries.c_str());
831 largestPixelValueInSeries + 1);
836 contrast.
SetAuto(static_cast<mitk::Image *>(node->
GetData()),
false,
true);
842 contrast.
SetAuto(static_cast<mitk::Image *>(node->
GetData()),
false,
true);
848 if (((overwrite) || (node->
GetProperty(
"opaclevelwindow", renderer) ==
nullptr)) &&
849 (image->GetPixelType().GetPixelType() == itk::ImageIOBase::RGBA) &&
850 (image->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR))
856 node->
SetProperty(
"opaclevelwindow", prop, renderer);
867 template <
typename TPixel>
874 int xMin = extent[0];
875 int xMax = extent[1];
876 int yMin = extent[2];
877 int yMax = extent[3];
887 vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
888 vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
891 auto* currentPixel =
static_cast<TPixel*
>(localStorage->
m_ReslicedImage->GetScalarPointer());
896 if ((currentPixel) && (*currentPixel != 0))
903 if (y > yMin && *(currentPixel - line) == 0)
911 lines->InsertNextCell(2);
912 lines->InsertCellPoint(p1);
913 lines->InsertCellPoint(p2);
917 if (y < yMax && *(currentPixel + line) == 0)
921 vtkIdType p2 = points->InsertNextPoint(
923 lines->InsertNextCell(2);
924 lines->InsertCellPoint(p1);
925 lines->InsertCellPoint(p2);
929 if ((x > xMin || y > yMin) && *(currentPixel - 1) == 0)
935 lines->InsertNextCell(2);
936 lines->InsertCellPoint(p1);
937 lines->InsertCellPoint(p2);
941 if ((y < yMax || (x < xMax)) && *(currentPixel + 1) == 0)
945 vtkIdType p2 = points->InsertNextPoint(
947 lines->InsertNextCell(2);
948 lines->InsertCellPoint(p1);
949 lines->InsertCellPoint(p2);
961 lines->InsertNextCell(2);
962 lines->InsertCellPoint(p1);
963 lines->InsertCellPoint(p2);
971 vtkIdType p2 = points->InsertNextPoint(
973 lines->InsertNextCell(2);
974 lines->InsertCellPoint(p1);
975 lines->InsertCellPoint(p2);
985 lines->InsertNextCell(2);
986 lines->InsertCellPoint(p1);
987 lines->InsertCellPoint(p2);
995 vtkIdType p2 = points->InsertNextPoint(
997 lines->InsertNextCell(2);
998 lines->InsertCellPoint(p1);
999 lines->InsertCellPoint(p2);
1018 vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
1020 polyData->SetPoints(points);
1022 polyData->SetLines(lines);
1030 vtkSmartPointer<vtkTransform> trans = vtkSmartPointer<vtkTransform>::New();
1031 vtkSmartPointer<vtkMatrix4x4> matrix = localStorage->
m_Reslicer->GetResliceAxes();
1032 trans->SetMatrix(matrix);
1034 localStorage->
m_Actor->SetUserTransform(trans);
1038 if (localStorage->
m_Actors->GetNumberOfPaths() > 1)
1040 auto *secondaryActor =
dynamic_cast<vtkActor *
>(localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
1041 secondaryActor->SetUserTransform(trans);
1051 if (renderingGeometry ==
nullptr || imageGeometry ==
nullptr)
1056 for (
int i = 1; i < 8; i++)
1064 if (initialDistance * distance < 0)
1080 : m_VectorComponentExtractor(vtkSmartPointer<vtkImageExtractComponents>::
New())
1085 m_Plane = vtkSmartPointer<vtkPlaneSource>::New();
1086 m_Texture = vtkSmartPointer<vtkNeverTranslucentTexture>::New().GetPointer();
1090 m_Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
1091 m_Actor = vtkSmartPointer<vtkActor>::New();
1092 m_Actors = vtkSmartPointer<vtkPropAssembly>::New();
1094 m_TSFilter = vtkSmartPointer<vtkMitkThickSlicesFilter>::New();
1120 vtkSmartPointer<vtkActor> outlineShadowActor = vtkSmartPointer<vtkActor>::New();
1121 outlineShadowActor->SetMapper(
m_Mapper);
1123 m_Actors->AddPart(outlineShadowActor);
void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary=true)
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
float CalculateLayerDepth(mitk::BaseRenderer *renderer)
This method uses the vtkCamera clipping range and the layer property to calcualte the depth of the ob...
virtual ScalarType SignedDistance(const Point3D &pt3d_mm) const
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
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.
void ApplyRenderingMode(mitk::BaseRenderer *renderer)
This method switches between different rendering modes (e.g. use a lookup table or a transfer functio...
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.
void ApplyOpacity(mitk::BaseRenderer *renderer)
Set the opacity of the actor.
vtkRenderer * GetVtkRenderer() const
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...
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
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...
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
Organizes the rendering process.
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
Point3D GetCornerPoint(int id) const
Get the position of the corner number id (in world coordinates)
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.
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)
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer)
This method applies a color transfer function. Internally, a vtkColorTransferFunction is used...
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
vtkSmartPointer< vtkPropAssembly > m_Actors
~LocalStorage() override
Default deconstructor of the local storage.
void SetRangeMinMax(ScalarType min, ScalarType max)
virtual T GetValue() const
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.
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.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
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.
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Does the actual resampling, without rendering the image yet. All the data is generated inside this me...
ScalarType GetUpperWindowBound() const
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
const mitk::Image * GetInput(void)
Get the Image to map.
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Image class for storing images.
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
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...
void SetAuto(const Image *image, bool tryPicTags=true, bool guessByCentralSlice=true, unsigned selectedComponent=0)
sets level/window to optimize the contrast of the given Image
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.
virtual void CalculateTimeStep(BaseRenderer *renderer)
Updates the time step, which is sometimes needed in subclasses.
itk::ImageIOBase::IOPixelType GetPixelType() const
mitk::Image::Pointer image
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Set the default properties for general image rendering.
Describes the geometry of a data object consisting of slices.
void TransformActor(mitk::BaseRenderer *renderer)
Transforms the actor to the actual position in 3D.
virtual bool IsValid() const
Is this BaseGeometry in a state that is valid?
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is nullptr, the BaseRenderer-independent PropertyLi...
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
int GetTimestep() const
Returns the current time step as calculated from the renderer.
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.
Describes a two-dimensional, rectangular plane.
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6])
Generates a plane according to the size of the resliced image in milimeters.
void SetLevelWindow(ScalarType level, ScalarType window, bool expandRangesIfNecessary=true)
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
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) ...
ScalarType GetLowerWindowBound() const
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.
~ImageVtkMapper2D() override
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)
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=nullptr, bool overwrite=false)
Set default values of properties used by this mapper to node.
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.