computationalpathologygroup / ASAP

Program for the analysis and visualization of whole-slide images in digital pathology
https://computationalpathologygroup.github.io/ASAP/
GNU General Public License v2.0
613 stars 164 forks source link

Error with closing multiresolutionimageinterface image #203

Closed jeroenvermazeren closed 3 years ago

jeroenvermazeren commented 3 years ago

When trying to close an image an error occurs. According to the error it is not possible to close the image as there is no function close for this image.

Below the code, for privacy reasons I changed the image path to "*.tif"

from multiresolutionimageinterface import MultiResolutionImageReader

if __name__ == '__main__':
    mir_reader = MultiResolutionImageReader()
    wsi_multi = mir_reader.open('*.tif')
    wsi_multi.close()

Error traceback

Traceback (most recent call last):
  File "/home/jeroen/Documents/scratch/mart_test/main.py", line 6, in <module>
    wsi_multi.close()
AttributeError: 'MultiResolutionImage' object has no attribute 'close'

The error occurs on Ubuntu 20.04 with ASAP taken from https://ci.appveyor.com/project/GeertLitjens/asap and python 3.6.

hanspinckaers commented 3 years ago

Closing an image is not needed anymore. It’s done on garbage collection. If you want to force it you could del the variable.