A shiny app for conducting co-localization analysis.
mahshaaban / colocr_app Goto Github PK
View Code? Open in Web Editor NEWA shiny app for conducting co-localization analysis.
A shiny app for conducting co-localization analysis.
#Load
library(imager)
#> Warning: package 'imager' was built under R version 3.5.3
#> Loading required package: magrittr
#>
#> Attaching package: 'imager'
#> The following object is masked from 'package:magrittr':
#>
#> add
#> The following objects are masked from 'package:stats':
#>
#> convolve, spectrum
#> The following object is masked from 'package:graphics':
#>
#> frame
#> The following object is masked from 'package:base':
#>
#> save.image
#load images
im <- load.image('./22.jpg')
plot(im)
#filter by channels
im0 <- grayscale(im)
im1 <- channel(im,1) #red
im2 <- channel(im,2) #green
im3 <- channel(im,3) #blue
###ROI extraction
library(colocr)
img_rois <- im %>%
roi_select(threshold = 50, n = 7)
# class of the returned object
class(im); class(img_rois)
#> [1] "cimg" "imager_array" "numeric"
#> [1] "cimg" "imager_array" "numeric"
# name of added attribut
names(attributes(im)); names(attributes(img_rois))
#> [1] "class" "dim"
#> [1] "class" "dim" "label"
# str of labels
label <- attr(img_rois, 'label')
str(label)
#> num [1:197690] 0 0 0 0 0 0 0 0 0 0 ...
# unique labels
unique(label)
#> [1] 0 1 2 3 4 5 6 7
# select ROI and show the results
par(mfrow = c(2,2), mar = rep(1, 4))
img_rois %>%
roi_show()
How can I get separated ROIs, like from 1-7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.