10 #include "PlusConfigure.h" 16 #include <vtkImageData.h> 17 #include <vtkObjectFactory.h> 20 #include "i3system_TE.h" 31 this->RequireImageOrientationInConfiguration =
true;
32 this->StartThreadForInternalUpdates =
true;
43 this->Superclass::PrintSelf(os, indent);
44 os << indent <<
"InfraredTEEV2Cam: Thermal Expert EV2 Camera" << std::endl;
51 LOG_DEBUG(
"Configure Thermal Expert EV2");
79 SCANINFO* pScan =
new SCANINFO[MAX_USB_NUM];
82 for (
int i = 0;
i < MAX_USB_NUM;
i++)
92 if (this->device == -1)
94 LOG_ERROR(
"Thermal Expert EV2: camera not detected.");
98 LOG_DEBUG(
"Thermal Expert EV2 Camera handle: " << this->device);
101 this->pTE = OpenTE_A(this->device);
105 LOG_ERROR(
"Thermal Expert EV2: Failed to open.");
109 int width = this->pTE->GetImageWidth();
110 int height = this->pTE->GetImageHeight();
111 this->pImgBuf =
new unsigned short[
width *
height];
121 this->pTE->CloseTE();
122 this->pImgBuf =
nullptr;
131 LOG_ERROR(
"vtkPlusInfraredTEEV2Cam::InternalUpdate Unable to read date");
135 if (!this->pTE->RecvImage(this->pImgBuf))
137 LOG_ERROR(
"vtkPlusInfraredTEEV2Cam::InternalUpdate Unable to receive frame");
142 if (this->GetFirstActiveOutputVideoSource(aSource) ==
PLUS_FAIL || aSource ==
nullptr)
144 LOG_ERROR(
"Unable to grab a video source. Skipping frame.");
158 FrameSizeType frameSize = { static_cast<unsigned int>(this->
width), static_cast<unsigned int>(this->
height), 1 };
170 if (this->OutputChannels.size() > 1)
172 LOG_WARNING(
"vtkPlusInfraredTEEV2Cam is expecting one output channel and there are " << this->OutputChannels.size() <<
" channels. First output channel will be used.");
175 if (this->OutputChannels.empty())
177 LOG_ERROR(
"No output channels defined for vtkPlusInfraredTEEV2Cam. Cannot proceed.");
178 this->CorrectlyConfigured =
false;
virtual PlusStatus InternalConnect() VTK_OVERRIDE
PlusStatus FreezeDevice(bool freeze)
#define XML_FIND_DEVICE_ELEMENT_REQUIRED_FOR_WRITING(deviceConfig, rootConfigElement)
PlusStatus InternalUpdate()
vtkStandardNewMacro(vtkPlusInfraredTEEV2Cam)
PlusStatus SetInputFrameSize(unsigned int x, unsigned int y, unsigned int z)
virtual PlusStatus AddItem(vtkImageData *frame, US_IMAGE_ORIENTATION usImageOrientation, US_IMAGE_TYPE imageType, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL)
PlusStatus SetImageType(US_IMAGE_TYPE imageType)
PlusStatus SetPixelType(igsioCommon::VTKScalarPixelType pixelType)
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus NotifyConfigured()
#define XML_FIND_DEVICE_ELEMENT_REQUIRED_FOR_READING(deviceConfig, rootConfigElement)
PhidgetLCD_Font int * width
virtual US_IMAGE_ORIENTATION GetInputImageOrientation()
PhidgetLCD_Font int int * height
PlusStatus SetNumberOfScalarComponents(unsigned int numberOfScalarComponents)
PlusStatus WriteConfiguration(vtkXMLDataElement *config)
~vtkPlusInfraredTEEV2Cam()
Class for interfacing an Infrared Seek capture device and recording frames into a Plus buffer.
virtual PlusStatus InternalDisconnect() VTK_OVERRIDE
PlusStatus ReadConfiguration(vtkXMLDataElement *config)
virtual int GetNumberOfItems()
vtkPlusInfraredTEEV2Cam()
Interface to a 3D positioning tool, video source, or generalized data stream.