@@ -434,6 +434,37 @@ void vtkPlusAndorVideoSource::AdjustSpacing(int horizontalBins, int verticalBins
434
434
LOG_DEBUG (" Adjusted spacing: " << spacingStream.str ());
435
435
}
436
436
437
+ // ----------------------------------------------------------------------------
438
+ void vtkPlusAndorVideoSource::SetCustomFrameFields ()
439
+ {
440
+ this ->CustomFields [" ExposureTime" ].first = FRAMEFIELD_FORCE_SERVER_SEND;
441
+ this ->CustomFields [" ExposureTime" ].second = std::to_string (this ->effectiveExpTime );
442
+ this ->CustomFields [" HorizontalBins" ].first = FRAMEFIELD_FORCE_SERVER_SEND;
443
+ this ->CustomFields [" HorizontalBins" ].second = std::to_string (this ->effectiveHBins );
444
+ this ->CustomFields [" VerticalBins" ].first = FRAMEFIELD_FORCE_SERVER_SEND;
445
+ this ->CustomFields [" VerticalBins" ].second = std::to_string (this ->effectiveVBins );
446
+
447
+ std::ostringstream transformStream;
448
+ float transformValue;
449
+ for (unsigned i = 0 ; i < 15 ; i++)
450
+ {
451
+ transformValue = this ->imageToReferenceTransform .at (i);
452
+ if (i == 0 )
453
+ {
454
+ transformValue = transformValue * this ->OutputSpacing [0 ] * this ->effectiveHBins ;
455
+ }
456
+ else if (i == 5 ) // 1,1 in the matrix
457
+ {
458
+ transformValue = transformValue * this ->OutputSpacing [1 ] * this ->effectiveVBins ;
459
+ }
460
+ transformStream << this ->imageToReferenceTransform .at (i) << " " ;
461
+ }
462
+ transformStream << this ->imageToReferenceTransform .back ();
463
+
464
+ this ->CustomFields [" ImageToReferenceTransform" ].first = FRAMEFIELD_FORCE_SERVER_SEND;
465
+ this ->CustomFields [" ImageToReferenceTransform" ].second = transformStream.str ();
466
+ }
467
+
437
468
// ----------------------------------------------------------------------------
438
469
PlusStatus vtkPlusAndorVideoSource::SetFrameFieldImageToReferenceTransform (std::array<float , 16 > transform)
439
470
{
@@ -508,6 +539,8 @@ PlusStatus vtkPlusAndorVideoSource::AcquireFrame()
508
539
AdjustBuffers (this ->effectiveHBins , this ->effectiveVBins );
509
540
AdjustSpacing (this ->effectiveHBins , this ->effectiveVBins );
510
541
542
+ SetCustomFrameFields ();
543
+
511
544
unsigned rawFrameSize = frameSize[0 ] * frameSize[1 ];
512
545
rawFrame.resize (rawFrameSize, 0 );
513
546
0 commit comments