Skip to content

Class FileImage

ClassList > FileImage

Image container responsible of writing images to a file, including metadata. More...

  • #include <util.h>

Public Attributes

Type Name
std::vector< int > m_acqNframeMetadata
number of frame acquired by the camera.
QMap< QString, std::vector< float > > m_additionalMetadata
additional metadata to append to the NDArrays. Each vector will be appended to the vl metadata of the array using the key of the map as identifier.
std::vector< std::string > m_colorFilterArray
string determining the type of filter array of an RGB camera.
b2nd_context_t * m_ctx
Storage context.
std::vector< int > m_exposureMetadata
exposure time in microseconds.
char * m_filePath
path to file location.
b2nd_array_t * m_src
Array storage created temporarily for BLOSC.
std::vector< std::string > m_timeStamp
string determining the time stamp when images where acquired.

Public Functions

Type Name
void AppendMetadata ()
Appends metadata to BLOSC ND array. This method should be called before closing the file.
FileImage (const char * filePath, unsigned int imageHeight, unsigned int imageWidth)
Opens a file and throws runtime error when opening fails.
void WriteImageData (XI_IMG image, QMap< QString, float > additionalMetadata)
Writes the content of an image into a file in UINT16 format.
~FileImage ()
Frees blosc2 context and releases the resources associated with the file.

Public Static Functions

Type Name
bool CheckFileMetadata (const b2nd_array_t * src)
Checks for each expected metadata key, that the length matches the number of images in the file. Returns false if metadata has inconsistent shape or if it does not exist for any key.

Detailed Description

This class manges the writing of images to a file. Writing metadata to the file needs to be triggered through the method FileImage::AppendMetadata.

Public Attributes Documentation

variable m_acqNframeMetadata

number of frame acquired by the camera.

std::vector<int> FileImage::m_acqNframeMetadata;


variable m_additionalMetadata

additional metadata to append to the NDArrays. Each vector will be appended to the vl metadata of the array using the key of the map as identifier.

QMap<QString, std::vector<float> > FileImage::m_additionalMetadata;


variable m_colorFilterArray

string determining the type of filter array of an RGB camera.

std::vector<std::string> FileImage::m_colorFilterArray;


variable m_ctx

Storage context.

b2nd_context_t* FileImage::m_ctx;


variable m_exposureMetadata

exposure time in microseconds.

std::vector<int> FileImage::m_exposureMetadata;


variable m_filePath

path to file location.

char* FileImage::m_filePath;


variable m_src

Array storage created temporarily for BLOSC.

b2nd_array_t* FileImage::m_src;


variable m_timeStamp

string determining the time stamp when images where acquired.

std::vector<std::string> FileImage::m_timeStamp;


Public Functions Documentation

function AppendMetadata

Appends metadata to BLOSC ND array. This method should be called before closing the file.

void FileImage::AppendMetadata () 


function FileImage

Opens a file and throws runtime error when opening fails.

FileImage::FileImage (
    const char * filePath,
    unsigned int imageHeight,
    unsigned int imageWidth
) 

Parameters:

  • filePath path to file to open
  • imageHeight height of image to store in file
  • imageWidth width of image to store in file

Exception:


function WriteImageData

Writes the content of an image into a file in UINT16 format.

void FileImage::WriteImageData (
    XI_IMG image,
    QMap< QString, float > additionalMetadata
) 

Parameters:

  • image Ximea image where data is stored
  • additionalMetadata Additional metadata to be stored in the array

function ~FileImage

Frees blosc2 context and releases the resources associated with the file.

FileImage::~FileImage () 


Public Static Functions Documentation

function CheckFileMetadata

Checks for each expected metadata key, that the length matches the number of images in the file. Returns false if metadata has inconsistent shape or if it does not exist for any key.

static bool FileImage::CheckFileMetadata (
    const b2nd_array_t * src
) 

Parameters:

  • src BLOSC ND-Array to check.

Returns:

true if the metadata is consistent and false if the metadata shape is missing or shape is inconsistent.



The documentation for this class was generated from the following file src/util.h