Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxPNNReconstructionMethodService.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 CXPNNRECONSTRUCTIONMETHODSERVICE_H_
13 #define CXPNNRECONSTRUCTIONMETHODSERVICE_H_
14 
16 #include "org_custusx_usreconstruction_pnn_Export.h"
17 #include "cxTransform3D.h"
18 class ctkPluginContext;
19 
20 namespace cx
21 {
22 
34 class org_custusx_usreconstruction_pnn_EXPORT PNNReconstructionMethodService : public ReconstructionMethodService
35 {
37 public:
38  PNNReconstructionMethodService(ctkPluginContext* context);
40 
41  virtual QString getName() const;
42 
43  virtual std::vector<PropertyPtr> getSettings(QDomElement root);
44  virtual bool reconstruct(ProcessedUSInputDataPtr input, vtkImageDataPtr outputData, QDomElement settings);
45 
46 
47 private:
48  DoublePropertyPtr getInterpolationStepsOption(QDomElement root);
49  bool validPixel(int x, int y, const Eigen::Array3i& dims, unsigned char* rawPointer)
50  {
51  return (x >= 0) && (x < dims[0]) && (y >= 0) && (y < dims[1]) && (rawPointer[x + y * dims[0]] != 0);
52  }
53 
54  bool validVoxel(int x, int y, int z, const int* dims)
55  {
56  return (x >= 0) && (x < dims[0]) && (y >= 0) && (y < dims[1]) && (z >= 0) && (z < dims[2]);
57  }
58 
59  void interpolate(ImagePtr inputData, vtkImageDataPtr outputData, QDomElement settings);
60  vtkImageDataPtr createMask(vtkImageDataPtr inputData);
61  void fillHole(unsigned char *inputPointer, unsigned char *outputPointer, int x, int y, int z, const Eigen::Array3i& dim, int interpolationSteps);
62 
63 
64 };
65 //typedef boost::shared_ptr<PNNReconstructionMethodService> PNNReconstructionMethodService*;
66 
67 } /* namespace cx */
68 
69 #endif /* CXPNNRECONSTRUCTIONMETHODSERVICE_H_ */
70 
Abstract interface for reconstruction algorithm.
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
Settings * settings()
Shortcut for accessing the settings instance.
Definition: cxSettings.cpp:21
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
boost::shared_ptr< class ProcessedUSInputData > ProcessedUSInputDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Namespace for all CustusX production code.