Creating a virtual z-stack slide?

178 views
Skip to first unread message

Thomas Kilvær

unread,
Feb 10, 2018, 4:04:06 PM2/10/18
to QuPath users
Hi
Is it possible to create a virtual z-stack from slides using the current tools available in QUPATH?
Was thinking deformable registration of TMA cores or whole slides combined into a multilevel slide for virtiual multiplexing

micros...@gmail.com

unread,
Feb 10, 2018, 5:40:58 PM2/10/18
to QuPath users
I think the closest I have come to that would be performing the registration external to QuPath (Slidematch in my case) and then copying the cell detection from one slide onto another.  You can just copy and rename the .qpdata file, then generate new stain intensity measurements on the second slide using all of the detections from the first.  Theoretically you can continue to do this for as many slides as your registration is capable of overlapping, and perform the classification at the end.  Then overlay that final classification back over each slide.  No Z stack though, just a set of images in a project.

Pete

unread,
Feb 14, 2018, 3:27:01 AM2/14/18
to QuPath users
Can you describe more the starting point, e.g.
  • whole slide scans (TMA/biopsy/whole section) or smaller images?
  • brightfield H-DAB, brightfield other stains (which?), fluorescence?
  • images already registered or not?
Some extra notes:
  • QuPath can already handle z-stacks, so if you can write a z-stack in some other software containing your registered images in a QuPath-compatible file format then this should work (e.g. ImageJ tiff, if small enough)
  • Any deformable registration would need to be done outside QuPath.  'Outside' could potentially still mean via a script, but it would be a script where you'd probably need to call external libraries and do a lot of work.  The result would then need to be saved as a full image.  The most that QuPath could perform dynamically is an affine transform.
  • If you have multiple pre-registered images, it would be possible to write an ImageServer for QuPath that dynamically combines them to give additional channels and/or a z-stack.
I suspect that multiple channels in a (pseudo-)fluorescence image would be most useful.  If your data is brightfield, you'd need to also perform color deconvolution and treat each deconvolved stain as a separate fluorescence channel - but all this can certainly be done in a custom ImageServer.  It would involve wrapping one or more existing ImageServers (i.e. the Java objects used to read the pixels in your original images) and then intercepting the pixels to perform some extra transformation before returning them.

I've done various tricks like this with ImageServers in the past, so can confirm it works - and can even be done with Groovy rather than Java.  If you have any pre-registered images for which this would be meaningful, just let me know if you want to discuss or explore further.

Thomas Kilvær

unread,
Feb 20, 2018, 12:26:08 PM2/20/18
to QuPath users
My starting point would be 
  • brightfiled-DAB/other TMA. 
  • images not registered
I think I will have to dabble with this for a while before I have anything useful to contribute. If we are able to co-register 3 images by shape alone and detect cells on the middle one it would give up to 8 IHC targets for brigthfield and very many targets for fluorescence.... Could be useful for many I guess...

When I find time to try some more on my own I will certainly take you up on the offer to further explore this topic

Emilio Madrigal

unread,
Dec 16, 2018, 9:25:45 PM12/16/18
to QuPath users
Dear Pete, 

How can I access the different z-stacks in my WSI? Also, can a selected focal plane be exported as the native WSI image file from QP? 

Thanks!

micros...@gmail.com

unread,
Dec 16, 2018, 9:49:30 PM12/16/18
to QuPath users
There should be a slider in the upper left corner of the image if QuPath is correctly reading it as a z stack or time series.

QuPath does not create whole slide images, you should use the original software that generated the WSI for that kind of export.

Emilio Madrigal

unread,
Dec 16, 2018, 9:56:03 PM12/16/18
to QuPath users
So it must be that the WSI is not recognized as having multiple focal planes. These are Hamamatsu .ndpi files, which I have tested in their native viewer as having multiple focal planes.  

micros...@gmail.com

unread,
Dec 17, 2018, 1:31:25 AM12/17/18
to QuPath users
Have you tried both with and without using the Bioformats server? I forget which ndpi defaults to(Openslide?), but you may want to try the other.

Pete

unread,
Dec 17, 2018, 6:27:02 AM12/17/18
to QuPath users
You'll definitely need to install Bio-Formats and force Bio-Formats to be used to read .ndpi files.  More information at the bottom of this page: https://github.com/qupath/qupath-bioformats-extension

Otherwise QuPath will default to using OpenSlide, which can only return a single 2D plane.

To answer your other question, it's not possible to write a whole slide image from QuPath currently, only to extract smaller regions from specific planes and to write these as separate images.
Reply all
Reply to author
Forward
0 new messages