NorMIT-nav  2023.01.05-dev+develop.0da12
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_ */
cx::ReconstructCore::InputParams::mExtraTimeCalibration
double mExtraTimeCalibration
Definition: cxReconstructCore.h:52
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::ReconstructCore::InputParams::InputParams
InputParams()
Definition: cxReconstructCore.h:43
cx::ReconstructCorePtr
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
Definition: cxReconstructCore.h:23
cx::ProcessedUSInputDataPtr
boost::shared_ptr< class ProcessedUSInputData > ProcessedUSInputDataPtr
Definition: cxReconstructionMethodService.h:36
cxForwardDeclarations.h
cx::ReconstructCore::InputParams::mMaxOutputVolumeSize
double mMaxOutputVolumeSize
Definition: cxReconstructCore.h:66
vtkImageDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Definition: cxVideoConnectionWidget.h:30
cx::ReconstructCore::InputParams::mAlgorithmUid
QString mAlgorithmUid
Definition: cxReconstructCore.h:59
cx::ReconstructCore::InputParams::mShaderPath
QString mShaderPath
name of shader folder
Definition: cxReconstructCore.h:63
cx::ReconstructionMethodService
Abstract interface for reconstruction algorithm.
Definition: cxReconstructionMethodService.h:54
cxBoundingBox3D.h
cx::ReconstructCore::InputParams::mMaskReduce
double mMaskReduce
Definition: cxReconstructCore.h:56
cx::ReconstructCore::InputParams::mAlignTimestamps
bool mAlignTimestamps
Definition: cxReconstructCore.h:53
cx::ReconstructCore::InputParams
Definition: cxReconstructCore.h:41
cx::ReconstructCore::InputParams::mTransferFunctionPreset
QString mTransferFunctionPreset
Definition: cxReconstructCore.h:65
cx::ReconstructCore::InputParams::mOrientation
QString mOrientation
Definition: cxReconstructCore.h:57
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::ReconstructCore::getInputParams
InputParams getInputParams()
Definition: cxReconstructCore.h:82
cx::ReconstructCore::InputParams::mPosFilterStrength
unsigned mPosFilterStrength
Definition: cxReconstructCore.h:55
cx::OutputVolumeParams
Helper struct for sending and controlling output volume properties.
Definition: cxReconstructedOutputVolumeParams.h:39
cx::ReconstructCore
Algorithm part of reconstruction - no dependencies on parameter classes.
Definition: cxReconstructCore.h:35
cx::ReconstructCore::InputParams::mPositionThinning
bool mPositionThinning
Definition: cxReconstructCore.h:54
cxReconstructedOutputVolumeParams.h
cx::ReconstructCore::InputParams::mAngio
bool mAngio
true for angio data, false is B-mode.
Definition: cxReconstructCore.h:64
cx::ReconstructCore::InputParams::mAlgoSettings
QDomElement mAlgoSettings
Definition: cxReconstructCore.h:60