Writes a bundle directory containing a manifest, the requested
representations and an integrity.json inventory with SHA-256 hashes and
relative paths. All representations describe the same envelope: the
integer mask TIFF holds exact labels, the GeoJSON holds exact pixel-edge
polygons in image coordinates with the same object ids, and the
measurements table uses the canonical long format (value_state
distinguishes missing, NaN and infinite values). RDS is an optional
R-native optimisation and never the only representation.
Arguments
- x
An
sg_mask,sg_run,sg_image, or a named list withimage,mask,run,measurements.- destination
Directory to create. It must not exist or be empty; with
overwrite = TRUEan existing segmantR bundle is replaced.- formats
Any of
"manifest","mask_tiff","geojson","measurements","measurements_parquet","legend","image_tiff","run","rds". The manifest and integrity inventory are always written.- ...
Reserved; must be empty.
- image
Optional
sg_imagefor image descriptors, intensity measurements and"image_tiff".- object_type
QuPath object type for GeoJSON features (
"detection","annotation"or"cell").- overwrite
Logical; replace an existing segmantR bundle.
Examples
m <- sg_example_mask("fluorescence_nuclei")
img <- sg_example_image("fluorescence_nuclei")
out <- sg_export_interchange(m, tempfile("bundle"), image = img)
list.files(out$path)
#> [1] "integrity.json" "manifest.json" "mask.legend.json" "mask.tif"
#> [5] "measurements.csv" "objects.geojson"
out$bundle_digest
#> [1] "sha256:1ae7683d0f3b3d488eb352177d09784c185108db73a180e93fe81e7985349fa2"