We're Hiring!

[C++] Compression with writer

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more!
Please note:
If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

[C++] Compression with writer

Postby thomas_braun » Tue Dec 13, 2016 11:15 am

Hi,

I'm in the process of writing an application which converts from a proprietary dataformat to OME-TIFF using the C++ libraries (ome-files-cpp 0.2.2, ome-common 5.3.2, bioformats 5.2.3).

I played around with compression
Code: Select all
auto writer = make_shared<ome::files::out::OMETIFFWriter>();
auto compressionTypes = writer->getCompressionTypes();

std::cout << "List of supported compression types" << std::endl;
for(auto compType : compressionTypes)
   std::cout << "Compression: " << compType << std::endl;


but the set of supported compression types is always empty.

Is my compilation of the OME libraries faulty or incomplete?

Thanks,
Thomas
thomas_braun
 
Posts: 4
Joined: Tue Feb 02, 2016 7:38 pm

Re: [C++] Compression with writer

Postby rleigh » Wed Dec 14, 2016 9:37 am

Compression support is not yet completed, which is why an empty list is returned. Most of the pieces are in place for basic compression formats, but it needs some final work to (1) fill the list with the supported compression types introspected from libtiff and (2) enable the compression when writing.

If using the platform-provided libtiff, it should also support jpeg compression, but other compression types such as jpeg2000 will need extra support. If using the super-build, it's currently limited to zlib and compression types built into libtiff; we would need to add libjpeg and other compression libraries to the superbuild (I'm currently working on libjpeg-turbo for this purpose).

I have added initial support for this tentatively as an item for the 0.3.0 release: https://trello.com/c/IQdFu4Ls/53-add-ti ... on-support. If there's time to fit it in I'll do this, or else it will be done in a later point release.


Kind regards,
Roger
User avatar
rleigh
Team Member
 
Posts: 192
Joined: Tue Mar 13, 2012 11:45 am

Re: [C++] Compression with writer

Postby rleigh » Sun Dec 18, 2016 7:44 pm

Dear Thomas,

I have opened an initial pull request adding compression support, which you can find here:

https://github.com/ome/ome-files-cpp/pull/42

This adds support for LZW, Deflate and any other codecs which libtiff was compiled with e.g. JPEG, and all of the other built in ones.

If you wanted to make use of this prior to it being included in a release, please feel free to cherry-pick this commit. I would certainly be interested in any feedback you might have.


Kind regards,
Roger
User avatar
rleigh
Team Member
 
Posts: 192
Joined: Tue Mar 13, 2012 11:45 am


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest