MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkUSNavigationStepCtUsRegistration.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13#ifndef QmitkUSNavigationStepCtUsRegistration_h
14#define QmitkUSNavigationStepCtUsRegistration_h
15
17
18#include <mitkNodePredicateDataType.h>
19#include <mitkNodePredicateAnd.h>
20#include <mitkNodePredicateOr.h>
21
22#include <mitkPointSet.h>
23#include <mitkImage.h>
24#include <mitkPlaneFit.h>
25
26#include <itkImage.h>
27#include <itkThresholdImageFilter.h>
28#include <itkBinaryThresholdImageFilter.h>
29#include <itkGradientMagnitudeImageFilter.h>
30#include <itkLaplacianRecursiveGaussianImageFilter.h>
31#include "itkVotingBinaryIterativeHoleFillingImageFilter.h"
32#include <itkBinaryImageToShapeLabelMapFilter.h>
33
34namespace itk {
35template<class T> class SmartPointer;
36
37}
38
39namespace mitk {
40class NodeDisplacementFilter;
41class NavigationDataSource;
42class PlaneFit;
43class FloatingImageToUltrasoundRegistrationFilter;
44}
45
46namespace Ui {
48}
49
50// Declare typedefs:
51typedef itk::Image<int, 3> ImageType;
52typedef itk::ThresholdImageFilter<ImageType> ThresholdImageFilterType;
53typedef itk::BinaryThresholdImageFilter <ImageType, ImageType> BinaryThresholdImageFilterType;
54typedef itk::LaplacianRecursiveGaussianImageFilter<ImageType, ImageType> LaplacianRecursiveGaussianImageFilterType;
55typedef itk::VotingBinaryIterativeHoleFillingImageFilter<ImageType> VotingBinaryIterativeHoleFillingImageFilterType;
56typedef itk::BinaryImageToShapeLabelMapFilter<ImageType> BinaryImageToShapeLabelMapFilterType;
68{
69 Q_OBJECT
70
71public:
72 explicit QmitkUSNavigationStepCtUsRegistration(QWidget *parent = nullptr);
74
79 bool OnStartStep() override;
80
85 bool OnStopStep() override;
86
91 bool OnFinishStep() override;
92
98 bool OnActivateStep() override;
99
100 bool OnDeactivateStep() override;
101
105 void OnUpdate() override;
106
110 void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
111
112 QString GetTitle() override;
113
117 FilterVector GetFilter() override;
118
119 void OnCalculateTRE(mitk::Point3D centroidOfTargetInUSImage);
120
121signals:
124
125protected:
126 void OnSetCombinedModality() override;
127
129 void SetFloatingImageGeometryInformation(mitk::Image* image);
130 double GetVoxelVolume();
131 double GetFiducialVolume(double radius);
132
133 bool FilterFloatingImage();
135
141
142 //Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation
147 double CalculateMeanFRE();
148 double CalculateStandardDeviationOfFRE(double meanFRE);
150 // End methods Ground-Truth-Protocol
151
152 void EliminateTooSmallLabeledObjects( ImageType::Pointer binaryImage);
157 void CalculateDistancesBetweenFiducials(std::vector<std::vector<double>> &distanceVectorsFiducials);
158 bool FindFiducialNo1(std::vector<std::vector<double>> &distanceVectorsFiducials);
159 bool FindFiducialNo2And3();
160 bool FindFiducialNo4(std::vector<std::vector<double>> &distanceVectorsFiducials);
161 bool FindFiducialNo5();
162 bool FindFiducialNo6();
163 bool FindFiducialNo7();
164 bool FindFiducialNo8();
166 void CreateQtPartControl(QWidget *parent);
167
168protected slots:
169 void OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode* node);
171 void OnLocalizeFiducials();
173 void OnFreeze();
175 void OnGetCursorPosition();
176
177 void OnCalculateCenter();
178
179 //Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation
180 void OnAddCtImageClicked();
183
184private:
185 Ui::QmitkUSNavigationStepCtUsRegistration *ui;
186
187 mitk::NodePredicateAnd::Pointer m_IsOfTypeImagePredicate;
188 mitk::NodePredicateOr::Pointer m_IsASegmentationImagePredicate;
189 mitk::NodePredicateAnd::Pointer m_IsAPatientImagePredicate;
190 mitk::TNodePredicateDataType<mitk::PointSet>::Pointer m_IsAPointSetPredicate;
191 mitk::NodePredicateDataType::Pointer m_IsASurfacePredicate;
192
194 mitk::Image::Pointer m_FloatingImage;
195 mitk::PointSet::Pointer m_MarkerModelCoordinateSystemPointSet;
196 mitk::PointSet::Pointer m_MarkerFloatingImageCoordinateSystemPointSet;
197
198 std::vector<mitk::Image::Pointer> m_ImagesGroundTruthProtocol;
199 bool m_PerformingGroundTruthProtocolEvaluation;
200 std::vector<double> m_GroundTruthProtocolFRE;
201 std::map<int, double> m_GroundTruthProtocolTRE;
202 std::map<int, mitk::Point3D> m_PointsToTransformGroundTruthProtocol;
203 std::map<int, mitk::PointSet::Pointer> m_GroundTruthProtocolTransformedPoints;
204
205 ThresholdImageFilterType::Pointer m_ThresholdFilter;
206 BinaryThresholdImageFilterType::Pointer m_BinaryThresholdFilter;
207 LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter1;
208 LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter2;
209 VotingBinaryIterativeHoleFillingImageFilterType::Pointer m_HoleFillingFilter;
210 BinaryImageToShapeLabelMapFilterType::Pointer m_BinaryImageToShapeLabelMapFilter;
211
212 itk::SmartPointer<mitk::FloatingImageToUltrasoundRegistrationFilter> m_FloatingImageToUltrasoundRegistrationFilter;
213
214 std::vector<mitk::Vector3D> m_CentroidsOfFiducialCandidates;
215 std::map<double, mitk::Vector3D> m_EigenVectorsFiducialCandidates;
216 std::vector<double> m_EigenValuesFiducialCandidates;
217 mitk::Vector3D m_MeanCentroidFiducialCandidates;
218 std::map<int, mitk::Vector3D> m_FiducialMarkerCentroids;
219
220 mitk::AffineTransform3D::Pointer m_TransformMarkerCSToFloatingImageCS;
221
225 mitk::Vector3D m_ImageDimension;
226 mitk::Vector3D m_ImageSpacing;
227
228 bool m_FreezeCombinedModality;
229 mitk::Point3D m_CentroidOfTargetInUSImage;
230
231};
232
233#endif
itk::BinaryImageToShapeLabelMapFilter< ImageType > BinaryImageToShapeLabelMapFilterType
itk::BinaryThresholdImageFilter< ImageType, ImageType > BinaryThresholdImageFilterType
itk::LaplacianRecursiveGaussianImageFilter< ImageType, ImageType > LaplacianRecursiveGaussianImageFilterType
itk::ThresholdImageFilter< ImageType > ThresholdImageFilterType
itk::VotingBinaryIterativeHoleFillingImageFilter< ImageType > VotingBinaryIterativeHoleFillingImageFilterType
itk::Image< int, 3 > ImageType
Abstract base class for navigation step widgets.
std::vector< itk::SmartPointer< mitk::NavigationDataToNavigationDataFilter > > FilterVector
Navigation step for marking risk structures. The user can add risk structures by interacting with the...
void OnCalculateTRE(mitk::Point3D centroidOfTargetInUSImage)
void OnSetCombinedModality() override
Called every time SetCombinedModality() was called. This method may be implemented by a concrete subc...
bool FindFiducialNo4(std::vector< std::vector< double > > &distanceVectorsFiducials)
void EliminateTooSmallLabeledObjects(ImageType::Pointer binaryImage)
bool OnStartStep() override
Initialization of the data storage nodes.
void CalculateDistancesBetweenFiducials(std::vector< std::vector< double > > &distanceVectorsFiducials)
void OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode *node)
QString GetTitle() override
Getter for the title of the navigation step. This title should be human readable and can be used to d...
bool FindFiducialNo1(std::vector< std::vector< double > > &distanceVectorsFiducials)
void OnSettingsChanged(const itk::SmartPointer< mitk::DataNode > settingsNode) override
bool OnFinishStep() override
There is nothing to be done.
bool OnActivateStep() override
Selects input for the node displacement filter and emits "ReadyForNextStep" signal....
bool OnDeactivateStep() override
Called when the navigation step gets deactivated (-> state started). This method may be implemented b...
bool OnStopStep() override
Resets widget and filter and removes nodes from the data storage.
void OnUpdate() override
Updates the tracking validity status and the combined modality.
IGT Exceptions.