Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkKinectDeviceFactory.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 __mitkKinectDeviceFactory_h
13 #define __mitkKinectDeviceFactory_h
14 
15 #include <MitkKinectExports.h>
16 #include "mitkKinectDevice.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 MITKKINECT_EXPORT KinectDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
38 
39  public:
40 
46  {
47  }
51  std::string GetFactoryName()
52  {
53  return std::string("Kinect Factory");
54  }
55 
59  std::string GetDeviceNamePrefix()
60  {
61  return std::string("Kinect");
62  }
63 
64  private:
65 
69  ToFCameraDevice::Pointer CreateToFCameraDevice()
70  {
71  KinectDevice::Pointer device = KinectDevice::New();
72 
73  device->SetBoolProperty("HasRGBImage", true);
74  device->SetBoolProperty("HasAmplitudeImage", false);
75  device->SetBoolProperty("HasIntensityImage", false);
76  device->SetBoolProperty("KinectReconstructionMode", true);
77 
78  return device.GetPointer();
79  }
80 
88  us::ModuleResource GetIntrinsicsResource()
89  {
91  return module->GetResource("CalibrationFiles/Kinect_RGB_camera.xml");
92  }
93  };
94 }
95 #endif
std::string GetDeviceNamePrefix()
GetDeviceNamePrefix Main part of a device name.
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.
KinectDeviceFactory()
KinectDeviceFactory Default contructor. This factory internally counts all kinect devices starting at...
KinectDeviceFactory is an implementation of the factory pattern to generate Microsoft Kinect devices...
Module * GetModule() const
ModuleResource GetResource(const std::string &path) const
Definition: usModule.cpp:267
std::string GetFactoryName()
Get the name of the factory, here for the Kinect.
static Pointer New()
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.