NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkSurfaceReconstruction.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef SurfaceReconstruction_h
16 #define SurfaceReconstruction_h
17 
18 #include "niftkSurfReconExports.h"
19 #include <mitkDataStorage.h>
20 #include <mitkImage.h>
21 #include <itkObject.h>
22 #include <itkObjectFactoryBase.h>
23 #include <mitkGenericProperty.h>
24 //#include <opencv2/core/core.hpp>
25 #include <itkMatrix.h>
26 #include <niftkUndistortion.h>
27 
28 // forward-decl
29 namespace niftk
30 {
31 class SequentialCpuQds;
32 }
33 
34 namespace niftk
35 {
36 
37 // used for stereo-rig transformation, i.e. between left and right camera
38 // FIXME: sticking in an opencv matrix would be prefered
39 typedef mitk::GenericProperty<itk::Matrix<float, 4, 4> > MatrixProperty;
40 
41 
46 class NIFTKSURFRECON_EXPORT SurfaceReconstruction : public itk::Object
47 {
48 public:
49  enum Method
50  {
51  SEQUENTIAL_CPU = 0,
52  PYRAMID_PARALLEL_CPU = 1,
53  PYRAMID_PARALLEL_CUDA
54  };
55 
63  static bool GetMethodDetails(int index, Method* id, std::string* friendlyname);
64 
68  static Method ParseMethodName(const std::string& friendlyname);
69 
70 
72  {
73  MITK_POINT_CLOUD = 1,
74  PCL_POINT_CLOUD = 2, // BEWARE: may not be compiled in!
75  DISPARITY_IMAGE = 3
76  };
77 
78 public:
79 
80  mitkClassMacroItkParent(SurfaceReconstruction, itk::Object)
81  itkNewMacro(SurfaceReconstruction)
82 
96  mitk::BaseData::Pointer Run(
97  const mitk::Image::Pointer image1,
98  const mitk::Image::Pointer image2,
99  Method method,
100  OutputType outputtype,
101  const mitk::DataNode::Pointer camnode,
102  float maxTriangulationError,
103  float minDepth,
104  float maxDepth,
105  bool bakeCameraTransform);
106 
108  struct ParamPacket
109  {
110  mitk::DataStorage::Pointer dataStorage;
111  mitk::DataNode::Pointer outputNode;
112  mitk::Image::Pointer image1;
113  mitk::Image::Pointer image2;
116  mitk::DataNode::Pointer camnode;
118  float minDepth;
119  float maxDepth;
121 
123  {
124  }
125  };
126 
127  mitk::BaseData::Pointer Run(ParamPacket params);
128 
129 protected:
130 
131  SurfaceReconstruction(); // Purposefully hidden.
132  virtual ~SurfaceReconstruction(); // Purposefully hidden.
133 
134  SurfaceReconstruction(const SurfaceReconstruction&); // Purposefully not implemented.
135  SurfaceReconstruction& operator=(const SurfaceReconstruction&); // Purposefully not implemented.
136 
137 private:
138  SequentialCpuQds* m_SequentialCpuQds;
139 
140 }; // end class
141 
142 } // end namespace
143 
144 #endif // niftkSurfaceReconstruction_h
float maxTriangulationError
Definition: niftkSurfaceReconstruction.h:117
mitk::DataStorage::Pointer dataStorage
Definition: niftkSurfaceReconstruction.h:110
Definition: niftkSurfaceReconstruction.h:108
mitk::GenericProperty< itk::Matrix< float, 4, 4 > > MatrixProperty
Definition: niftkSurfaceReconstruction.h:39
ParamPacket()
Definition: niftkSurfaceReconstruction.h:122
const GLfloat * params
Definition: glew.h:1515
Definition: ReceptorMemberCommandTest.cxx:25
Takes image data, and calculates a surface reconstruction, and write a point cloud to mitk::DataStora...
Definition: niftkSurfaceReconstruction.h:46
float maxDepth
Definition: niftkSurfaceReconstruction.h:119
Method
Definition: niftkSurfaceReconstruction.h:49
mitk::DataNode::Pointer outputNode
Definition: niftkSurfaceReconstruction.h:111
mitk::DataNode::Pointer camnode
Definition: niftkSurfaceReconstruction.h:116
Method method
Definition: niftkSurfaceReconstruction.h:114
float minDepth
Definition: niftkSurfaceReconstruction.h:118
OutputType
Definition: niftkSurfaceReconstruction.h:71
mitk::Image::Pointer image1
Definition: niftkSurfaceReconstruction.h:112
GLuint index
Definition: glew.h:1798
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
Definition: niftkSequentialCpuQds.h:66
bool bakeCameraTransform
Definition: niftkSurfaceReconstruction.h:120
Definition: niftkExceptionObject.h:21
OutputType outputtype
Definition: niftkSurfaceReconstruction.h:115
GLsizei const GLcharARB ** string
Definition: glew.h:5194
mitk::Image::Pointer image2
Definition: niftkSurfaceReconstruction.h:113