Hi Yuriy,
for what you want to do `repmat` is certainly not a viable long-term solution. It was mostly for debugging. Can we confirm the issue comes down to the compression for multi-plane images? Is this is the case, the following code should exhibit slow performance on your machine:
I = zeros(1191,2559,1,1,5,'uint16');
tic; bfsave(I, 'dummy.ome.tiff', 'Compression', 'LZW');toc
As for `bfsave/createMinimalXMLMetadata`, your concerns are well-founded. You should keep in mind this function was mostly written as a template/starting point for small images. It certainly does not work out-of-the-box for 1- very large images, 2- screens, 3- images with extended metadata. Without putting too much thought into, it, a quick workaround in your specific case could be something like:
metadata = createMinimalOMEXMLMetadata(I);
metadata.setPixelsSizeZ(toInt(sizeZ), 0);
In general, the extension of these functions is largely driven by the needs of individual projects like yours so I am happy to consider any suggestion for improving them in a more generic way. What are your thoughts about:
metadata = createMinimalOMEXMLMetadata(I, 'sizeZ', sizeZ, 'sizeC', sizeC. 'sizeT', sizeT);
where I would be a single plane (used for XY dimensions and the pixel type) but where parameters could override the ZCT dimensions.
Best,
Sebastien