46 #include <vtkCamera.h>
47 #include <vtkCellData.h>
48 #include <vtkColorTransferFunction.h>
49 #include <vtkGeneralTransform.h>
50 #include <vtkImageChangeInformation.h>
51 #include <vtkImageData.h>
52 #include <vtkImageExtractComponents.h>
53 #include <vtkImageReslice.h>
54 #include <vtkLookupTable.h>
55 #include <vtkMatrix4x4.h>
56 #include <vtkPlaneSource.h>
57 #include <vtkPoints.h>
58 #include <vtkPolyDataMapper.h>
59 #include <vtkProperty.h>
60 #include <vtkTransform.h>
61 #include <vtkUnsignedCharArray.h>
64 #include <itkRGBAPixel.h>
74 this->InvokeEvent( itk::DeleteEvent() );
80 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
82 float depth = this->CalculateLayerDepth(renderer);
85 localStorage->
m_Plane->SetOrigin(planeBounds[0], planeBounds[2], depth);
89 localStorage->
m_Plane->SetPoint1(planeBounds[1] , planeBounds[2], depth);
90 localStorage->
m_Plane->SetPoint2(planeBounds[0], planeBounds[3], depth);
96 double maxRange = renderer->
GetVtkRenderer()->GetActiveCamera()->GetClippingRange()[1];
99 float depth = -maxRange*0.01;
101 GetDataNode()->GetIntProperty(
"layer", layer, renderer);
106 MITK_WARN <<
"Layer value exceeds clipping range. Set to minimum instead.";
113 return static_cast< const mitk::Image *
>( GetDataNode()->GetData() );
119 return m_LSH.GetLocalStorage(renderer)->m_Actors;
125 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
146 if ( !RenderingGeometryIntersectsImage( worldGeometry, input->
GetSlicedGeometry() ) )
158 localStorage->
m_Reslicer->SetWorldGeometry(worldGeometry);
159 localStorage->
m_Reslicer->SetTimeStep( this->GetTimestep() );
165 bool inPlaneResampleExtentByGeometry =
false;
166 datanode->
GetBoolProperty(
"in plane resample extent by geometry", inPlaneResampleExtentByGeometry, renderer);
167 localStorage->
m_Reslicer->SetInPlaneResampleExtentByGeometry(inPlaneResampleExtentByGeometry);
175 resliceInterpolationProperty,
"reslice interpolation" );
177 int interpolationMode = VTK_RESLICE_NEAREST;
178 if ( resliceInterpolationProperty != NULL )
183 switch ( interpolationMode )
185 case VTK_RESLICE_NEAREST:
188 case VTK_RESLICE_LINEAR:
191 case VTK_RESLICE_CUBIC:
203 localStorage->
m_Reslicer->SetVtkOutputRequest(
true);
206 int thickSlicesMode = 0;
207 int thickSlicesNum = 1;
216 if( dn->
GetProperty( resliceMethodEnumProperty,
"reslice.thickslices" ) && resliceMethodEnumProperty )
217 thickSlicesMode = resliceMethodEnumProperty->
GetValueAsId();
220 if( dn->
GetProperty( intProperty,
"reslice.thickslices.num" ) && intProperty )
222 thickSlicesNum = intProperty->
GetValue();
223 if(thickSlicesNum < 1) thickSlicesNum=1;
224 if(thickSlicesNum > 10) thickSlicesNum=10;
229 MITK_WARN <<
"no associated widget plane data tree node found";
235 if(thickSlicesMode > 0)
237 double dataZSpacing = 1.0;
241 if ( planeGeometry != NULL ){
245 if(abstractGeometry != NULL)
254 dataZSpacing = 1.0 / normInIndex.GetNorm();
256 localStorage->
m_Reslicer->SetOutputDimensionality( 3 );
257 localStorage->
m_Reslicer->SetOutputSpacingZDirection(dataZSpacing);
258 localStorage->
m_Reslicer->SetOutputExtentZDirection( -thickSlicesNum, 0+thickSlicesNum );
263 localStorage->
m_TSFilter->SetThickSliceMode( thickSlicesMode-1 );
277 localStorage->
m_Reslicer->SetOutputDimensionality( 2 );
278 localStorage->
m_Reslicer->SetOutputSpacingZDirection(1.0);
279 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))
342 ->GetProperty()->SetLineWidth( binaryOutlineWidth * binaryOutlineShadowWidth );
345 localStorage->
m_Actor->GetProperty()->SetLineWidth( binaryOutlineWidth );
355 this->ApplyOpacity( renderer );
356 this->ApplyRenderingMode(renderer);
359 localStorage->
m_Texture->MapColorScalarsThroughLookupTableOff();
361 int displayedComponent = 0;
363 if (datanode->
GetIntProperty(
"Image.Displayed Component", displayedComponent, renderer) && numberOfComponents > 1)
377 bool textureInterpolation =
false;
378 GetDataNode()->GetBoolProperty(
"texture interpolation", textureInterpolation, renderer );
381 localStorage->
m_Texture->SetInterpolate(textureInterpolation);
386 this->TransformActor( renderer );
388 vtkActor* contourShadowActor =
dynamic_cast<vtkActor*
> (localStorage->
m_Actors->GetParts()->GetItemAsObject(0));
394 localStorage->
m_Actor->SetTexture(NULL);
396 bool binaryOutlineShadow(
false );
397 datanode->
GetBoolProperty(
"outline binary shadow", binaryOutlineShadow, renderer );
399 if ( binaryOutlineShadow )
400 contourShadowActor->SetVisibility(
true );
402 contourShadowActor->SetVisibility(
false );
407 this->GeneratePlane( renderer, sliceBounds );
409 localStorage->
m_Mapper->SetInputConnection(localStorage->
m_Plane->GetOutputPort());
413 contourShadowActor->SetVisibility(
false );
422 LocalStorage *localStorage = this->GetLocalStorage( renderer );
425 this->GetDataNode()->GetLevelWindow( levelWindow, renderer,
"levelwindow" );
429 if( this->GetDataNode()->GetLevelWindow( opacLevelWindow, renderer,
"opaclevelwindow" ) )
445 LocalStorage *localStorage = this->GetLocalStorage( renderer );
447 float rgb[3]= { 1.0f, 1.0f, 1.0f };
452 bool selected =
false;
453 GetDataNode()->GetBoolProperty(
"binaryimage.ishovering", hover, renderer);
454 GetDataNode()->GetBoolProperty(
"selected", selected, renderer);
455 if(hover && !selected)
458 (
"binaryimage.hoveringcolor", renderer));
459 if(colorprop.IsNotNull())
461 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3*
sizeof(float));
465 GetDataNode()->GetColor( rgb, renderer,
"color" );
471 (
"binaryimage.selectedcolor", renderer));
472 if(colorprop.IsNotNull()) {
473 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3*
sizeof(float));
477 GetDataNode()->GetColor(rgb, renderer,
"color");
480 if(!hover && !selected)
482 GetDataNode()->GetColor( rgb, renderer,
"color" );
485 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
486 dynamic_cast<vtkActor*
> (localStorage->
m_Actors->GetParts()->GetItemAsObject(0))->GetProperty()->SetColor(rgbConv);
487 localStorage->
m_Actor->GetProperty()->SetColor(rgbConv);
489 if ( localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1 )
491 float rgb[3]= { 1.0f, 1.0f, 1.0f };
493 (
"outline binary shadow color", renderer));
494 if(colorprop.IsNotNull())
496 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3*
sizeof(float));
498 double rgbConv[3] = {(double)rgb[0], (
double)rgb[1], (double)rgb[2]};
499 dynamic_cast<vtkActor*
>( localStorage->
m_Actors->GetParts()->GetItemAsObject(0) )->GetProperty()->SetColor(rgbConv);
505 LocalStorage* localStorage = this->GetLocalStorage( renderer );
506 float opacity = 1.0f;
508 GetDataNode()->GetOpacity( opacity, renderer,
"opacity" );
510 localStorage->
m_Actor->GetProperty()->SetOpacity(opacity);
511 if ( localStorage->
m_Actors->GetParts()->GetNumberOfItems() > 1 )
513 dynamic_cast<vtkActor*
>( localStorage->
m_Actors->GetParts()->GetItemAsObject(0) )->GetProperty()->SetOpacity(opacity);
519 LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
522 this->GetDataNode()->GetBoolProperty(
"binary", binary, renderer );
536 renderingMode = mode->GetRenderingMode();
538 switch(renderingMode)
541 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_LookupTable_Color";
542 this->ApplyLookuptable( renderer );
543 this->ApplyLevelWindow( renderer );
546 MITK_DEBUG <<
"'Image Rendering.Mode' = LevelWindow_ColorTransferFunction_Color";
547 this->ApplyColorTransferFunction( renderer );
548 this->ApplyLevelWindow( renderer );
551 MITK_DEBUG <<
"'Image Rendering.Mode' = LookupTable_Color";
552 this->ApplyLookuptable( renderer );
555 MITK_DEBUG <<
"'Image Rendering.Mode' = ColorTransferFunction_Color";
556 this->ApplyColorTransferFunction( renderer );
559 MITK_ERROR <<
"No valid 'Image Rendering.Mode' set. Using LOOKUPTABLE_LEVELWINDOW_COLOR instead.";
560 this->ApplyLookuptable( renderer );
561 this->ApplyLevelWindow( renderer );
566 this->ApplyColor( renderer );
571 LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
577 if( lookupTableProp.IsNotNull() )
579 usedLookupTable = lookupTableProp->GetLookupTable()->GetVtkLookupTable();
595 if( transferFunctionProp.IsNull() )
597 MITK_ERROR <<
"'Image Rendering.Mode'' was set to use a color transfer function but there is no property 'Image Rendering.Transfer Function'. Nothing will be done.";
600 LocalStorage* localStorage = m_LSH.GetLocalStorage(renderer);
602 localStorage->
m_LevelWindowFilter->SetLookupTable(transferFunctionProp->GetValue()->GetColorTransferFunction());
609 GetDataNode()->GetVisibility(visible, renderer,
"visible");
623 this->CalculateTimeStep( renderer );
627 if ( ( dataTimeGeometry == NULL )
628 || ( dataTimeGeometry->CountTimeSteps() == 0 )
634 const DataNode *node = this->GetDataNode();
636 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
646 this->GenerateDataForRenderer( renderer );
672 node->
AddProperty(
"Image Rendering.Mode", renderingModeProperty);
678 mitkLutProp->SetLookupTable(mitkLut);
681 std::string photometricInterpretation;
682 if ( node->
GetStringProperty(
"dicom.pixel.PhotometricInterpretation", photometricInterpretation ) )
685 if ( photometricInterpretation.find(
"MONOCHROME1") != std::string::npos )
689 mitkLutProp->SetLookupTable(mitkLut);
695 bool isBinaryImage(
false);
708 sliceSelector->SetInput(image);
709 sliceSelector->SetSliceNr(image->GetDimension(2)/2);
710 sliceSelector->SetTimeNr(image->GetDimension(3)/2);
711 sliceSelector->SetChannelNr(image->GetDimension(4)/2);
712 sliceSelector->Update();
713 centralSliceImage = sliceSelector->GetOutput();
714 if ( centralSliceImage.IsNotNull() && centralSliceImage->IsInitialized() )
716 minValue = centralSliceImage->GetStatistics()->GetScalarValueMin();
717 maxValue = centralSliceImage->GetStatistics()->GetScalarValueMax();
718 min2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMin();
719 max2ndValue = centralSliceImage->GetStatistics()->GetScalarValue2ndMax();
721 if ((maxValue == min2ndValue && minValue == max2ndValue) || minValue == maxValue)
724 minValue = image->GetStatistics()->GetScalarValueMin();
725 maxValue = image->GetStatistics()->GetScalarValueMaxNoRecompute();
726 min2ndValue = image->GetStatistics()->GetScalarValue2ndMinNoRecompute();
727 max2ndValue = image->GetStatistics()->GetScalarValue2ndMaxNoRecompute();
729 isBinaryImage = ( maxValue == min2ndValue && minValue == max2ndValue );
751 std::string className = image->GetNameOfClass();
753 if (className !=
"TensorImage" && className !=
"QBallImage")
755 PixelType pixelType = image->GetPixelType();
758 if ((pixelType.
GetPixelTypeAsString() ==
"vector" && numComponents > 1) || numComponents == 2 || numComponents > 4)
763 if(image.IsNotNull() && image->IsInitialized())
765 if((overwrite) || (node->
GetProperty(
"levelwindow", renderer)==NULL))
774 float level = atof( sLevel.c_str() );
775 float window = atof( sWindow.c_str() );
778 std::string sSmallestPixelValueInSeries;
779 std::string sLargestPixelValueInSeries;
784 float smallestPixelValueInSeries = atof( sSmallestPixelValueInSeries.c_str() );
785 float largestPixelValueInSeries = atof( sLargestPixelValueInSeries.c_str() );
786 contrast.
SetRangeMinMax( smallestPixelValueInSeries-1, largestPixelValueInSeries+1 );
791 contrast.SetAuto( static_cast<mitk::Image*>(node->
GetData()),
false,
true );
794 contrast.SetLevelWindow( level, window,
true );
798 if(((overwrite) || (node->
GetProperty(
"opaclevelwindow", renderer)==NULL))
799 && (image->GetPixelType().GetPixelType() == itk::ImageIOBase::RGBA)
800 && (image->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR) )
806 node->
SetProperty(
"opaclevelwindow", prop, renderer );
809 Superclass::SetDefaultProperties(node, renderer, overwrite);
814 return m_LSH.GetLocalStorage(renderer);
823 colors->SetNumberOfComponents(3);
824 colors->SetName(
"Colors");
834 if(doseIT->GetVisibleIsoLine())
836 this->CreateLevelOutline(renderer, &(doseIT.Value()), pref, points, lines, colors);
843 for(mitk::IsoDoseLevelVector::ConstIterator freeDoseIT = frereIsoDoseLevelVec->Begin(); freeDoseIT!=frereIsoDoseLevelVec->End();++freeDoseIT)
845 if(freeDoseIT->Value()->GetVisibleIsoLine())
847 this->CreateLevelOutline(renderer, freeDoseIT->Value(), pref, points, lines, colors);
854 polyData->SetPoints(points);
856 polyData->SetLines(lines);
857 polyData->GetCellData()->SetScalars(colors);
861 void mitk::DoseImageVtkMapper2D::CreateLevelOutline(
mitk::BaseRenderer* renderer,
const mitk::IsoDoseLevel* level,
float pref, vtkSmartPointer<vtkPoints> points, vtkSmartPointer<vtkCellArray> lines, vtkSmartPointer<vtkUnsignedCharArray> colors)
863 LocalStorage* localStorage = this->GetLocalStorage(renderer);
866 int* extent = localStorage->m_ReslicedImage->GetExtent();
867 int xMin = extent[0];
868 int xMax = extent[1];
869 int yMin = extent[2];
870 int yMax = extent[3];
872 int* dims = localStorage->m_ReslicedImage->GetDimensions();
875 float depth = CalculateLayerDepth(renderer);
879 unsigned char colorLine[3] = {
static_cast<unsigned char>(isoColor.GetRed()*255),
880 static_cast<unsigned char>(isoColor.GetGreen()*255),
881 static_cast<unsigned char>(isoColor.GetBlue()*255)};
888 currentPixel =
static_cast<float*
>(localStorage->m_ReslicedImage->GetScalarPointer() );
893 if ((currentPixel) && (*currentPixel >= doseValue))
900 if (y > yMin && *(currentPixel-line) < doseValue)
903 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
904 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
906 lines->InsertNextCell(2);
907 lines->InsertCellPoint(p1);
908 lines->InsertCellPoint(p2);
909 colors->InsertNextTupleValue(colorLine);
913 if (y < yMax && *(currentPixel+line) < doseValue)
915 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
916 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
917 lines->InsertNextCell(2);
918 lines->InsertCellPoint(p1);
919 lines->InsertCellPoint(p2);
920 colors->InsertNextTupleValue(colorLine);
924 if ( (x > xMin || y > yMin) && *(currentPixel-1) < doseValue)
926 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
927 vtkIdType p2 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
928 lines->InsertNextCell(2);
929 lines->InsertCellPoint(p1);
930 lines->InsertCellPoint(p2);
931 colors->InsertNextTupleValue(colorLine);
935 if ( (y < yMax || (x < xMax) ) && *(currentPixel+1) < doseValue)
937 vtkIdType p1 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
938 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
939 lines->InsertNextCell(2);
940 lines->InsertCellPoint(p1);
941 lines->InsertCellPoint(p2);
942 colors->InsertNextTupleValue(colorLine);
950 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
951 vtkIdType p2 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
952 lines->InsertNextCell(2);
953 lines->InsertCellPoint(p1);
954 lines->InsertCellPoint(p2);
955 colors->InsertNextTupleValue(colorLine);
961 vtkIdType p1 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
962 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
963 lines->InsertNextCell(2);
964 lines->InsertCellPoint(p1);
965 lines->InsertCellPoint(p2);
966 colors->InsertNextTupleValue(colorLine);
972 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
973 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], y*localStorage->m_mmPerPixel[1], depth);
974 lines->InsertNextCell(2);
975 lines->InsertCellPoint(p1);
976 lines->InsertCellPoint(p2);
977 colors->InsertNextTupleValue(colorLine);
983 vtkIdType p1 = points->InsertNextPoint(x*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
984 vtkIdType p2 = points->InsertNextPoint((x+1)*localStorage->m_mmPerPixel[0], (y+1)*localStorage->m_mmPerPixel[1], depth);
985 lines->InsertNextCell(2);
986 lines->InsertCellPoint(p1);
987 lines->InsertCellPoint(p2);
988 colors->InsertNextTupleValue(colorLine);
1009 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
1012 vtkSmartPointer<vtkMatrix4x4> matrix = localStorage->
m_Reslicer->GetResliceAxes();
1013 trans->SetMatrix(matrix);
1015 localStorage->
m_Actor->SetUserTransform(trans);
1019 if ( localStorage->
m_Actors->GetNumberOfPaths() > 1 )
1021 vtkActor* secondaryActor =
dynamic_cast<vtkActor*
>( localStorage->
m_Actors->GetParts()->GetItemAsObject(0) );
1022 secondaryActor->SetUserTransform(trans);
1031 if ( renderingGeometry == NULL || imageGeometry == NULL )
1036 for(
int i=1; i<8; i++ )
1044 if ( initialDistance * distance < 0 )
1060 : m_VectorComponentExtractor(vtkSmartPointer<vtkImageExtractComponents>::
New())
1102 outlineShadowActor->SetMapper(
m_Mapper );
1104 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()
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 ...
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. ...
itk::SmartPointer< Self > Pointer
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
ScalarType GetLowerWindowBound() const
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
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 ...
static const std::string REFERENCE_DOSE_PROPERTY_NAME
virtual DoseValueType GetDoseValue() const
virtual bool IsValid() const
Is this BaseGeometry in a state that is valid?
std::string GetPixelTypeAsString() const
Returns a string containing the ITK pixel type name.
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...
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
virtual void Update(mitk::BaseRenderer *renderer)
Checks whether this mapper needs to update itself and generate data.
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)
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
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.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
static const std::string DOSE_ISO_LEVELS_PROPERTY_NAME
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
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.
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...
static bool m_TextureInterpolationActive
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
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...
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Vector3D GetNormal() const
Normal of the plane.
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)
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
The LevelWindow class Class to store level/window values.
float CalculateLayerDepth(mitk::BaseRenderer *renderer)
This method uses the vtkCamera clipping range and the layer property to calcualte the depth of the ob...
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer)
The ColorProperty class RGB color property.
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Stores values needed for the representation/visualization of dose iso levels.
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.
Property class for dose iso level vector.
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
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.
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
void ApplyOpacity(mitk::BaseRenderer *renderer)
Set the opacity of the actor.
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
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.
::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.
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
bool HasReferenceGeometry() const
~LocalStorage()
Default deconstructor of the local storage.
virtual ColorType GetColor() 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.
virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer)
Does the actual resampling, without rendering the image yet. All the data is generated inside this me...
virtual ~DoseImageVtkMapper2D()
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 > 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...
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
virtual void UpdateOutputInformation() override
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.
LocalStorage()
Default constructor of the local storage.
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.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=NULL, bool overwrite=false)
Set the default properties for general image rendering.
Class for nodes of the DataTree.
Class for defining the data type of pixels.
virtual IdType GetValueAsId() const
vtkSmartPointer< vtkPropAssembly > m_Actors
virtual T GetValue() const
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.