Using synapsis
packages = c("rmarkdown","BiocManager","imager")
package.check <- lapply(
packages,
FUN = function(x) {
if (!require(x, character.only = TRUE)) {
install.packages(x, dependencies = TRUE)
library(x, character.only = TRUE)
}
}
)
## Loading required package: rmarkdown
## Loading required package: BiocManager
## Loading required package: imager
## 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
library(knitr)
library(rmarkdown)
#BiocManager::install("EBImage")
library(EBImage)
##
## Attaching package: 'EBImage'
## The following objects are masked from 'package:imager':
##
## channel, dilate, display, erode, resize, watershed
library(ggplot2)
path = "~/Documents/svi/imaging/data-folder/test-folder/all-WT"
files <- list.files(path)
setwd("~/Documents/synapsis/synapsis/R")
source("auto_crop.R")
# call routine to crop images, and display their "cell number"
crop(files, path)

## [1] "cell count for above crop is"
## [1] 1
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 2
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 3
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 4
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 5
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 6
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 7
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 8
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 9
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 10
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 11
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 12
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 13
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 14
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 15
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 16
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 17
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 18
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 19
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 20
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 21
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 22
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 23
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 24
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 25
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 26
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 27
## [1] "keeping it"
## List of 2
## $ message: chr "subscript out of bounds"
## $ call : language slot(noise_gone, ".Data")[ix, iy, drop = FALSE]
## - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"

## [1] "cell count for above crop is"
## [1] 28
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 29
## [1] "keeping it"
## List of 2
## $ message: chr "only 0's may be mixed with negative subscripts"
## $ call : language slot(noise_gone, ".Data")[ix, iy, drop = FALSE]
## - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"

## [1] "cell count for above crop is"
## [1] 30
## [1] "keeping it"
## List of 2
## $ message: chr "subscript out of bounds"
## $ call : language slot(noise_gone, ".Data")[ix, iy, drop = FALSE]
## - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"

## [1] "cell count for above crop is"
## [1] 31
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 32
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 33
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 34
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 35
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 36
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 37
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 38
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 39
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 40
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 41
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 42
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 43
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 44
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 45
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 46
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 47
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 48
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 49
## [1] "keeping it"
## List of 2
## $ message: chr "only 0's may be mixed with negative subscripts"
## $ call : language slot(noise_gone, ".Data")[ix, iy, drop = FALSE]
## - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"

## [1] "cell count for above crop is"
## [1] 50
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 51
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 52
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 53
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 54
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 55
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 56
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 57
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 58
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 59
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 60
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 61
## [1] "keeping it"
## List of 2
## $ message: chr "only 0's may be mixed with negative subscripts"
## $ call : language slot(noise_gone, ".Data")[ix, iy, drop = FALSE]
## - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"

## [1] "cell count for above crop is"
## [1] 62
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 63
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 64
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 65
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 66
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 67
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 68
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 69
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 70
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 71
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 72
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 73
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 74
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 75
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 76
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 77
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 78
## [1] "keeping it"

## [1] "cell count for above crop is"
## [1] 79
## [1] "keeping it"
