CustusX  22.04-rc5
An IGT application
cxtestSyntheticVolumeComparer.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXTESTSYNTHETICVOLUMECOMPARER_H
12 #define CXTESTSYNTHETICVOLUMECOMPARER_H
13 
14 #include "cxtestutilities_export.h"
16 
17 namespace cxtest
18 {
19 typedef boost::shared_ptr<class SyntheticVolumeComparer> SyntheticVolumeComparerPtr;
20 
33 class CXTESTUTILITIES_EXPORT SyntheticVolumeComparer
34 {
35 public:
37  void setPhantom(cx::cxSyntheticVolumePtr phantom);
38  void setTestImage(cx::ImagePtr image);
39 
40  void checkRMSBelow(double threshold);
41  void checkCentroidDifferenceBelow(double val);
42  void checkMassDifferenceBelow(double val);
43  void checkValueWithin(cx::Vector3D p_r, int lowerLimit, int upperLimit);
44 
45  void saveNominalOutputToFile(QString filename, cx::FileManagerServicePtr port);
46  void saveOutputToFile(QString filename, cx::FileManagerServicePtr port);
47 
48  void setVerbose(bool val) { mVerbose = val; }
49  bool getVerbose() const { return mVerbose; }
50 
51 private:
52  double getValue(cx::ImagePtr image, cx::Vector3D p_r);
53  cx::ImagePtr getNominalOutputImage() const;
54  QString addFullPath(QString filename);
55  double getRMS() const;
56 
57  cx::cxSyntheticVolumePtr mPhantom;
58  cx::ImagePtr mTestImage;
59  mutable cx::ImagePtr mNominalImage;
60  bool mVerbose;
61 };
62 
63 
64 } // namespace cxtest
65 
66 
67 
68 #endif // CXTESTSYNTHETICVOLUMECOMPARER_H
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
boost::shared_ptr< cxSyntheticVolume > cxSyntheticVolumePtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
boost::shared_ptr< class SyntheticVolumeComparer > SyntheticVolumeComparerPtr