rhoitink / simulatedmicroscopy

Python package to create synthetic (fluorescence) microscopy images of (nano)particles and convolution with a point spread function
https://rhoitink.github.io/simulatedmicroscopy/
MIT License
0 stars 0 forks source link

Use better downsampling method for images to reduce image artefacts #7

Closed rhoitink closed 1 year ago

rhoitink commented 1 year ago

Currently scipy.signal.resample is used for downsampling images (see https://github.com/rhoitink/simulatedmicroscopy/blob/main/simulatedmicroscopy/image.py#L320-L322), but skimage.measure.block_reduce seems to give more accurate downsampling results: image

In the image generated by scipy.signal.resample (right figure, top right) some intensity fluctuations are visible, whereas skimage.measure.block_reduce does not seem to give this behaviour. Using the argument func=np.mean gives more representable pixel values that do not depend on the block_size. Therefore the downsampling method should be changed to skimage.measure.block_reduce