When i wrote whatever sample data i had into PNG files (by default) the openLAB file got written fine however i was having issues writing the LSM format into PNG.
What sorts of problems were you having when converting LSM files? Do you see an error message, or is the converted file incorrect?
Thus, having a way to find out which formats could this image be written into could be helpful.
OME-TIFF and regular TIFF are generally the best formats to use, as they support the widest range of pixel types and preserve the most metadata. Several compression types are supported; you can see which ones are available as follows:
- Code: Select all
IFormatWriter writer = new TiffWriter();
String[] compressionTypes = writer.getCompressionTypes();
To set which compression type is used:
- Code: Select all
// compressionType is a String, and must be an element of the 'compressionTypes' array above
writer.setCompressionType(compressionType);
If you would prefer not to use TIFFs, and do not need to preserve any metadata, then JPEG-2000 and PNG are reasonable choices. Both formats should handle 8 and 16 bit data, but note that JPEG-2000 files will use lossy compression. You can see exactly which bit depths are supported by a particular format using the 'int[] getPixelTypes()' method in IFormatWriter.
Regards,
-Melissa