Background correction of whole well images

Hi everyone,
I am working with time series images taken by the Incucyte S3 in Dilution Cloning/Whole well imaging mode. What it means that I get images with the well in the middle but a perfect black background around it( https://imperialcollegelondon.box.com/shared/static/5v0349lyx39laxpeiujjzvt3qr0jwnyh.tif ).

When I do correction using BaSiC it seems to work okay except for the fact that florescence at the wall border is enhanced which makes the downstream analysis using trackmate a bit tricky.

Has anyone had a similar problem before and knows how to deal with such images best? Ideally using jython as I have hundreds of stacks to process :wink: One thing which adds to the problem is that the well border is not always lying in the same spot of the picture making automated cropping a bit tricky.

Thanks,
Jonas