11---
22title : Getting Started with bidser
33output : rmarkdown::html_vignette
4- vignette : |
5- %\VignetteIndexEntry{Getting Started with bidser} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}
4+ vignette : >
5+ %\VignetteIndexEntry{Getting Started with bidser}
6+ %\VignetteEngine{knitr::rmarkdown}
7+ %\VignetteEncoding{UTF-8}
68params :
79 family : red
810 preset : homage
@@ -27,7 +29,11 @@ knitr::opts_chunk$set(
2729```
2830
2931``` {r theme-setup, include = FALSE}
30- if (requireNamespace("ggplot2", quietly = TRUE) && requireNamespace("albersdown", quietly = TRUE)) ggplot2::theme_set(albersdown::theme_albers(params$family))
32+ albers_pkg <- "albersdown"
33+ if (requireNamespace("ggplot2", quietly = TRUE) && requireNamespace(albers_pkg, quietly = TRUE)) {
34+ theme_fn <- get("theme_albers", envir = asNamespace(albers_pkg))
35+ ggplot2::theme_set(theme_fn(params$family))
36+ }
3137suppressPackageStartupMessages({
3238 library(bidser)
3339 library(tibble)
@@ -337,19 +343,62 @@ If you have derivatives indexed, `scope` lets you be explicit about where to
337343search:
338344
339345``` {r derivatives-query, eval = FALSE}
346+ deriv_path <- get_example_bids_dataset("ds000001-fmriprep")
347+
348+ proj_deriv <- bids_project(
349+ deriv_path,
350+ derivatives = "auto",
351+ index = "auto"
352+ )
353+
340354prep_bold <- query_files(
341355 proj_deriv,
342356 regex = "bold\\.nii\\.gz$",
343357 desc = "preproc",
344358 scope = "derivatives",
359+ pipeline = "fmriprep",
345360 match_mode = "exact"
346361)
347362
348363all_bold <- query_files(
349364 proj_deriv,
350365 regex = "bold\\.nii\\.gz$",
351- scope = "all"
366+ scope = "all",
367+ return = "tibble"
368+ )
369+ ```
370+
371+ ` bids_project() ` can also be more forgiving with real-world datasets that are
372+ missing ` participants.tsv ` :
373+
374+ ``` {r permissive-project, eval = FALSE}
375+ proj_relaxed <- bids_project(
376+ "/path/to/bids",
377+ strict_participants = FALSE,
378+ derivatives = "auto",
379+ index = "auto"
352380)
381+
382+ derivative_pipelines(proj_relaxed)
383+ ```
384+
385+ ### Run-Level Variables and Report Data
386+
387+ For downstream analysis in R, ` variables_table() ` gives you a run-level tibble
388+ that nests scan inventory, events, and confounds without changing the existing
389+ subject or file APIs:
390+
391+ ``` {r variables-report, eval = FALSE}
392+ vars <- variables_table(
393+ proj_deriv,
394+ scope = "all",
395+ pipeline = "fmriprep"
396+ )
397+
398+ vars[, c(".subid", ".task", ".run", "n_scans", "n_events", "n_confound_rows")]
399+
400+ report <- bids_report(proj_deriv, scope = "all", pipeline = "fmriprep")
401+ report
353402```
354403
355404### search_files() Still Works
0 commit comments