@@ -434,6 +434,37 @@ void vtkPlusAndorVideoSource::AdjustSpacing(int horizontalBins, int verticalBins
434434 LOG_DEBUG (" Adjusted spacing: " << spacingStream.str ());
435435}
436436
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+
437468// ----------------------------------------------------------------------------
438469PlusStatus vtkPlusAndorVideoSource::SetFrameFieldImageToReferenceTransform (std::array<float , 16 > transform)
439470{
@@ -508,6 +539,8 @@ PlusStatus vtkPlusAndorVideoSource::AcquireFrame()
508539 AdjustBuffers (this ->effectiveHBins , this ->effectiveVBins );
509540 AdjustSpacing (this ->effectiveHBins , this ->effectiveVBins );
510541
542+ SetCustomFrameFields ();
543+
511544 unsigned rawFrameSize = frameSize[0 ] * frameSize[1 ];
512545 rawFrame.resize (rawFrameSize, 0 );
513546
0 commit comments