BIMSBbioinfo/VoltRon

importImageData won't work on pyramidal TIFF

Closed this issue · 1 comments

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 #80 (comment)

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)