17 m_AmplitudeOutfile(nullptr), m_IntensityOutfile(nullptr)
66 void ToFImageCsvWriter::Add(
float* distanceFloatData,
float* amplitudeFloatData,
float* intensityFloatData,
unsigned char*)
83 void ToFImageCsvWriter::WriteCsvFile(FILE* outfile,
float* floatData)
89 fprintf(outfile,
"%f", floatData[i]);
93 fprintf(outfile,
",%f", floatData[i]);
98 void ToFImageCsvWriter::OpenCsvFile(FILE** outfile, std::string outfileName)
100 (*outfile) = fopen( outfileName.c_str(),
"w+" );
103 MITK_ERROR <<
"Error opening outfile: " << outfileName;
104 throw std::logic_error(
"Error opening outfile.");
109 void ToFImageCsvWriter::CloseCsvFile(FILE* outfile)
114 throw std::logic_error(
"File is empty.");
ToFImageCsvWriter()
standard ctor
~ToFImageCsvWriter() override
standard ~ctor
void Add(float *distanceFloatData, float *amplitudeFloatData, float *intensityFloatData, unsigned char *rgbData=nullptr) override
Pushes the image data to the output files.
FILE * m_IntensityOutfile
file for intensity image
FILE * m_AmplitudeOutfile
file for amplitude image
FILE * m_DistanceOutfile
file for distance image
void Close() override
Closes the output files.
Writer class for ToF images.
virtual void Open()
Open file(s) for writing.
std::string m_DistanceImageFileName
file name for saving the distance image
std::string m_IntensityImageFileName
file name for saving the intensity image
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
std::string m_Extension
file extension used for saving images
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
int m_NumOfFrames
number of frames written to the image. Used for pic header.
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
int m_ToFImageSizeInBytes
size of the image to save in bytes
void CheckForFileExtension(std::string &fileName)
Checks file name if file extension exists. If not an error message is returned.
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
int m_ToFCaptureHeight
height (y-dimension) of the images to record.