insitupy.io.read_qupath_project#
- insitupy.io.read_qupath_project(path, pixel_size=None, export_folder='insitupy', method_name='mIF')#
Load and process a full QuPath project directory into an
InSituExperimentobject.This function scans a QuPath project directory for sample subfolders containing exported spatial data. Each sample is processed using
read_qupath, and the resultingInSituDataobjects are aggregated into a singleInSituExperimentinstance.- Parameters:
path (Union[str, os.PathLike, Path]) – Path to the root directory of the QuPath project.
pixel_size (Number) – Pixel size used to scale coordinates from annotation geometry.
method_name (str, optional) – Name of the imaging method used. Defaults to multiplexed IF (“mIF”).
- Returns:
An object containing all samples and modalities from the project.
- Return type:
- Raises:
FileNotFoundError – If any required files are missing in the sample directories.
ValueError – If any annotation file contains more than one geometry.
Notes
Each sample folder within the project directory is expected to follow the structure described in
read_qupath, including:annotation.geojsonmeasurements.tsvcells.geojsonimage.ome.tif
To generate data in the correct format from QuPath, use the following export script: SpatialPathology/InSituPy-QuPath
Example
>>> exp = read_qupath_project( ... path="/data/qupath_project", ... pixel_size=0.65 ... )