SchmollerLab / Cell_ACDC

A Python GUI-based framework for segmentation, tracking and cell cycle annotations of microscopy data
BSD 3-Clause "New" or "Revised" License
134 stars 22 forks source link

Batch mode adjust brightness/contrast of 3D raw data #248

Open dfgdgdfgd opened 1 year ago

dfgdgdfgd commented 1 year ago

Description:

Hi Francesco,

hope you had a good start into 2023... ;)

I have hundreds of spheroids to segment and i just realized, that i have to increase the brightness of many of them to improve the segmentation recognition (using Cellpose) . At the moment i´m doing that manually stack by stack and folder by folder using Fiji.....

Unfortunately, I have not found a direct way to do this in batch mode from ACDC. Have I possibly overlooked something?

If not, do you think it would make sense to implement such a function (if it is not too time consuming of course!!).

Concretely, my problem/solution looks like this: I have several groups of treated spheroids and have already created the folder structures. The stacks to be segmented are available as .tif. Could I then e.g. set the optimal brightness of the raw data via the GUI function >Brightness/Contrast< and save them (maybe even separately adjustable for each spheroid??) in batch mode with a different name as .tif in the corresponding folders?

Thanks & best Mario

ElpadoCan commented 1 year ago

Hi Mario,

Happy new year! My start of the year has been busy as usual :D What about you?

What you describe sounds absolutely doable and perfect for an awesome utility :)

However, what are the exact steps you do in Fiji? This way I can replicate in python. Let me know!

Have a good evening!

Cheers Francesco

dfgdgdfgd commented 1 year ago

Hi Francesco,

for me the same, busy as usual ;D

Glad to hear that´s possible :)

In my current data sets, I take it very simple, since i have just to increase the brightness of too dimm nuclei in some datasets. For that i go to >Image< >Adjust Brightness/Contrast< and adjust the brightness using the 2. slider as shown in the attached pic....that´s it....at least for the moment... ;) It´s more or less the same as the function you implemented in the GUI (the left slider to adjust brightness and contrast)...

I mean, if you think at this point it´s just a small step to implement also other adjustments/filters to create a more universal utility, then i´m sure, that blurring and contrast are for the most users the most used preprocessing steps, what do you think?

Have a good evening too, ciao, Mario

image

ElpadoCan commented 1 year ago

Ok great, it sounds totally doable. I was thinking to implement this into the data prep step where you can also load multiple positions, what do you think? Because I guess one would like to keep an eye on the filters and adjustments being applied?

One last question, when you adjust the brightness how do you choose the values? Visually? Because then I'm guessing you might choose a different min/max for each spheroid? This would mean that you still need to inspect each spheroid one by one? Would that be ok?

One possible solution to this would be to allow the user to set a percentage of the total brightness range instead of a specific value. Then the batch processing would calculate a different value for each spheroid automatically. What do you think?

dfgdgdfgd commented 1 year ago

Yeah, indeed, implementation into the data prep step would for sure make more sense.

Yes, i adjust the brightness visually, whereby the brightness within the same group is usually more or less the same. But it can vary between different groups..... But the inspection one by one is totally ok. And your suggestion with the percentage of the total brightness range sounds reasonable, good idea!

github-actions[bot] commented 1 year ago

Hi there, I'm the Cell-ACDC bot :wave:. This issue had no activity for more than 180 days. For now, we have marked it as "inactive" until there is some new activity. If this issue was not solved yet, unfortunately we haven't had the time to implement it or it requires more discussion. Note that it doesn't mean it has been ignored, but a little reminder from your side would help :D. Feel free to reach out to us here or on our forum. If you think that this issue is no longer relevant, you may close it by yourself. In any case, we apologise for the inconvenience and we thank you for your patience and contributions so far!