๐Ÿงฌ InSituPy-QuPath

August 7, 2025 ยท View on GitHub

This repository contains a collection of scripts and documentation designed to connect InSituPy with QuPath.

The scripts serve various purposes such as data export, preprocessing, and integration.


๐Ÿ“‚ Folder Overview

scripts/

Scripts written in Groovy for use with QuPath. These scripts help export data in formats compatible with InSituPy.

Included scripts:

  • run_instanseg Runs InstanSeg on all annotations of the current image. Annotations need to be uniquely named. Can be also combined with "Run for project" to apply it to multiple images within the same project. To successfully run the script, the QuPath InstanSeg extension has to be installed and run once via the user interface (Extensions โ†’ InstanSeg โ†’ Run InstanSeg) to download PyTorch. Also the models can be downloaded via the user interface.
  • export_for_insitupy.groovy: Exports multiplexed IF data including cellular measurements, images as well as nuclear and cellular boundaries. Requires segmentation of cells using e.g. InstanSeg. Exported data can be read using read_qupath or read_qupath_project.
  • export_images.groovy: Exports OME-TIFF images based on annotations.
  • export_annotations: Exports annotations as GEOJSON files.

๐Ÿš€ Getting Started

To make the scripts easily accessible within QuPath:

Download or clone this repository into the following location depending on your operating system:

  • Windows: C:/Users/<your-username>/QuPath/scripts/InSituPy-QuPath

  • macOS: /Users/<your-username>/QuPath/scripts/InSituPy-QuPath

  • Linux: /home/<your-username>/QuPath/scripts/InSituPy-QuPath

Replace <your-username> with your actual system username.

โ–ถ๏ธ Accessing Scripts in QuPath

  1. Open QuPath.
  2. Go to: Automate โ†’ Shared scripts...
  3. You will see the scripts listed and ready to run from within the QuPath interface.

This setup ensures the scripts are available across all QuPath projects and simplifies workflow integration.

To run the scripts on a whole QuPath project, one can use Run โ†’ Run for project in the script editor.


๐Ÿ“„ License

This repository is licensed under the MIT License. See the LICENSE file for details.


๐Ÿค Contributing

Contributions are welcome! If you have a useful script or improvement, feel free to open a pull request or issue.