Create and save OME Tiff files in C++

Dear reader,

Please pardon this beginner question, I am new to Bio Formats.

I’m working on a C++ library which aquires data from FLIM.

Instead of writing the data to histogram files, I would like to write the data to an OME Tiff file and save this file, directly in C++.

Basically, I would like to do the following, but in C++ instead of in MATLAB:

% initialise the plane with 8 channels
plane = zeros(sy, sx, 1,8,1, 'uint8');

% fill the plane with the data from stored images.

% make minimal metadata
metadata = createMinimalOMEXMLMetadata(plane);

% save ome tiff
bfsave(plane, 'testimage.ome.tiff', 'metadata', metadata);

I succeeded in creating the minimal core meta data, and I’m following an approach similar to

Can anyone give me some tips as to how to achieve this?