From ahraza at ruc.dk Sat Jul 2 22:23:06 2022 From: ahraza at ruc.dk (Ali Hassan Raza) Date: Sun, 3 Jul 2022 02:23:06 +0000 Subject: Nanozoomer annotation coordinate system to openslide pixels Message-ID: <93D06541-65ED-4135-A5D0-751712CFCEAB@ruc.dk> Hello Benjamin, I am desperately in need of help. My name is Ali, and I am a masters level student in computer science at roskilde university in Denmark. I am writing my masters thesis in cardiac biopsy using a deep learning approach. The dataset I am working with is from rigshospital in Copenhagen, and they use a scanner from hamamatsu. The WSI they have provided are in the format of NDPI alongside the annotation the pathologist have done which are in NDPA format. I want to segmentate the areas (create a mask) where the pathologist have done annotations, so that I can make some models which can learn from the masks, and thereby test them on some data to see how well the model performs. I did som research on the internet and could not find anything about how to convert these coordinates, until I came across your debat. I am stuck and would be very thankful if you could help me in my need and explain how you managed to convert these coordinates. I am coding in python using jupyter notebook. Kind Regards Ali Hassan Raza Roskilde University From ahraza at ruc.dk Wed Jul 6 01:18:21 2022 From: ahraza at ruc.dk (Ali Hassan Raza) Date: Wed, 6 Jul 2022 05:18:21 +0000 Subject: Need help urgent Message-ID: <055F1489-49BF-44A0-A46A-039CC144A552@ruc.dk> Hello Openslide members, I am desperately in need of help. My name is Ali, and I am a masters level student in computer science at roskilde university in Denmark. I am writing my masters thesis in cardiac biopsy using a deep learning approach. The dataset I am working with is from the hospital rigshospital in Copenhagen, and they use a scanner from hamamatsu which saves the WSI in the format of NDPI alongside the annotation the pathologist have done which are in NDPI.NDPA format. I want to segmentate the areas (create a mask) where the pathologist have done annotations, so that I can make some deep learning models which can learn from the masks, and thereby test them on some data to see how well the model performs. I did som research on the internet and could not find anything about how to convert these coordinates, until I came across some posts where people have suggested that openslide plugin may be useful. The problem I have is that the annotations the pathologist have done on the ndpi wsi have negative x and y coordinates, which means that the coordinates system in ndpi format has 0,0 in the center of the slide (I guess) and not the top left corner as normal images. I am stuck at the moment, and don?t know how to deal with the ndpi.ndpa annotations, and would be very thankful if you could help me. I am coding in python using jupyter notebook. Kind Regards Ali Hassan Raza Roskilde University -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhaoy at motic.com Wed Jul 6 01:31:06 2022 From: zhaoy at motic.com (zhaoy at motic.com) Date: Wed, 6 Jul 2022 05:31:06 +0000 Subject: Need help urgent In-Reply-To: <055F1489-49BF-44A0-A46A-039CC144A552@ruc.dk> References: <055F1489-49BF-44A0-A46A-039CC144A552@ruc.dk> Message-ID: Hi Ali, Is there any example data we can try to help ? Yu Zhao On Jul 6, 2022, at 1:18 PM, Ali Hassan Raza via openslide-users > wrote: Hello Openslide members, I am desperately in need of help. My name is Ali, and I am a masters level student in computer science at roskilde university in Denmark. I am writing my masters thesis in cardiac biopsy using a deep learning approach. The dataset I am working with is from the hospital rigshospital in Copenhagen, and they use a scanner from hamamatsu which saves the WSI in the format of NDPI alongside the annotation the pathologist have done which are in NDPI.NDPA format. I want to segmentate the areas (create a mask) where the pathologist have done annotations, so that I can make some deep learning models which can learn from the masks, and thereby test them on some data to see how well the model performs. I did som research on the internet and could not find anything about how to convert these coordinates, until I came across some posts where people have suggested that openslide plugin may be useful. The problem I have is that the annotations the pathologist have done on the ndpi wsi have negative x and y coordinates, which means that the coordinates system in ndpi format has 0,0 in the center of the slide (I guess) and not the top left corner as normal images. I am stuck at the moment, and don?t know how to deal with the ndpi.ndpa annotations, and would be very thankful if you could help me. I am coding in python using jupyter notebook. Kind Regards Ali Hassan Raza Roskilde University _______________________________________________ openslide-users mailing list openslide-users at lists.andrew.cmu.edu https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users ________________________________ ????? ?????????????????????????????????? @motic.com ???????????????????????????????????????????????????????????????????????????????????????????? Important Notice: This message from @motic.com's email system is for the designated recipient only and may contain privileged, propritary, or otherwise private information. If you received it error, please notify the sender immediately and delete the original. Any other use of this email by you is prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From coleman at proscia.com Wed Jul 6 01:53:33 2022 From: coleman at proscia.com (Coleman Stavish) Date: Wed, 6 Jul 2022 01:53:33 -0400 Subject: Need help urgent In-Reply-To: <055F1489-49BF-44A0-A46A-039CC144A552@ruc.dk> References: <055F1489-49BF-44A0-A46A-039CC144A552@ruc.dk> Message-ID: Hi Ali, Please have a look at this thread from 2014 on this topic: https://lists.andrew.cmu.edu/pipermail/openslide-users/2014-November/000965.html Paraphrasing Benjamin Gilbert's response linked above, the coordinates in the ndpa file are in physical units (nanometers, specifically) relative to the center of the *slide* as you deduced. You will need to extract the XOffsetFromSlideCentre and YOffsetFromSlideCentre properties from the ndpi image using Openslide. Adding these to each coordinate will yield physical units relative to the center of the main *image*. (Note the center of the image does not necessarily correlate to the center of the physical slide). Then, you can divide the coordinates by 1000 to yield microns. Using the mpp-x and mpp-y (microns per pixel) Openslide properties for the ndpi image, divide by mpp-[xy] to get pixel coordinates relative to the center of the main image. Finally, subtract by level-0 dimensions / 2 to get into a coordinate space with (0,0) as top-left origin. Best, Coleman On Wed, Jul 6, 2022 at 1:19 AM Ali Hassan Raza via openslide-users < openslide-users at lists.andrew.cmu.edu> wrote: > Hello Openslide members, > > I am desperately in need of help. My name is Ali, and I am a masters level > student in computer science at roskilde university in Denmark. I am writing > my masters thesis in cardiac biopsy using a deep learning approach. The > dataset I am working with is from the hospital rigshospital in Copenhagen, > and they use a scanner from hamamatsu which saves the WSI in the format of > NDPI alongside the annotation the pathologist have done which are in > NDPI.NDPA format. > > I want to segmentate the areas (create a mask) where the pathologist have > done annotations, so that I can make some deep learning models which can > learn from the masks, and thereby test them on some data to see how well > the model performs. I did som research on the internet and could not find > anything about how to convert these coordinates, until I came across some > posts where people have suggested that openslide plugin may be useful. > > The problem I have is that the annotations the pathologist have done on > the ndpi wsi have negative x and y coordinates, which means that the > coordinates system in ndpi format has 0,0 in the center of the slide (I > guess) and not the top left corner as normal images. I am stuck at the > moment, and don?t know how to deal with the ndpi.ndpa annotations, and > would be very thankful if you could help me. I am coding in python using > jupyter notebook. > > Kind Regards > Ali Hassan Raza > Roskilde University > _______________________________________________ > openslide-users mailing list > openslide-users at lists.andrew.cmu.edu > https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users > -- *Coleman Stavish* Chief Technology Officer | Proscia +1 610-996-3951 www.proscia.com This email and any attachments are confidential and intended solely for the individual to whom they are addressed. If you have received this message in error, please notify the sender immediately and delete this email from your system. Nothing in this email amounts to a contractual or other legal commitment on the part of Proscia. -- This email and any attachments are confidential and intended solely for the individual to whom they are addressed. If you have received this message in error, please notify the sender immediately and delete this email from your system. Nothing in this email amounts to a contractual or other legal commitment on the part of Proscia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhenrik at uw.edu Fri Jul 8 18:05:34 2022 From: jhenrik at uw.edu (Jonathan C. Henriksen) Date: Fri, 8 Jul 2022 22:05:34 +0000 Subject: Need help urgent Message-ID: Ali, Take a look at QuPath and read through the docs. https://qupath.github.io/ It has built in tools to export tiles, included labeled image masks, for deep learning projects: https://qupath.readthedocs.io/en/stable/docs/advanced/exporting_annotations.html?highlight=export%20tiles#binary-labeled-images You will need to develop a script to convert the NDPI annotations into QuPath annotations. Search around on the active user forums, as someone may have already posted a similar question, e.g. https://forum.image.sc/t/importing-ndpa-annotation-files-into-qupath-code-attached/33721 Kind Regards, Jonathan Henriksen Laboratory Medicine and Pathology Digital Pathology Coordinator for Anatomic Pathology Research IT Coordinator for NWBioSpecimen Shared Resource University of Washington -------------- next part -------------- An HTML attachment was scrubbed... URL: From stanard at aims-senegal.org Mon Jul 11 09:24:20 2022 From: stanard at aims-senegal.org (Stanard Mebwe P.) Date: Mon, 11 Jul 2022 15:24:20 +0200 Subject: Help with Openslide installation error on windows 10 Anaconda3 Message-ID: Dear Openslide Users, I would like to use openslide to visualise huge .ndpi images. I have a problem installing openslide on my computer. I have windows10 , and Anaconda3 plus python 3.9. I did on the terminal ran "pip install openslide-python" I went online on the openslide.org/download website. I did download the windows 64Bit last version of openslide. I then extracted it into my "C:/Users/User_name/Anacona3/lib/slide-package/openslide/" folder in the file "openslide/lowlevel.py" , I did add the following code " from __future__ import division import os os.environ['PATH'] = "C:/Users/my_name/Anaconda3/lib/site-packages/openslide/openslide-win64-20171122/bin" +";"+os.environ["PATH"] " on top ot the script When running on the terminal of spider IDE, I have the following error: ModuleNotFoundError: Couldn't locate OpenSlide DLL. Did you call os.add_dll_directory()? https://openslide.org/api/python/#installing I have seen online that many people have the similar or other type of error, but I coulnd find a solution. May someone help?? Thank you in advance. Regards, Stanard MP -- Stanard MP -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgilbert at cs.cmu.edu Wed Jul 27 01:32:49 2022 From: bgilbert at cs.cmu.edu (Benjamin Gilbert) Date: Wed, 27 Jul 2022 01:32:49 -0400 Subject: Nightly Windows builds are available again Message-ID: Hi all, I'm pleased to announce an update on the OpenSlide Windows builds: - Builds have been fixed to work correctly with a current MinGW-w64 toolchain. - All dependencies have been updated. - The build now runs in a Fedora container image that's refreshed weekly by GitHub Actions, removing the need to manually install dependencies on the build machine. Container-based builds should work both on Linux and on Windows with WSL2. - Support for building in Cygwin has been removed. - Nightly builds have been migrated to GitHub Actions and are running again. The nightly builds are available at: https://openslide.org/builds/windows/ Please try them out and report problems. If no issues are found, I plan to release a new official Windows build in the coming weeks. (Unlike the nightly builds, the official release will still include OpenSlide 3.4.1, not the Git main branch.) Best, --Benjamin Gilbert From D.R.Magee at leeds.ac.uk Wed Jul 27 11:55:13 2022 From: D.R.Magee at leeds.ac.uk (Derek Magee) Date: Wed, 27 Jul 2022 15:55:13 +0000 Subject: MRXS Format ... Message-ID: Hi, I've been working on reading Fluorescence MRXS files for a project (they are near identical to brightfield ones, just with extra RGB tiles for extra channels despite what the rant on the open microscopy page says) using openslide's excellent resources (MIRAX format (openslide.org), Introduction to MIRAX/MRXS (cmu.edu)). I was wondering if anyone could explain to me the last bit I've not quite understood, which is the low resolution levels where multiple scanner images are combined into a single tile. These appear to have an index that when used to look up the location in the position file puts the composite tile in more-or-less the right place, but not exactly. The error seems slightly different for each tile, but there seems to be a systematic shift in both horizontal and vertical position as well as a random one. The introduction to MRXS says: In order to render this tile, we have to separately extract the pixels corresponding to each camera position -- many of which are fractional pixels due to repeated downsampling -- and render them in their correct positions at sub-pixel resolution. However, in the file I have the tiles at this resolution seem to be coherent (i.e. no junk in the middle). However, the index isn't quite right. I'm not exactly sure how to "render them in their correct positions" as I'd assume the index would be correct at least for the top left part of the tile. I note Openslide renders the first 3 channels of these type of slides "correctly" (in location anyway) as RGB, ignoring the subsequent channels. What I'm not sure is whether Openslide renders the low resolution composite tiles, or ignores them (which is what I'm doing for now, but it makes rendering at low resolution a bit slow). Any pointers appreciated! Thanks Derek -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgilbert+openslide at cs.cmu.edu Sun Jul 31 02:08:24 2022 From: bgilbert+openslide at cs.cmu.edu (Benjamin Gilbert) Date: Sun, 31 Jul 2022 02:08:24 -0400 Subject: MRXS Format ... In-Reply-To: References: Message-ID: On Wed, Jul 27, 2022 at 11:55 AM Derek Magee wrote: > However, in the file I have the tiles at this resolution seem to be coherent (i.e. no junk in the middle). However, the index isn't quite right. I'm not exactly sure how to "render them in their correct positions" as I'd assume the index would be correct at least for the top left part of the tile. > > I note Openslide renders the first 3 channels of these type of slides "correctly" (in location anyway) as RGB, ignoring the subsequent channels. What I'm not sure is whether Openslide renders the low resolution composite tiles, or ignores them (which is what I'm doing for now, but it makes rendering at low resolution a bit slow). Hi Derek, OpenSlide does render the low-resolution tiles. It's been a while since I looked at that code, but as I recall, the tile top left corner in the position file is accurate. A couple possibilities that might explain what you're seeing: - At higher downsamples, the junk in the middle of the tiles may not be visually apparent, but if you don't remove it, the tiles will have larger dimensions than expected. - Fluorescence slides, or newer MRXS files generally, may store position information in a different format. It may be helpful to run OpenSlide with OPENSLIDE_DEBUG=tiles to see how OpenSlide places the tiles in a sample brightfield slide. Best, --Benjamin Gilbert