Nanostring-Biostats / SpatialOmicsOverlay

Tools for analyzing data on the image from NanoString GeoMx Digital Spatial Profiler (DSP).
MIT License
17 stars 4 forks source link

Adjusting intensity values crops image erroneously #49

Closed mgrout81 closed 11 months ago

mgrout81 commented 11 months ago

I'm using the mu_dev_E15_012.ome.tiff file from the Spatial Organ Atlas. I noticed this with other SOA mouse dev images, too. When I adjust the intensity values and then recolor and showImage again, the image is cropped. The content printed to the console also reflects the change in size. It seems like the stricter I set the intensity values (to try to artificially "turn off" a channel most of the way), the more severe the cropping is, generally.

> showImage(ps[[4]])
# A tibble: 1 × 7
  format width height colorspace matte filesize density
  <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
1 PNG     2562   3904 sRGB       FALSE        0 72x72  
> chan4 <- add4ChannelImage(ps[[4]])
Calculating and scaling coordinates
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=35s  
> chan4 <- changeColoringIntensity(minInten = 0, maxInten = 1500, overlay = chan4, dye = "FITC")
> recolor(chan4) %>% flipY() %>% showImage()
# A tibble: 1 × 7
  format width height colorspace matte filesize density
  <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
1 PNG     2562   3918 sRGB       FALSE        0 72x72 

Note the change in x and y dimensions.

mgrout81 commented 11 months ago
> fluor(ps[[4]])
        Dye DisplayName   Color WaveLength Target ExposureTime MinIntensity MaxIntensity ColorCode
1   SYTO 13        FITC    Grey      525nm    DNA     100.0 µs           25         2000 #7f7f7fff
2 Alexa 532         Cy3   Green      568nm Custom     300.0 µs           35         3000 #00fe00ff
3 Alexa 594   Texas Red  Yellow      615nm Custom     300.0 µs           45         2000 #fefe00ff
4       Cy5         Cy5 Magenta      666nm Custom     300.0 µs          350         4000 #fe00feff
> fluor(chan4)
        Dye DisplayName   Color WaveLength Target ExposureTime MinIntensity MaxIntensity ColorCode
1   SYTO 13        FITC    Grey      525nm    DNA     100.0 µs            0         1500 #7f7f7fff
2 Alexa 532         Cy3   Green      568nm Custom     300.0 µs           35         3000 #00fe00ff
3 Alexa 594   Texas Red  Yellow      615nm Custom     300.0 µs           45         2000 #fefe00ff
4       Cy5         Cy5 Magenta      666nm Custom     300.0 µs          350         4000 #fe00feff