Skip to contents

Use Python's 'spatialdata' 'transform_to_data_extent' on a spatialdata zarr store

Usage

do_tx_to_ext(srcdir, dest, coordinate_system, ...)

Arguments

srcdir

character(1) path to folder holding a zarr store

dest

character(1) a path to a desired destination for new zarr representation

coordinate_system

character(1) defaults to "global"

...

arguments for passage to python `transform_to_data_extent`; can include "maintain_positioning" (logical (1)) or numerics for target_unit_to_pixels, target_width, target_height, target_depth.

Examples

src <- system.file("extdata", "blobs.zarr", package="SpatialData")
td <- tempfile()
do_tx_to_ext(
  srcdir=src, dest=td, 
  coordinate_system="global",
  maintain_positioning=FALSE, 
  target_width=400.)
#> NULL
(sd <- readSpatialData(td))
#> class: SpatialData
#> - images(4):
#>   - blobs_image (3,400,400)
#>   - blobs_labels (1,400,400)
#>   - blobs_multiscale_image (3,400,400)
#>   - blobs_multiscale_labels (1,400,400)
#> - labels(0):
#> - points(1):
#>   - blobs_points (200)
#> - shapes(3):
#>   - blobs_circles (5,circle)
#>   - blobs_multipolygons (2,polygon)
#>   - blobs_polygons (5,polygon)
#> - tables(1):
#>   - table (3,10)
#> coordinate systems:
#> - global(8): blobs_image blobs_labels ... blobs_polygons blobs_points