ropensci / colocr

An R package for conducting co-localization analysis. Edit
https://docs.ropensci.org/colocr
GNU General Public License v3.0
26 stars 3 forks source link

Same roi_select area on different comparions/images #8

Open apelin20 opened 1 month ago

apelin20 commented 1 month ago

Hello,

Very useful and unique package. I am comparing multiple markers against one and was wondering if I could somehow use the same roi_select coordinates on a few different images to perform the tests on the same area in each case?

Alternatively, is it possible to perform the test without roi_select (i.e. on the whole image)?

Thanks!

MahShaaban commented 1 month ago
apelin20 commented 1 month ago

Thank you! I am having difficulty analyzing the 2 images:

> fls <- c("test1.png", "test3.png")
> image_list <- image_load(fls)
> image_list %>% roi_select(threshold = 90) %>% roi_test()
Error in `[.default`(im, , , , ind, drop = FALSE) : 
  subscript out of bounds
In addition: Warning messages:
1: In grayscale(img) : Image appears to already be in grayscale mode
2: In grayscale(img) : Image appears to already be in grayscale mode
3: In grayscale(img) : Image appears to already be in grayscale mode

The issue is likely the fact that I had to process the images in magick and needed to convert them to grayscale. Is it still possible to compare the pixel intensities?

One more question, is it possible to do roi_select once on imgRef and use that when coomparing img1 to img2, 1 to 3, etc...

MahShaaban commented 1 month ago