MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkKinectV2DeviceFactory.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12#ifndef mitkKinectV2DeviceFactory_h
13#define mitkKinectV2DeviceFactory_h
14
15#include <MitkKinectV2Exports.h>
16#include "mitkKinectV2Device.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
29namespace mitk
30{
37 class MITKKINECTV2_EXPORT KinectV2DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
38
39 public:
40
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 {
92 us::Module* module = us::GetModuleContext()->GetModule();
93 return module->GetResource("CalibrationFiles/KinectV2_IR_camera.xml");
94 }
95 };
96}
97#endif
KinectDeviceFactory is an implementation of the factory pattern to generate Microsoft Kinect V2 devic...
std::string GetFactoryName()
GetFactoryName Get the name of the factory.
std::string GetDeviceNamePrefix()
GetDeviceNamePrefix Main part of a device name.
IGT Exceptions.
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in t...