patches_list: Make a patches list for a population of images

Description Usage Arguments Value Examples

View source: R/patches_list.R

Description

Make a patches list for a population of images

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
patches_list(
  t1,
  flair = NULL,
  mask,
  t2 = NULL,
  patchsize = c(35, 35),
  verbose = TRUE,
  outfile = NULL,
  write_file = TRUE,
  ...
)

Arguments

t1

a character vector of filenames for T1 images

flair

a character vector of filenames for FLAIR images

mask

a character vector of filenames for mask images

t2

a character vector of filenames for T2 images

patchsize

Vector of length 2 (or more)

verbose

print diagnostic messages

outfile

Output file to write arrays, an .rds file. If this exists, it will be read in versus making patches again

write_file

Should an output file be written

...

Additional arguments to pass to get_patches

Value

A list of named arrays

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
user = Sys.getenv("USER")
if (user %in% c("johnmuschelli", "travis") &
Sys.info()["sysname"] == "Darwin"){
  reticulate::use_python(paste0(
   "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"))
} else {
python = system("which python", intern = TRUE)
print(python)
reticulate::use_python(python)
}
data_dir = "/Volumes/DATA_LOCAL/Projects/ms_lesion_challenge/atlases/none"
  if (dir.exists(data_dir)) {

   i = 1:5
t1 <- paste0("atlas", i, "_T1.nii.gz")
flair = paste0("atlas", i, "_FL.nii.gz")
t2 = NULL
mask = paste0("atlas", i, "_mask.nii.gz")
t1 = file.path(data_dir, t1)
flair = file.path(data_dir, flair)
mask = file.path(data_dir, mask)
verbose = TRUE
patchsize = c(35, 35)
outfile = NULL
write_file = TRUE
}

neuroconductor/flexconn documentation built on Sept. 25, 2020, 10:51 a.m.