SWC-Advanced-Microscopy / StitchIt

Stitching of large tiled datasets
GNU Lesser General Public License v3.0
17 stars 7 forks source link

Auto-threshold varies with area occupied by brain #131

Open raacampbell opened 5 years ago

raacampbell commented 5 years ago

The auto-threshold is based on the mean and the mean changes as the proportion of brain in the image changes. So maybe should switch to a median value instead?

raacampbell commented 5 years ago

That doesn't work. What works best, I think, is to scale by the brain area.

raacampbell commented 5 years ago

The scaling by brain area is implemented but not working well: the bulb is saturated but when more brain is visible, the threshold is good.

raacampbell commented 5 years ago

This is still not good enough, TBH.

raacampbell commented 3 years ago

I have switched back to the median: 88b691140d509fac2e1c3abb019a7a5eeb845bbc, b2397c8ed1aff4fe97ca292ff9bec998a578b4d1, ba108c010c9806c06ce987e0d11ddf6f0e9799f9

Right now this works nicely and is easy to understand.

For the auto-ROI this works well and the overly complex thing we had before caused too many problems. If the median starts to again act up in manual ROI cases with little tissue, then I think the best option is not to try finding the brain and normalising by this but to do a trimmed median and SD. The trim could be, say, based on a histogram with 1000 bins that has the lower and upper 1% or so removed. Or we use the empty tile threshold (if it works) and remove all pixel values lower than this.

raacampbell commented 3 years ago

So far this has worked well for auto-ROI data and I have merged into master.