Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXRECONSTRUCTCORE_H_
34 #define CXRECONSTRUCTCORE_H_
35 
36 #include "org_custusx_usreconstruction_Export.h"
37 
38 #include "cxBoundingBox3D.h"
39 #include "cxForwardDeclarations.h"
41 
42 namespace cx
43 {
45 //typedef class ReconstructionMethodService* ReconstructionMethodServicePtr;
46 
47 typedef boost::shared_ptr<class ReconstructCore> ReconstructCorePtr;
48 
56 class org_custusx_usreconstruction_EXPORT ReconstructCore
57 {
58 public:
62  struct InputParams
63  {
65  mExtraTimeCalibration(0),
66  mAlignTimestamps(false),
67  mMaskReduce(0),
68  mAngio(false),
69  mMaxOutputVolumeSize(1024*1024)
70  {}
73  double mMaskReduce;
74  QString mOrientation;
75 
76  QString mAlgorithmUid;
77  QDomElement mAlgoSettings;
78 // QString mOutputRelativePath;///< Relative path to the output image
79 // QString mOutputBasePath;///< Global path where the relative path starts, for the output image
80  QString mShaderPath;
81  bool mAngio;
84  };
85 
86  ReconstructCore(PatientModelServicePtr patientModelService);
87  virtual ~ReconstructCore();
88 
89  // used for reconstruction algo
90  void initialize(InputParams input, ReconstructionMethodService* algorithm);
91  void initialize(ProcessedUSInputDataPtr fileData, OutputVolumeParams outputVolumeParams);
92  ImagePtr reconstruct();
93  void threadedPreReconstruct();
94  void threadedReconstruct();
95  void threadedPostReconstruct();
96  ImagePtr getOutput();
97 
98  // published helper methods, also needed for parameter display outside of reconstruction execution:
99  InputParams getInputParams() { return mInput; }
100 
101 private:
102  bool validInputData() const;
103  QString generateOutputUid();
104  QString generateImageName(QString uid) const;
105 
106  vtkImageDataPtr generateRawOutputVolume();
107  ImagePtr generateOutputVolume(vtkImageDataPtr rawOutput);
108 
109  // input data
110  InputParams mInput;
111  ProcessedUSInputDataPtr mFileData;
112 
113  // generated data
114  ReconstructionMethodService* mAlgorithm;
115  vtkImageDataPtr mRawOutput;
116  ImagePtr mOutput;
117  OutputVolumeParams mOutputVolumeParams;
118  bool mSuccess;
119  PatientModelServicePtr mPatientModelService;
120 };
121 
122 } /* namespace cx */
123 #endif /* CXRECONSTRUCTCORE_H_ */
Abstract interface for reconstruction algorithm.
QString mShaderPath
name of shader folder
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:48
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