Bayer-Group / paquo

PAthological QUpath Obsession - QuPath and Python conversations
GNU General Public License v3.0
103 stars 16 forks source link

add_image() for multi-scene images #82

Closed mezwick closed 1 year ago

mezwick commented 1 year ago

Issue

Some image files like .czi files and .vsi files hold multiple scenes. For .czi files this can be multiple regions imaged on a slide, while for .vsi files this can be an overview image (scene 1) + the full pyramidal image (scene 2). When images are added to a project with the QuPath GUI with add images, all scenes are loaded. But when loaded through Paquo with qp.add_image(), only the first scene is loaded.

Expected behaviour

qp.add_image() loads all scenes from an image file, or at least gives the option to specifiy which scene is loaded

Context

This was mentioned on https://forum.image.sc/t/paquo-read-write-qupath-projects-from-python/41892/29?u=merrick but I don't think raised as a github issue so I raise it here myself

ap-- commented 1 year ago

Hi @mezwick,

thanks for reporting the issue ❤️

Could you try to reproduce with a file from here: https://openslide.cs.cmu.edu/download/openslide-testdata/ It'll be easier for me to track down the error if I have an example.

Cheers, Andreas 😃

mezwick commented 1 year ago

Sure. So for example with https://openslide.cs.cmu.edu/download/openslide-testdata/Zeiss/Zeiss-5-Flat.czi

If I add the image via QuPath GUI, you see scene 1 and scene 2 are added to the project as 2 images image

However, when added via qp.add_image(), only the first scene is added to the project image

I am testing on Windows with QuPath Version: 0.3.2

benclee commented 1 year ago

Hello, thank you @mezwick for posting this issue. I am the original poster on this issue from forum.image.sc. I confirm the issue and expected behavior. And @ap-- , I appreciate that this will be looked at in a coming release. Appreciate all your work. Ben

ap-- commented 1 year ago

Note to self:

ap-- commented 1 year ago

@mezwick @benclee if you could install paquo from the support-multiscence-images branch and report if it resolves the issue for your use cases, that would be great ❤️

Cheers, Andreas

benclee commented 1 year ago

Hello @ap-- , after installing this branch, I was able to read in and save multiple scenes from my own set of images, and confirm this by opening the project in QuPath. I was even able see that the add_image() function returns an array of image entry objects, one for each scene, which was useful to add scene specific annotations. Thanks for the speedy resolution! Ben

mezwick commented 1 year ago

I can also confirm this works on both local and network test images. I checked on both the linked multscene .zvi file and a network mounted .vsi file.

Thanks for the fix!