7 #ifndef __vtkPlusAndorVideoSource_h 8 #define __vtkPlusAndorVideoSource_h 10 #include "vtkPlusDataCollectionExport.h" 12 #include "vtkMultiThreader.h" 13 #include "opencv2/imgproc.hpp" 14 #include "opencv2/imgcodecs.hpp" 58 PermanentlyClosed = 2,
63 ShutterMode GetShutter();
65 PlusStatus SetShutterClosingTimeMilliseconds(
int closingTime);
66 PlusStatus SetShutterOpeningTimeMilliseconds(
int openingTime);
69 PlusStatus SetExposureTime(
float exposureTime);
70 float GetExposureTime();
84 int GetVSSpeedIndex();
90 PlusStatus SetPreAmpGainIndex(
int preAmpGainIndex);
91 int GetPreAmpGainIndex();
94 float GetPreAmpGain();
111 PlusStatus SetAcquisitionMode(AcquisitionMode acquisitionMode);
112 AcquisitionMode GetAcquisitionMode();
117 FullVerticalBinning = 0,
124 ReadMode GetReadMode();
140 ExternalExposure = 7,
142 SoftwareTrigger = 10,
143 ExternalChargeShifting = 12
145 PlusStatus SetTriggerMode(TriggerMode triggerMode);
146 TriggerMode GetTriggerMode();
148 PlusStatus SetFrameFieldImageToReferenceTransform(std::array<float, 16> transform);
149 std::vector<double> GetSpacing();
153 int GetCoolTemperature();
157 int GetSafeTemperature();
163 PlusStatus SetBadPixelCorrectionImage(
const std::string badPixelFilePath);
166 return badPixelCorrection;
168 PlusStatus SetBiasDarkCorrectionImage(
const std::string biasDarkFilePath);
171 return biasDarkCorrection;
173 PlusStatus SetFlatCorrectionImage(
const std::string flatFilePath);
176 return flatCorrection;
180 PlusStatus SetCameraIntrinsics(std::array<double, 9> intrinsics);
181 std::array<double, 9> GetCameraIntrinsics();
182 PlusStatus SetDistortionCoefficients(std::array<double, 4> coefficients);
183 std::array<double, 4> GetDistortionCoefficients();
186 PlusStatus StartBLIFrameAcquisition(
int binning,
int vsSpeed,
int hsSpeed,
float exposureTime,
int shutterCloseTime=0,
int shutterOpenTime=0);
189 PlusStatus StartGrayscaleFrameAcquisition(
int binning,
int vsSpeed,
int hsSpeed,
float exposureTime,
int shutterCloseTime=0,
int shutterOpenTime=0);
192 PlusStatus StartCorrectionFrameAcquisition(std::string correctionFilePath, ShutterMode shutter,
int binning,
int vsSpeed,
int hsSpeed,
float exposureTime,
int shutterCloseTime=0,
int shutterOpenTime=0);
212 PlusStatus SetRequireCoolTemp(
bool RequireCoolTemp);
213 bool GetRequireCoolTemp();
216 void WaitForCooldown();
224 void WaitForWarmup();
227 unsigned int checkStatus(
unsigned int returnStatus, std::string functionName);
233 PlusStatus SetUseCosmicRayCorrection(
bool UseCosmicRayCorrection);
234 bool GetUseCosmicRayCorrection();
237 unsigned int GetCCDStatus();
240 bool IsCCDAcquiring();
243 void PrepareAcquisition();
245 bool WaitForAcquisitionWithTimeout(
double maximumWaitTimeInSeconds,
int sleepQuantumMilliseconds = 10);
252 bool IsAcquisitionThreadRunning();
281 void AdjustBuffers(
int horizontalBins,
int verticalBins);
282 void AdjustSpacing(
int horizontalBins,
int verticalBins);
285 void SetCustomFrameFields();
294 void FindBadCells(
int binning);
297 void CorrectBadPixels(
int binning, cv::Mat& cvIMG);
300 void ApplyCosmicRayCorrection(
int binning, cv::Mat& floatImage);
303 void ApplyFrameCorrections(
int binning);
305 static void* AcquireBLIFrameThread(vtkMultiThreader::ThreadInfo* info);
306 static void* AcquireGrayscaleFrameThread(vtkMultiThreader::ThreadInfo* info);
307 static void* AcquireCorrectionFrameThread(vtkMultiThreader::ThreadInfo* info);
312 PlusStatus SetUseFrameCorrections(
bool UseFrameCorrections);
313 bool GetUseFrameCorrections();
316 void ResizeFlatCorrectionImage(
int binning);
323 StartGrayscaleFrameAcquisition(-1, -1, -1, -1);
331 PlusStatus SetInitializeCoolerState(
bool InitializeCoolerState);
332 bool InitializeCoolerState =
true;
337 bool RequireCoolTemp =
true;
344 int ShutterOpeningTimeMilliseconds = 0;
345 int ShutterClosingTimeMilliseconds = 0;
346 float ExposureTime = 1.0;
347 int HorizontalBins = 1;
348 int VerticalBins = 1;
349 int HSSpeed[2] = { 0, 1 };
350 int VSSpeedIndex = 0;
351 int PreAmpGainIndex = 0;
352 bool UseFrameCorrections =
true;
353 bool UseCosmicRayCorrection =
true;
356 float effectiveExpTime = 1.0;
357 int effectiveHBins = 1;
358 int effectiveVBins = 1;
359 int effectiveHSInd = 1;
360 int effectiveVSInd = 1;
362 int effectiveShutterOpeningTimeMilliseconds = 0;
363 int effectiveShutterClosingTimeMilliseconds = 0;
378 int CoolTemperature = -50;
379 int SafeTemperature = 5;
380 float CurrentTemperature = 0.123456789;
382 FrameSizeType frameSize = {1024, 1024, 1};
384 double currentTime = UNDEFINED_TIMESTAMP;
389 double cameraIntrinsics[9] = { 0 };
390 double distortionCoefficients[4] = { 0 };
401 double OutputSpacing[3] = { 0 };
405 std::array<float, 16> imageToReferenceTransform = { 0 };
410 vtkMultiThreader* Threader = vtkMultiThreader::New();
std::vector< uint16_t > rawFrame
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStopRecording()
Abstract interface for tracker and video devices.
std::string saveCorrectionPath
Class for acquiring images from Andor cameras.
igsioFieldMapType CustomFields
virtual bool IsTracker() const
virtual PlusStatus InternalConnect()
virtual std::string GetSdkVersion()
PlusStatus InternalUpdate() override
std::string GetFlatCorrectionImage()
std::string flatCorrection
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
std::string GetBadPixelCorrectionImage()
std::string GetBiasDarkCorrectionImage()
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus InternalStartRecording()
DataSourceArray BLICorrected
std::string badPixelCorrection
std::vector< vtkPlusDataSource * > DataSourceArray
DataSourceArray GrayCorrected
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
std::string biasDarkCorrection
static vtkPlusDevice * New()