MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkToFCameraPMDRawDataCamCubeDevice.cpp
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============================================================================*/
14
15// vtk includes
16#include "vtkSmartPointer.h"
17
18namespace mitk
19{
21 {
22 m_Controller = ToFCameraPMDCamCubeController::New();
23 }
24
28
29 void ToFCameraPMDRawDataCamCubeDevice::GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray )
30 {
31 int i = 0;
32 unsigned int channelSize = (this->GetCaptureHeight()*this->GetCaptureWidth()*2);
33 this->SetChannelSize(channelSize);
34 signed short* channel1;
35 signed short* channel2;
36 signed short* channel3;
37 signed short* channel4;
38
40 tempVTKChannelArray->SetNumberOfComponents(channelSize);
41 tempVTKChannelArray->SetNumberOfTuples(4);
42 tempVTKChannelArray->Allocate(1);
43
44 sourceData += 256;
45 channel1 = sourceData;
46 tempVTKChannelArray->InsertTupleValue(0,channel1);
47 sourceData += channelSize;
48 sourceData += 256;
49 channel2 = sourceData;
50 tempVTKChannelArray->InsertTupleValue(1,channel2);
51 sourceData += channelSize;
52 sourceData += 256;
53 channel3 = sourceData;
54 tempVTKChannelArray->InsertTupleValue(2,channel3);
55 sourceData += channelSize;
56 sourceData += 256;
57 channel4 = sourceData;
58 tempVTKChannelArray->InsertTupleValue(3,channel4);
59 vtkChannelArray->DeepCopy(tempVTKChannelArray);
60 }
61
62 void ToFCameraPMDRawDataCamCubeDevice::SetProperty( const char *propertyKey, BaseProperty* propertyValue )
63 {
64 ToFCameraPMDRawDataDevice::SetProperty(propertyKey,propertyValue);
65 this->m_PropertyList->SetProperty(propertyKey, propertyValue);
66
67 ToFCameraPMDCamCubeController::Pointer myController = dynamic_cast<mitk::ToFCameraPMDCamCubeController*>(this->m_Controller.GetPointer());
68
69 bool boolValue = false;
70 GetBoolProperty(propertyKey, boolValue);
71 if (strcmp(propertyKey, "SetFPNCalibration") == 0)
72 {
73 myController->SetFPNCalibration(boolValue);
74 }
75 else if (strcmp(propertyKey, "SetFPPNCalibration") == 0)
76 {
77 myController->SetFPPNCalibration(boolValue);
78 }
79 else if (strcmp(propertyKey, "SetLinearityCalibration") == 0)
80 {
81 myController->SetLinearityCalibration(boolValue);
82 }
83 else if (strcmp(propertyKey, "SetLensCalibration") == 0)
84 {
85 myController->SetLensCalibration(boolValue);
86 }
87 else if (strcmp(propertyKey, "SetExposureMode") == 0)
88 {
89 if (boolValue)
90 {
91 myController->SetExposureMode(1);
92 }
93 else
94 {
95 myController->SetExposureMode(0);
96 }
97 }
98 }
99
100}
PropertyList::Pointer m_PropertyList
a list of the corresponding properties
bool GetBoolProperty(const char *propertyKey, bool &boolValue)
get a bool from the property list
Interface to the Time-of-Flight (ToF) camera PMD CamCube.
virtual void GetChannelSourceData(short *sourceData, vtkShortArray *vtkChannelArray)
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
ToFCameraPMDController::Pointer m_Controller
corresponding CameraController
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
IGT Exceptions.
int strcmp(const String &s1, const String &s2)
Definition relates.cpp:14