21 #include <vtkTextProperty.h>
28 , m_DistanceImage(NULL)
29 , m_CameraIntrinsics(NULL)
30 , m_VtkTextActor(NULL)
31 , m_ForegroundRenderer1(NULL)
32 , m_ForegroundRenderer2(NULL)
33 , m_ForegroundRenderer3(NULL)
34 , m_RenderWindow1(NULL)
35 , m_RenderWindow2(NULL)
36 , m_RenderWindow3(NULL)
37 , m_MeasurementPointSet2D(NULL)
38 , m_MeasurementPointSet3DNode(NULL)
40 , m_PointSet3DNode(NULL)
41 , m_PointSetInteractor(NULL)
42 , m_MeasurementPointSetInteractor(NULL)
43 , m_MeasurementPointSetChangedObserverTag(0)
44 , m_PointSetChangedObserverTag(0)
61 m_Controls =
new Ui::QmitkToFPointSetWidgetControls;
73 connect( (QObject*)(
m_Controls->pointSetButton), SIGNAL(clicked()),(QObject*)
this, SLOT(
OnPointSet()) );
83 m_RenderWindow1 = renderWindowHashMap.value(
"axial")->GetRenderWindow();
84 m_RenderWindow2 = renderWindowHashMap.value(
"sagittal")->GetRenderWindow();
85 m_RenderWindow3 = renderWindowHashMap.value(
"coronal")->GetRenderWindow();
94 this->
m_VtkTextActor->SetInput(
"Choose measurement points with SHIFT+Click");
95 m_WindowHeight = renderWindowHashMap.value(
"axial")->GetRenderer()->GetSizeY();
120 if(dataStorage->Exists(measurementPointSet2DNode))
122 dataStorage->Remove(measurementPointSet2DNode);
127 measurementPointSet2DNode->SetName(
"Measurement PointSet 2D");
128 measurementPointSet2DNode->SetBoolProperty(
"helper object",
true);
129 measurementPointSet2DNode->SetBoolProperty(
"show contour",
true);
130 measurementPointSet2DNode->SetVisibility(
false, renderWindowHashMap.value(
"3d")->GetRenderer());
132 dataStorage->Add(measurementPointSet2DNode);
161 if(dataStorage->Exists(pointSet2DNode))
163 dataStorage->Remove(pointSet2DNode);
167 pointSet2DNode->SetName(
"ToF PointSet 2D");
168 pointSet2DNode->SetVisibility(
false, renderWindowHashMap.value(
"3d")->GetRenderer());
170 dataStorage->Add(pointSet2DNode);
183 if(dataStorage->Exists(pointSet3DNode))
185 dataStorage->Remove(pointSet3DNode);
206 m_Controls->pointSetButton->setChecked(
false);
277 if (pointSetNode.IsNotNull())
279 pointSetNode->SetIntProperty(
"layer",100);
286 m_Controls->pointSetButton->setChecked(
false);
292 this->
m_VtkTextActor->SetInput(
"Choose measurement points with SHIFT+Click");
311 if (pointSetNode.IsNotNull())
313 pointSetNode->SetIntProperty(
"layer",100);
352 if ((point1[0]>=0.0f)&&(point1[0]<imageSizeX)&&(point1[1]>=0)&&(point1[1]<imageSizeY)&&
353 (point2[0]>=0.0f)&&(point2[0]<imageSizeX)&&(point2[1]>=0)&&(point2[1]<imageSizeY))
363 toFDistanceImageToPointSetFilter->Update();
368 if (measurementPointSet3D->GetSize()==2)
372 float distance = point1.EuclideanDistanceTo(point2);
373 std::stringstream stream;
374 stream<<distance<<
" mm";
379 this->
m_VtkTextActor->SetInput(
"Choose measurement points with SHIFT+Click");
384 this->
m_VtkTextActor->SetInput(
"Measurement outside image range.");
401 int pointSetValid = 1;
405 if ((currentPoint[0]>=0.0f)&&(currentPoint[0]<imageSizeX)&&(currentPoint[1]>=0)&&(currentPoint[1]<imageSizeY))
425 toFDistanceImageToPointSetFilter->SetSubset(
m_PointSet2D);
426 toFDistanceImageToPointSetFilter->Update();
429 this->
m_VtkTextActor->SetInput(
"Choose points with SHIFT+Click"); }
itk::SmartPointer< Self > Pointer
void InsertForegroundRenderer(vtkSmartPointer< vtkRenderer > renderer, bool forceAbsoluteForeground)
static VtkLayerController * GetInstance(vtkSmartPointer< vtkRenderWindow > renWin)
mitk::DataStorage::Pointer m_DataStorage
static RenderingManager * GetInstance()
void RemoveRenderer(vtkSmartPointer< vtkRenderer > renderer)
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.