Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkToFCameraPMDRawDataCamCubeDevice.cpp
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 ============================================================================*/
14 
15 // vtk includes
16 #include "vtkSmartPointer.h"
17 
18 namespace mitk
19 {
21  {
23  }
24 
26  {
27  }
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 
39  vtkSmartPointer<vtkShortArray> tempVTKChannelArray = vtkSmartPointer<vtkShortArray>::New();
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 }
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
virtual int GetCaptureHeight()
get the currently set capture height
bool GetBoolProperty(const char *propertyKey, bool &boolValue)
get a bool from the property list
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
DataCollection - Class to facilitate loading/accessing structured data.
PropertyList::Pointer m_PropertyList
a list of the corresponding properties
Abstract base class for properties.
Interface to the Time-of-Flight (ToF) camera PMD CamCube.
ToFCameraPMDController::Pointer m_Controller
corresponding CameraController
virtual void GetChannelSourceData(short *sourceData, vtkShortArray *vtkChannelArray)
virtual void SetChannelSize(int _arg)
virtual int GetCaptureWidth()
get the currently set capture width