I’m looking to export multiple images from Qupath to ImageJ in one go using the script editor. At the moment I have been using the “Sending Image Region to ImageJ” button for each individual image. Does anyone have experience in trying this and would be able to help please?
That script works great thanks. Just one more thing, is it possible to export detection objects created in qupath along with the image into ImageJ using this method? Sorry, I’m just starting out with the .groovy scripting.
Ah, not so easily. With v0.1.2 I think this is probably the key method:
I can’t promise the method hasn’t shifted amidst all the refactoring I’m doing for v0.2.0 at the moment… although the benefit is that it should be more logical and documented after the changes.
It’s definitely scripting one way or another, just more complex. The minimal code to get something working will depend on
which version of QuPath you’re using
if you’re exporting a full image at full resolution, or a downsampled region
if your detections are cells, and you need both the nucleus ROI and the cell boundary ROI or just one of them
if you need annotations as well as detections transferred
if you need to handle extra dimensions (e.g. a time series or z-stack)
If you can describe in more detail what you want & for what purpose I’ll give a bit more thought to the simplest way to do it. For example, if you really want to get the detections to ImageJ because you’re wanting to get a binary mask then that could be generated directly in the script without any need to bother converting all the ROIs.
This commit adds more options to the command to send regions to ImageJ, and also handles multiple selections (i.e. by selecting multiple objects, you can send them all to ImageJ in one go without needing to script it).
Sorry for the late reply, I’ve been on holiday the past week.
We’re using Quapath 0.2.0
We are using down-sampled regions as these are whole face sections were looking at
We are using the pixel classifier to detect tumor and stroma and create detections from that. We’re then deleting the tumor detection as we’re only interested in the stroma. So essentially we’re looking to bring across the down-sampled image to imageJ with the one detection for stroma. We don’t need any time series or z-stack. We also don’t need any annotations transferred over, just the single stroma detection.
Once that’s in ImageJ, we are extracting random patches from the stroma area.
If little tile images are the end goal, have you tried any of the QuPath scripts that do similar things? Not sure if there was something specific you were missing that needed to be run through FIJI.
It is trying to write a JPEG, so it might fail if you aren’t on a brightfield image? Not sure. There are other posts/issues about various writers not working, but again, I haven’t really played with it too much.