Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef __mitkKinectV2DeviceFactory_h
17 #define __mitkKinectV2DeviceFactory_h
18 
19 #include <MitkKinectV2Exports.h>
20 #include "mitkKinectV2Device.h"
22 #include <mitkCameraIntrinsics.h>
24 
25 // Microservices
26 #include <usServiceRegistration.h>
27 #include <usModuleContext.h>
28 #include <usGetModuleContext.h>
29 #include <usModule.h>
30 #include <usModuleResource.h>
31 #include <usModuleResourceStream.h>
32 
33 namespace mitk
34 {
41  class MITKKINECTV2_EXPORT KinectV2DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
42 
43  public:
44 
46  {
47  }
48 
53  std::string GetFactoryName()
54  {
55  return std::string("Kinect V2 Factory");
56  }
66  std::string GetDeviceNamePrefix()
67  {
68  return std::string("Kinect V2");
69  }
70 
71  private:
72 
76  ToFCameraDevice::Pointer CreateToFCameraDevice()
77  {
79 
80  device->SetBoolProperty("HasRGBImage", true);
81  device->SetBoolProperty("HasAmplitudeImage", true);
82  device->SetBoolProperty("HasIntensityImage", false);
83  device->SetBoolProperty("KinectReconstructionMode", true);
84  device->SetBoolProperty("RGBImageHasDifferentResolution", true);
85  device->SetBoolProperty("HasSurface", true);
86  device->SetBoolProperty("HasTextureCoordinates", true);
87  device->SetBoolProperty("GenerateTriangularMesh", false);
88 
89  device->SetFloatProperty("TriangulationThreshold", 0.0);
90 
91  return device.GetPointer();
92  }
93 
94  us::ModuleResource GetIntrinsicsResource()
95  {
97  return module->GetResource("CalibrationFiles/KinectV2_IR_camera.xml");
98  }
99  };
100 }
101 #endif
itk::SmartPointer< Self > Pointer
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...
Module * GetModule() const
ModuleResource GetResource(const std::string &path) const
Definition: usModule.cpp:267
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.