Medical Imaging Interaction Toolkit  2021.02.99-19049835
Medical Imaging Interaction Toolkit
mitkKinectV2DeviceFactory.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef __mitkKinectV2DeviceFactory_h
13 #define __mitkKinectV2DeviceFactory_h
14 
15 #include <MitkKinectV2Exports.h>
16 #include "mitkKinectV2Device.h"
18 #include <mitkCameraIntrinsics.h>
20 
21 // Microservices
22 #include <usServiceRegistration.h>
23 #include <usModuleContext.h>
24 #include <usGetModuleContext.h>
25 #include <usModule.h>
26 #include <usModuleResource.h>
27 #include <usModuleResourceStream.h>
28 
29 namespace mitk
30 {
37  class MITKKINECTV2_EXPORT KinectV2DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
38 
39  public:
40 
42  {
43  }
44 
49  std::string GetFactoryName()
50  {
51  return std::string("Kinect V2 Factory");
52  }
62  std::string GetDeviceNamePrefix()
63  {
64  return std::string("Kinect V2");
65  }
66 
67  private:
68 
72  ToFCameraDevice::Pointer CreateToFCameraDevice()
73  {
74  KinectV2Device::Pointer device = KinectV2Device::New();
75 
76  device->SetBoolProperty("HasRGBImage", true);
77  device->SetBoolProperty("HasAmplitudeImage", true);
78  device->SetBoolProperty("HasIntensityImage", false);
79  device->SetBoolProperty("KinectReconstructionMode", true);
80  device->SetBoolProperty("RGBImageHasDifferentResolution", true);
81  device->SetBoolProperty("HasSurface", true);
82  device->SetBoolProperty("HasTextureCoordinates", true);
83  device->SetBoolProperty("GenerateTriangularMesh", false);
84 
85  device->SetFloatProperty("TriangulationThreshold", 0.0);
86 
87  return device.GetPointer();
88  }
89 
90  us::ModuleResource GetIntrinsicsResource()
91  {
93  return module->GetResource("CalibrationFiles/KinectV2_IR_camera.xml");
94  }
95  };
96 }
97 #endif
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in t...
DataCollection - Class to facilitate loading/accessing structured data.
static Pointer New()
std::string GetDeviceNamePrefix()
GetDeviceNamePrefix Main part of a device name.
std::string GetFactoryName()
GetFactoryName Get the name of the factory.
KinectDeviceFactory is an implementation of the factory pattern to generate Microsoft Kinect V2 devic...
ModuleResource GetResource(const std::string &path) const
Module * GetModule() const
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.