21 m_AmplitudeOutfile(NULL), m_IntensityOutfile(NULL)
70 void ToFImageCsvWriter::Add(
float* distanceFloatData,
float* amplitudeFloatData,
float* intensityFloatData,
unsigned char* rgbData)
87 void ToFImageCsvWriter::WriteCsvFile(FILE* outfile,
float* floatData)
93 fprintf(outfile,
"%f", floatData[i]);
97 fprintf(outfile,
",%f", floatData[i]);
102 void ToFImageCsvWriter::OpenCsvFile(FILE** outfile, std::string outfileName)
104 (*outfile) = fopen( outfileName.c_str(),
"w+" );
107 MITK_ERROR <<
"Error opening outfile: " << outfileName;
108 throw std::logic_error(
"Error opening outfile.");
113 void ToFImageCsvWriter::CloseCsvFile(FILE* outfile)
118 throw std::logic_error(
"File is empty.");
void Open() override
Checks for file extensions and opens the output files.
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
int m_NumOfFrames
number of frames written to the image. Used for pic header.
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
void CheckForFileExtension(std::string &fileName)
Checks file name if file extension exists. If not an error message is returned.
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
~ToFImageCsvWriter()
standard ~ctor
DataCollection - Class to facilitate loading/accessing structured data.
ToFImageCsvWriter()
standard ctor
FILE * m_IntensityOutfile
file for intensity image
void Close() override
Closes the output files.
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
int m_ToFCaptureHeight
height (y-dimension) of the images to record.
std::string m_IntensityImageFileName
file name for saving the intensity image
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
void Add(float *distanceFloatData, float *amplitudeFloatData, float *intensityFloatData, unsigned char *rgbData=0) override
Pushes the image data to the output files.
std::string m_Extension
file extension used for saving images
Writer class for ToF images.
std::string m_DistanceImageFileName
file name for saving the distance image
FILE * m_DistanceOutfile
file for distance image
int m_ToFImageSizeInBytes
size of the image to save in bytes
FILE * m_AmplitudeOutfile
file for amplitude image