Large Zeiss slide scan export/manipulation

Hi all!

I’m quite new to this community so forgive any incompleteness or naiveness of the questions :slight_smile:

I have a set of 150 slide scan images acquired using Zeiss Axio Scan. I would like to do some faily basic quantification with basic thresholding and Analyze particles.

The problem I run into is that the size of the .tiff files created by ZEN software’s export function exceeds the dimension limitations of ImageJ (Fiji in my case) that are (as I found on one of the forum posts here) imposed by Java. I have tried various combinations of BioFormats and BigData viewer to no avail.
I tried to circumvent this using QuPath, but if I want to do any sort of ImageJ mediated approach from within the QuPath, I have to downsample by a factor larger than 4 which renders the final file unusable for my application. The only solution that I can think of now is to go and manually chop all the scans into 4 pieces in ZEN Blue, and analyze them separately. This would not in itself be a problem if I didn’t have to do it 150 times over and be extremely careful that I don’t have an overlap between the segments because it will introduce errors into my measurements.

Does any of your brilliant brains have a better idea on how I can solve this problem and not spend weeks in front of a monitor doing a job of a well trained monkey? :slight_smile:

What are you doing in ImageJ that you can’t do directly in QuPath? Otherwise, I would recommend using the ImageJ macro runner on tiles. Once you have your macro set, you don’t need to downsample at all, though you may need to rebuild or combine the objects that the macro sends back into QuPath.
https://github.com/qupath/qupath/wiki/Working-with-ImageJ

It might be easier to do your whole analysis in QuPath, but since I don’t know what that is, I don’t have much advice other than that.

1 Like

I have IF images with 4 channels. 1 is DAPI and for my analysis unimportant. 2 is marking my areas of interest. From this I want basic area measurements (number of elements, total area, min max size…). 3 is marking a deposit within my areas of interest, and since it appears also outside of the areas of interest I want to measure how many of my areas of interest contain also the deposit. 4 is marking a subarea of interest and for it I want the same thing like for 2.

Basically, the most important thing is to count how many particles identified by 2 contain also 4.

Hopefully that was clear.

Thanks a lot for your help :slight_smile:

How comfortable are you with scripting?

I ask, because my default method would be to chain Subcellular detections.

Essentially, create a whole image annotation. Convert it into a “cell” object. Use subcellular detection with a threshold appropriate for your second channel and fourth channel. That creates a bunch of detections. Delete the initial cell, and turn those detections into “cells,” which are now your channel 2 and 4 regions of interest. Classify appropriately. Within those cells, create subcellular detections for channel 3.

You would then have counts of channel 3 regions within channel 2 and 4 regions (or some other order, I got a little confused whether you want 3 or 4 within 2), and could sum the areas of all channel 3 detections within each parent detection, or calculate mean intensities, look for intensity overlaps, etc.

The whole thing could be run en mass for a project from a single script. But it would require some scripting!

Have done similar stuff for islets.

If you are less interested in areas, you could also just generate the channel 2 objects, and classify them based on mean/median intensity of the other channels (3/4).

1 Like

I have 0 experience in scripting in QuPath/ImageJ, but since I’m doing my PhD and I am coding savvy in general (mostly working in R right now), I think this is a good time to learn :slight_smile:

Thanks a lot for your advice. I am actually working with islets!

If you could suggest a resource where I could get my head around the basics of scripting, I’d be eternally grateful :slight_smile:

I don’t think that will work… it will require getting the image at full resolution, which isn’t possible.

@MarkoBarovic if you are (or would like to be) comfortable with scripting there are examples on my blog, including this one: https://petebankhead.github.io/qupath/scripting/2018/03/08/script-imagej-to-qupath.html

And you may already have seen https://github.com/qupath/qupath/wiki/Working-with-ImageJ

If you are using the latest milestone version, this explains the concepts a bit more: https://petebankhead.github.io/qupath/2019/08/21/scripting-in-v020.html

Basically, it should be possible to do what you want with QuPath (+ ImageJ probably)… including if what you want is to export tiles of the image into ImageJ TIFFs at high resolution in an automated way (e.g. here) so you can do everything else in Fiji.

2 Likes

Thanks, Pete! Much appreciated! :slight_smile:

Ah, Pete is right about pulling that large of an image for a subcellular detection. I forgot I ended up having to use the IF tissue detection script, then converted those into cells, and the rest was pretty much the same.
You can see how the script was used for detecting tumor regions within tissue below, though for something large you do need to downsample it for the first detections (channel 2 I guess).

Another, older example, a bit more general

Someone else asked about scripting here recently.

Much of this scripting won’t quite work for M4 though… and there are small adjusted versions of scripts scattered around for the various milestones.

1 Like

Thanks a bunch @Research_Associate and @petebankhead. I will go through the documents and links shared here and start writing some code.

FYI, I’m starstruck and grateful I got so quick and nice replies from the developer himself and the guy/girl who seems to be the most prolific community contributor to QuPath project :slight_smile:

2 Likes