Type: Package
Title: Example Data from the Multi-Modal MRI 'Reproducibility' Resource
Version: 1.7.3
Date: 2020-07-02
Author: John Muschelli <muschellij2@gmail.com>
Maintainer: John Muschelli <muschellij2@gmail.com>
Description: Multi-modal magnetic resonance imaging ('MRI') data from the 'Kirby21' 'reproducibility' study https://www.nitrc.org/projects/multimodal/, including functional and structural imaging.
License: GPL-2
LazyData: true
LazyLoad: true
Imports: utils, stats, git2r
RoxygenNote: 7.1.0
URL: https://www.nitrc.org/projects/multimodal/, http://dx.doi.org/10.1016/j.neuroimage.2010.11.047
Encoding: UTF-8
Suggests: testthat (≥ 2.1.0)
NeedsCompilation: no
Packaged: 2020-07-02 18:19:56 UTC; johnmuschelli
Repository: CRAN
Date/Publication: 2020-07-02 18:40:02 UTC

Return All Modalities

Description

Return the modalities for images where packages were developed

Usage

all_modalities()

Value

Vector of characters


Copy Kirby21 Data to an output directory

Description

Copies files from Kirby21 Package to an output directory

Usage

copy_kirby21_data(copydir, ...)

Arguments

copydir

Output directory for data

...

Arguments to pass to get_image_filenames

Value

Logical if files are copied

Examples

on_cran = !identical(Sys.getenv("NOT_CRAN"), "true")
on_ci <- nzchar(Sys.getenv("CI"))
local_run = grepl("musch", tolower(Sys.info()[["user"]]))
run_example = !on_cran || on_ci || local_run
if (run_example) {
tdir = tempfile()
dir.create(tdir)
outdir = tempdir()
surv_installed = "kirby21.survey" %in% installed.packages()
if (!surv_installed) {
testthat::expect_error(
download_kirby21_data("SURVEY", 
    force = FALSE))
} else {
download_kirby21_data("SURVEY", 
    force = FALSE)
}
res = download_kirby21_data("SURVEY", outdir = outdir, force = TRUE)
if (!surv_installed) {
try({remove.packages("kirby21.survey")})
}
copy_kirby21_data(copydir = tdir, outdir = outdir)
}

Delete Kirby21 Imaging Data

Description

This function allows users to remove specific modalities for Kirby21 data sets. This allows this package to be on CRAN

Usage

delete_kirby21_data(modality = kirby21.base::all_modalities(), outdir = NULL)

Arguments

modality

modality of images that are to be downloaded. You must have the package downloaded for that modality.

outdir

output directory for files to download. It will default to the directory of the corresponding package for the data.

Value

Nothing is returned

Examples

on_cran = !identical(Sys.getenv("NOT_CRAN"), "true")
on_ci <- nzchar(Sys.getenv("CI"))
local_run = grepl("musch", tolower(Sys.info()[["user"]]))
run_example = !on_cran || on_ci || local_run
if (run_example) {
outdir = tempdir()
res = download_kirby21_data("SURVEY", outdir = outdir, force = TRUE)
delete_kirby21_data("SURVEY", outdir = outdir)
}

Download Kirby21 Imaging Data

Description

This function allows users to download specific modalities for Kirby21 data sets. This allows this package to be on CRAN

Usage

download_kirby21_data(
  modality = kirby21.base::all_modalities(),
  progress = TRUE,
  force = FALSE,
  outdir = NULL
)

Arguments

modality

modality of images that are to be downloaded. You must have the package downloaded for that modality.

progress

Should verbose messages be printed when downloading the data

force

If the package of that modality is not installed stop. If force = FALSE, then this will download the data but not really install the package.

outdir

output directory for files to download. It will default to the directory of the corresponding package for the data.

Value

A logical indicating the data is there.

Examples

on_cran = !identical(Sys.getenv("NOT_CRAN"), "true")
on_ci <- nzchar(Sys.getenv("CI"))
local_run = grepl("musch", tolower(Sys.info()[["user"]]))
run_example = !on_cran || on_ci || local_run
if (run_example) {
outdir = tempdir()
res = download_kirby21_data("SURVEY", outdir = outdir)
}

Get IDs with Data in Package

Description

Return the IDs for the people scanned available in the kirby21 packages

Usage

get_ids()

Value

Vector of numeric ids


Get Image Filenames

Description

Return the filenames for the images

Usage

get_image_filenames(...)

Arguments

...

arguments passed to get_image_filenames_df

Examples

get_image_filenames() 

Get Image Filenames in a data.frame

Description

Return a data.frame of filenames for the images

Usage

get_image_filenames_df(
  ids = get_ids(),
  modalities = all_modalities(),
  visits = c(1, 2),
  long = TRUE,
  warn = TRUE,
  outdir = NULL
)

get_image_filenames_matrix(...)

get_image_filenames_list(...)

get_image_filenames_list_by_visit(...)

get_image_filenames_list_by_subject(...)

Arguments

ids

ID to return

modalities

vector of image modalities within c("FLAIR", "MPRAGE", "T2w", "fMRI", "DTI") to return

visits

Vector of scan indices to return (1 or 2 or both)

long

if TRUE, each row is a subject, visit, modality pair

warn

if TRUE, warnings will be produced when packages are not installed

outdir

output directory for files to download. It will default to the directory of the corresponding package for the data.

...

arguments passed to get_image_filenames_df

Value

Data.frame of filenames

Examples

get_image_filenames_df()
get_image_filenames_matrix()  
get_image_filenames_list()   
get_image_filenames_list_by_visit()    
get_image_filenames_list_by_subject()     

Get Filenames of Par files

Description

Return the filenames for the par files

Usage

get_par_filenames(
  ids = get_ids(),
  modalities = c("FLAIR", "MPRAGE", "T2w", "fMRI", "DTI"),
  visits = c(1, 2)
)

Arguments

ids

ID to return

modalities

vector of image modalities within c("FLAIR", "MPRAGE", "T2w", "fMRI", "DTI") to return

visits

Vector of scan indices to return (1 or 2 or both)

Value

Data.frame of filenames

Examples

get_par_filenames()

Kirby 21 Demographics

Description

A dataset containing demographic information for kirby21 data sets

Format

A data frame with 21 rows and 3 columns.

Source

https://www.nitrc.org/frs/?group_id=313


All Modalities and the Corresponding package

Description

Return the modalities for images and the packages that contain them

Usage

modality_df()

Value

data.frame of two columns:


Kirby 21 Subject Identifiers to NITRC Visit Identifiers

Description

A dataset containing the mapping from the Subject IDs from the Kirby demographics to the KKI2009 identifiers on NITRC

Format

A data frame with 42 rows and 4 columns

Source

https://www.nitrc.org/frs/?group_id=313