14#include <itksys/SystemTools.hxx>
15#pragma GCC visibility push(default)
16#include <itkEventObject.h>
17#pragma GCC visibility pop
75 throw std::invalid_argument(
"ToFCameraDevice is nullptr.");
89 throw std::logic_error(
"No file format specified!");
155 mitk::RealTimeClock::Pointer realTimeClock;
160 t1 = realTimeClock->GetCurrentStamp();
161 bool printStatus =
false;
162 int requiredImageSequence = 0;
163 int numOfFramesRecorded = 0;
182 MITK_INFO <<
"Problem! required: " << requiredImageSequence <<
" captured: " <<
m_ImageSequence;
186 numOfFramesRecorded++;
187 if (numOfFramesRecorded % n == 0)
193 t2 = realTimeClock->GetCurrentStamp() - t1;
194 MITK_INFO <<
" Framerate (fps): " << n / (t2/1000) <<
" Sequence: " <<
m_ImageSequence;
195 t1 = realTimeClock->GetCurrentStamp();
209 this->InvokeEvent(itk::AbortEvent());
static Pointer New(void)
instanciates a new, operating-system dependant, instance of mitk::RealTimeClock.
Virtual interface and base class for all Time-of-Flight devices.
char * m_SourceDataArray
array holding the source data
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
int m_SourceDataSize
size of the source data provided by the device
void StopRecording()
Stops the recording by setting the m_Abort flag to false.
void SetCameraDevice(ToFCameraDevice *aToFCameraDevice)
Set the device used for acquiring ToF images.
void WaitForThreadBeingTerminated()
Wait until thread is terinated.
int m_RGBCaptureHeight
height (y-dimension) of the images to record.
int m_ImageSequence
number of images currently acquired
ToFImageWriter::ToFImageType m_ToFImageType
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
void SetRecordMode(ToFImageRecorder::RecordMode recordMode)
Set the RecordMode.
float * m_IntensityArray
array holding the intensity data
float * m_DistanceArray
array holding the distance data
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
std::string m_DistanceImageFileName
file name for saving the distance image
int m_ToFCaptureHeight
height (y-dimension) of the images to record.
bool m_Abort
flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combin...
std::string m_FileFormat
file format for saving images. If .csv is chosen, ToFImageCsvWriter is used
std::string m_RGBImageFileName
file name for saving the rgb image
std::mutex m_AbortMutex
mutex for thread-safe data access of abort flag
float * m_AmplitudeArray
array holding the amplitude data
ToFImageRecorder::RecordMode m_RecordMode
mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite)
ToFImageWriter::Pointer m_ToFImageWriter
image writer writing the acquired images to a file
~ToFImageRecorder() override
std::string m_IntensityImageFileName
file name for saving the intensity image
ToFCameraDevice * GetCameraDevice()
Get the device used for acquiring ToF images.
int m_RGBCaptureWidth
width (x-dimension) of the images to record.
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType)
Set the type of image to be recorded.
bool m_RGBImageSelected
flag indicating if rgb image should be recorded
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
void StartRecording()
Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record pr...
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
ToFImageRecorder::RecordMode GetRecordMode()
Returns the currently set RecordMode.
ToFCameraDevice::Pointer m_ToFCameraDevice
ToFCameraDevice used for acquiring the images.
unsigned char * m_RGBArray
array holding the RGB data if available (e.g. for Kinect)
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
int m_NumOfFrames
number of frames to be recorded by this recorder
int m_RGBPixelNumber
number of pixels (widht*height) of the images to record
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
ToFImageWriter::ToFImageType GetToFImageType()
Get the type of image to be recorded.
void RecordData()
Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter.