fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

Yokogawa metadata contains channel that wasn't imaged: handle better #586

Open jluethi opened 8 months ago

jluethi commented 8 months ago

The Liberali's often have setups where the metadata (specifically the .mrf file) contains channels that were then not acquired. The way this comes up is if a user adds more channels in the microscopy software, but then never uses them. This becomes and issue when that additional channel has different dimensions. For example, the additional channel is brightfield and has a lower resolution. In that case, we get an error like this one:

Image dimensions
Difference dataframe: 
horiz_pixel_dim       0.108333
vert_pixel_dim        0.108333
horiz_pixels       1280.000000
vert_pixels        1080.000000
bit_depth             0.000000
dtype: float64

ValueError: During metadata parsing, a consistency check failed: 
Image dimensions

In practice, there are no consistency issues in the acquired images, only in the channel metadata.

2 areas for improvement: a) improve the error message b) handle this more flexibly: Maybe we can pre-filter the channels and only check channels that were imaged / channels provided as allowed channels

jluethi commented 8 months ago

Here are example metadata files that reproduce this issue. They need to be renamed to .mlf & .mrf to work with the parsing again. I'll need to see if I find time soon to take a closer look

MeasurementData_mlf.txt MeasurementDetail_Mrf.txt