fractal-analytics-platform / fractal-client

Command-line client for Fractal
https://fractal-analytics-platform.github.io/fractal-client
BSD 3-Clause "New" or "Revised" License
45 stars 1 forks source link

Open parsed OME-Zarr container and resave it with applied changes #26

Closed gusqgm closed 2 years ago

gusqgm commented 2 years ago

Perform any simple transformation to images stored into .zarr and resave the transformed .zarr file following same structure as before. Are we capable of doing some transformations in a parallel fashion for reading and writing from .zarr?

gusqgm commented 2 years ago

The parallel reading and writing is also something we should check with Napari. Are we already there? @jluethi , do you maybe have any information to whether OME-Zarr used for BigDataViewer in ImageJ is capable of parallel reading and writing?

gusqgm commented 2 years ago

As a simple first approach, we could apply Illumination Correction matrix to each image in order to get the intensity profiles flatter. These are mulötiplicative matrices to the acquired images, and should account for minimizing effects of e.g. vignetting that we have at the borders of each acquired image. How this matrix is calculated is not important, just that we apply something meaningful that allows us to test the opening and resaving.

jluethi commented 2 years ago

@gusqgm can you ping @mfranzon once the example illumination correction files are on the sftp server so that they can be downloaded to the fractal share? Also, can you share the code you use to apply the correction? I assume it's a multiplication of each site (field of view) with the correction matrix? Or do you invert the matrix first?

gusqgm commented 2 years ago

Illumination matrices have been uploaded to the sftp server, folder named "IlluminationCorrectionMatrices-Yokogawa"! How to use them: 1) open each image and perform background subtraction (we currently subtract 120 from the nominal value ) 2) normalize the illumination correction matrix so to range from 0-1. 3) divide background subtracted images by the normalized illumination correction input. Naming convention is as follows:

___.tif most important fields here are the magnification and the channel name, so that we can order the correct matrix to the channel in a particular experiment. In our case, the 2-well FMI test dataset `210305NAR005AAN` dataset was acquired with 60x (present in the .mes file name, as well as inside it as `bts:Objective="60x W"` within the `bts:Channel` field). The channel numbers can be parsed from the end of each file name. The gridless search-first dataset (related to issue fractal-analytics-platform/fractal-tasks-core#8) dataset, `20220316_sec_FOCM_test-R1_E2`, was acquired with 20x.
tcompa commented 2 years ago

Closing this issue, as it was essentially replaced by https://github.com/fractal-analytics-platform/mwe_fractal/issues/62