NorMIT-nav  22.09
An IGT application
cxReconstructPreprocessor.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 CXRECONSTRUCTPREPROCESSOR_H_
13 #define CXRECONSTRUCTPREPROCESSOR_H_
14 
15 #include "org_custusx_usreconstruction_Export.h"
16 
17 #include "cxBoundingBox3D.h"
19 #include "cxReconstructCore.h"
21 
22 namespace cx
23 {
24 typedef boost::shared_ptr<class ReconstructPreprocessor> ReconstructPreprocessorPtr;
25 
33 class org_custusx_usreconstruction_EXPORT ReconstructPreprocessor
34 {
35 public:
37  virtual ~ReconstructPreprocessor();
38 
39  // used for reconstruction algo
40  void initialize(ReconstructCore::InputParams input, USReconstructInputData fileData);
41  OutputVolumeParams getOutputVolumeParams() { return mOutputVolumeParams; }
43 
44  std::vector<ProcessedUSInputDataPtr> createProcessedInput(std::vector<bool> angio);
45 
46 private:
47  void cropInputData();
48  IntBoundingBox3D reduceCropboxToImageSize(IntBoundingBox3D cropbox, QSize size);
49  void updateFromOriginalFileData();
50  void findExtentAndOutputTransform();
51  Transform3D applyOutputOrientation();
52  std::vector<Vector3D> generateInputRectangle();
53  void interpolatePositions();
54  double timeToPosition(unsigned i_frame, unsigned i_pos);
55  void filterPositions(); // Noise-supressing position filter, averaging filter, configurable length
56  void positionThinning(); // If enabled, try to remove "suspect" data (large jumps etc.)
57  void applyTimeCalibration();
58  void alignTimeSeries();
59  void calibrateTimeStamps(double offset, double scale);
60 
61  // input data
63  USReconstructInputData mFileData;
64  double mMaxTimeDiff;
65 
66  // generated data
67  OutputVolumeParams mOutputVolumeParams;
68 
69  PatientModelServicePtr mPatientModelService;
70  void convertToQuaternions(Eigen::ArrayXXd qPosArray, int nQuaternions, int nPositions, int filterStrength);
71  Eigen::ArrayXXd filterQuaternionArray(Eigen::ArrayXXd qPosArray, int nPositions, int filterLength);
72  void convertFromQuaternion(Eigen::ArrayXXd qPosFiltered);
73 };
74 
75 } /* namespace cx */
76 
77 #endif // CXRECONSTRUCTPREPROCESSOR_H_
cx::ReconstructPreprocessorPtr
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
Definition: cxReconstructPreprocessor.h:24
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::ReconstructPreprocessor::getOutputVolumeParams
OutputVolumeParams getOutputVolumeParams()
Definition: cxReconstructPreprocessor.h:41
cxBoundingBox3D.h
cxUSReconstructInputData.h
cx::IntBoundingBox3D
Representation of an integer bounding box in 3D. The data are stored as {xmin,xmax,...
Definition: cxBoundingBox3D.h:38
cx::ReconstructCore::InputParams
Definition: cxReconstructCore.h:41
cx::ReconstructPreprocessor::getInputParams
ReconstructCore::InputParams getInputParams()
Definition: cxReconstructPreprocessor.h:42
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ReconstructPreprocessor
Algorithm part of reconstruction - no dependencies on parameter classes.
Definition: cxReconstructPreprocessor.h:33
cxReconstructCore.h
cx::OutputVolumeParams
Helper struct for sending and controlling output volume properties.
Definition: cxReconstructedOutputVolumeParams.h:39
cx::USReconstructInputData
Definition: cxUSReconstructInputData.h:48
cxReconstructedOutputVolumeParams.h