Fraxinus  2023.01.05-dev+develop.0da12
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_
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
ReconstructCore::InputParams getInputParams()
Helper struct for sending and controlling output volume properties.
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
OutputVolumeParams getOutputVolumeParams()
Representation of an integer bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Algorithm part of reconstruction - no dependencies on parameter classes.
Namespace for all CustusX production code.