BIMSBbioinfo / VoltRon

Spatial omic analysis toolbox for multi-resolution and multi-omic integration using image registration
http://bioinformatics.mdc-berlin.de/VoltRon/
Other
38 stars 9 forks source link

importImageData won't work on pyramidal TIFF #81

Closed Artur-man closed 7 months ago

Artur-man commented 7 months ago

Nice!

I can now load the function, but I receive a new error:

Error in seq.default((tile.size/2) + even_odd_corretion, imageinfo$width, : 'to' must be of length 1
Traceback:

1. importImageData("/home/kuppelab/Documents/ST_align_Spacehack/Spacehack_2023/2021-AKK019_remote.vmic.tiff", 
 .     sample_name = "AKK019", image_name = "H&E")
2. seq((tile.size/2) + even_odd_corretion, imageinfo$width, tile.size)
3. seq.default((tile.size/2) + even_odd_corretion, imageinfo$width, 
 .     tile.size)
4. stop("'to' must be of length 1")

It is a normal RGB TIFF

Any idea?

Originally posted by @pakiessling in https://github.com/BIMSBbioinfo/VoltRon/issues/80#issuecomment-1959728471

Artur-man commented 7 months ago

New update allows one to choose layers of pyramidal images as integer indices and define VoltRon object with image data only using only one of those layers.

# build VoltRon object from image path
vrimgdata <- importImageData("image.tiff", tile.size = 10, stack.id = 2)

# build VoltRon object from stacked magick-image
img_magick <- magick::image_read("image.tiff")
vrimgdata <- importImageData(img_magick, tile.size = 10, stack.id = 2)