BiomedicalMachineLearning / stLearn

A novel machine learning pipeline to analyse spatial transcriptomics data
Other
190 stars 25 forks source link

resize returns a copy #238

Closed psl-schaefer closed 9 months ago

psl-schaefer commented 1 year ago

Thanks for developing such a nice package.

I just have a short question. In this line:

https://github.com/BiomedicalMachineLearning/stLearn/blob/09c8d7a79979268fe78273fcb25726c5e94c2c6c/stlearn/image_preprocessing/image_tiling.py#L81

You use tile.resize((target_size, target_size)) which actually returns a copy, but you do not use the resized tile at all (i.e. you do not assign it back to tile). So an easy solution would be tile = tile.resize((target_size, target_size))

See the documentation here: https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.resize

duypham2108 commented 1 year ago

Thank you for suggestion. We will check it and fix it soon