Code Monkey home page Code Monkey logo

colocr_app's Introduction

version Build Status status

colocr_app

A shiny app for conducting co-localization analysis.

colocr_app's People

Watchers

 avatar  avatar

colocr_app's Issues

ROIs Extraction

#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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.