Skip to content

Lazy transformations on images and labels #162

Description

@Artur-man

This is mostly related to #89. Now that most operations on points and shapes are lazy, we have to explore images and labels too.

> x <- file.path("extdata", "blobs.zarr")
> x <- system.file(x, package="SpatialData")
> (x <- readSpatialData(x, anndataR=TRUE))
>
> img <- image(x,2)
> img_data <- data(img)
> utils:::format.object_size(object.size(img_data), "auto")
[1] "2.2 Kb"
> rotated_img <- SpatialData::scale(image(x,2), c(2,2,2))
> rotated_img_data <- data(rotated_img)
> utils:::format.object_size(object.size(rotated_img_data), "auto")
[1] "3.4 Mb"

a possible direction could be to define custom DelayedOp for such cases and calculate, e.g. EBImage::resize, when img is rasterized, collected etc.

Progress

  • Affine
  • Resize/scale (it is a function of affine)
  • Rotate (I am unsure about this, there is no rotation trans in sd?)
  • Translate
  • Sequence
  • Transformations on image pyramids

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions