glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

MCD: calculate channel count based on metadata, not pixel bytes #255

Closed melissalinkert closed 1 month ago

melissalinkert commented 1 month ago

In some cases, the number of pixel bytes stored for a particular acquisition may not match the expected number of bytes, so calculating the channel count based on the stored number of pixel bytes will cause problems.

Instead of throwing an exception, this sets the channel count to the number of channels linked to the acquisition, and logs that some image data may be blank. This more closely matches the behavior of MCDViewer (the vendor software).

I have checked a few older datasets that do not exhibit the missing pixel bytes problem and have found no difference in behavior with this change, but that should be double-checked in addition to testing the broken file.

Adding @mabruce for functional review and @chris-allan for code review, but can reassign if time runs out this week.

As mentioned separately, #253 is the only thing merged since 0.9.3, so we should be OK to do a 0.9.4 as soon as this is merged.