CustusX  18.04
An IGT application
cxReconstructCore.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 
12 #ifndef CXRECONSTRUCTCORE_H_
13 #define CXRECONSTRUCTCORE_H_
14 
15 #include "org_custusx_usreconstruction_Export.h"
16 
17 #include "cxBoundingBox3D.h"
18 #include "cxForwardDeclarations.h"
20 
21 namespace cx
22 {
24 //typedef class ReconstructionMethodService* ReconstructionMethodServicePtr;
25 
26 typedef boost::shared_ptr<class ReconstructCore> ReconstructCorePtr;
27 
35 class org_custusx_usreconstruction_EXPORT ReconstructCore
36 {
37 public:
41  struct InputParams
42  {
44  mExtraTimeCalibration(0),
45  mAlignTimestamps(false),
46  mPositionThinning(false),
47  mPosFilterStrength(0),
48  mMaskReduce(0),
49  mAngio(false),
50  mMaxOutputVolumeSize(1024*1024)
51  {}
56  double mMaskReduce;
57  QString mOrientation;
58 
59  QString mAlgorithmUid;
60  QDomElement mAlgoSettings;
61 // QString mOutputRelativePath;///< Relative path to the output image
62 // QString mOutputBasePath;///< Global path where the relative path starts, for the output image
63  QString mShaderPath;
64  bool mAngio;
67  };
68 
69  ReconstructCore(PatientModelServicePtr patientModelService);
70  virtual ~ReconstructCore();
71 
72  // used for reconstruction algo
73  void initialize(InputParams input, ReconstructionMethodService* algorithm);
74  void initialize(ProcessedUSInputDataPtr fileData, OutputVolumeParams outputVolumeParams);
75  ImagePtr reconstruct();
76  void threadedPreReconstruct();
77  void threadedReconstruct();
78  void threadedPostReconstruct();
79  ImagePtr getOutput();
80 
81  // published helper methods, also needed for parameter display outside of reconstruction execution:
82  InputParams getInputParams() { return mInput; }
83 
84 private:
85  bool validInputData() const;
86  QString generateOutputUid();
87  QString generateImageName(QString uid) const;
88 
89  vtkImageDataPtr generateRawOutputVolume();
90  ImagePtr generateOutputVolume(vtkImageDataPtr rawOutput);
91 
92  // input data
93  InputParams mInput;
94  ProcessedUSInputDataPtr mFileData;
95 
96  // generated data
97  ReconstructionMethodService* mAlgorithm;
98  vtkImageDataPtr mRawOutput;
99  ImagePtr mOutput;
100  OutputVolumeParams mOutputVolumeParams;
101  bool mSuccess;
102  PatientModelServicePtr mPatientModelService;
103 };
104 
105 } /* namespace cx */
106 #endif /* CXRECONSTRUCTCORE_H_ */
Abstract interface for reconstruction algorithm.
QString mShaderPath
name of shader folder
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
Helper struct for sending and controlling output volume properties.
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
InputParams getInputParams()
bool mAngio
true for angio data, false is B-mode.
boost::shared_ptr< class ProcessedUSInputData > ProcessedUSInputDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Algorithm part of reconstruction - no dependencies on parameter classes.
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
Namespace for all CustusX production code.