Medical Imaging Interaction Toolkit  2016.11.0
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,
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 ===================================================================*/
18 
19 // vtk includes
20 #include "vtkSmartPointer.h"
21 
22 namespace mitk
23 {
25  {
27  }
28 
30  {
31  }
32 
33  void ToFCameraPMDRawDataCamCubeDevice::GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray )
34  {
35  int i = 0;
36  unsigned int channelSize = (this->GetCaptureHeight()*this->GetCaptureWidth()*2);
37  this->SetChannelSize(channelSize);
38  signed short* channel1;
39  signed short* channel2;
40  signed short* channel3;
41  signed short* channel4;
42 
43  vtkSmartPointer<vtkShortArray> tempVTKChannelArray = vtkSmartPointer<vtkShortArray>::New();
44  tempVTKChannelArray->SetNumberOfComponents(channelSize);
45  tempVTKChannelArray->SetNumberOfTuples(4);
46  tempVTKChannelArray->Allocate(1);
47 
48  sourceData += 256;
49  channel1 = sourceData;
50  tempVTKChannelArray->InsertTupleValue(0,channel1);
51  sourceData += channelSize;
52  sourceData += 256;
53  channel2 = sourceData;
54  tempVTKChannelArray->InsertTupleValue(1,channel2);
55  sourceData += channelSize;
56  sourceData += 256;
57  channel3 = sourceData;
58  tempVTKChannelArray->InsertTupleValue(2,channel3);
59  sourceData += channelSize;
60  sourceData += 256;
61  channel4 = sourceData;
62  tempVTKChannelArray->InsertTupleValue(3,channel4);
63  vtkChannelArray->DeepCopy(tempVTKChannelArray);
64  }
65 
66  void ToFCameraPMDRawDataCamCubeDevice::SetProperty( const char *propertyKey, BaseProperty* propertyValue )
67  {
68  ToFCameraPMDRawDataDevice::SetProperty(propertyKey,propertyValue);
69  this->m_PropertyList->SetProperty(propertyKey, propertyValue);
70 
71  ToFCameraPMDCamCubeController::Pointer myController = dynamic_cast<mitk::ToFCameraPMDCamCubeController*>(this->m_Controller.GetPointer());
72 
73  bool boolValue = false;
74  GetBoolProperty(propertyKey, boolValue);
75  if (strcmp(propertyKey, "SetFPNCalibration") == 0)
76  {
77  myController->SetFPNCalibration(boolValue);
78  }
79  else if (strcmp(propertyKey, "SetFPPNCalibration") == 0)
80  {
81  myController->SetFPPNCalibration(boolValue);
82  }
83  else if (strcmp(propertyKey, "SetLinearityCalibration") == 0)
84  {
85  myController->SetLinearityCalibration(boolValue);
86  }
87  else if (strcmp(propertyKey, "SetLensCalibration") == 0)
88  {
89  myController->SetLensCalibration(boolValue);
90  }
91  else if (strcmp(propertyKey, "SetExposureMode") == 0)
92  {
93  if (boolValue)
94  {
95  myController->SetExposureMode(1);
96  }
97  else
98  {
99  myController->SetExposureMode(0);
100  }
101  }
102  }
103 
104 }
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
virtual int GetCaptureHeight()
get the currently set capture height
itk::SmartPointer< Self > Pointer
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
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.