Nextflow pipeline for importing large GeoJSON cell annotations into a QuPath project using headless QuPath.
- Runs QuPath in CLI mode against a
.qpprojproject. - Executes
import_large_geojson.groovyto match and import GeoJSON files into each image in the project. - Each GeoJSON file is matched to a project image by filename stem (e.g.
image_001.geojson→image_001.ome.tif). - Optionally clears existing objects before importing (default: yes).
--projectPath to QuPath project (.qpproj).--geojson_dirDirectory containing GeoJSON files to import.
--qupath_binPath to QuPath executable (default:/stornext/System/data/software/rhel/9/base/tools/QuPath/0.6.0/bin/QuPath).--scriptGroovy script path (default:bin/import_large_geojson.groovy).--clear_existingClear all existing objects before importing (default:true).--file_patternPattern for matching GeoJSON files to images (default:{stem}.geojson).{stem}is replaced with the image name without extension.--outdirOutput directory for log files (default:results).--publish_dir_modeNextflowpublishDirmode (default:copy).
nextflow run main.nf \
--project /path/to/QuPath_project/project.qpproj \
--geojson_dir /path/to/geojson_files/ \
--outdir /path/to/outputWith custom file pattern (e.g. for files named sample_segmentation.geojson):
nextflow run main.nf \
--project /path/to/QuPath_project/project.qpproj \
--geojson_dir /path/to/geojson_files/ \
--file_pattern "{stem}_segmentation.geojson"To keep existing objects (append mode):
nextflow run main.nf \
--project /path/to/QuPath_project/project.qpproj \
--geojson_dir /path/to/geojson_files/ \
--clear_existing falseMemory is the main resource for large GeoJSON imports. CPU count is low since QuPath imports are single-threaded.
| Profile | Executor | Queue | CPUs | Memory | Time |
|---|---|---|---|---|---|
standard (default) |
slurm | regular | 4 | 450 GB | 48h |
small |
slurm | regular | 4 | 128 GB | 48h |
medium |
slurm | regular | 4 | 480 GB | 48h |
large |
slurm | regular | 8 | 1200 GB | 48h |
Use -profile small, -profile medium, or -profile large to override.
qupath_geojson_import.logwith full QuPath run logs including per-image import status.
- For large GeoJSON files (100GB+), use the
mediumorlargeprofile to ensure enough memory. - The Groovy script handles
.ome.tif/.ome.tiffextensions when matching stems. - Images with no matching GeoJSON file are skipped with a warning (not an error).