Skip to contents

Processes multiple PET image files matching a specified filename pattern. Each file is processed using neuroCleaner, and the results are aggregated into a unified data frame for functional data analysis. This function serves as a key step in the neuroSCC workflow, bridging raw image data and Simultaneous Confidence Corridors (SCC) computation.

Usage

databaseCreator(
  pattern,
  control = TRUE,
  useSequentialNumbering = FALSE,
  demo = NULL,
  quiet = FALSE
)

Arguments

pattern

character. A regular expression defining the file pattern to match. Subject identifiers are extracted from filenames based on this pattern.

control

logical. If TRUE, files are treated as control group data; if FALSE, as pathological group data. Default is TRUE.

useSequentialNumbering

logical. If TRUE, assigns sequential subject numbers instead of extracting them from filenames. Default is FALSE.

demo

data.frame, optional. If provided, demographic information is included for each file. Default is NULL.

quiet

logical. If TRUE, suppresses progress messages. Default is FALSE.

Value

A data.frame combining processed voxel-level data from all matched files. Each row represents a voxel (3D pixel). The column structure depends on input

  • For the control group: CN_number, z, x, y, pet

  • For the pathological group: AD_number, z, x, y, pet

  • If demographics are included: additional columns PPT, Group, Sex, Age

Details

The function performs the following steps

  1. Identifies image files matching the given pattern.

  2. Processes each file using neuroCleaner, optionally merging demographic data.

  3. Adds a subject identifier column (CN_number or AD_number).

  4. Aggregates all results into a single data frame.

If no files are successfully processed, an empty data frame is returned with a warning.

This function is typically followed by matrixCreator, which converts the output into a matrix format for functional analysis.

See also

neuroCleaner for the underlying image processing function.
matrixCreator for the next step in the workflow that converts the database to a matrix format for SCC analysis.

Examples

# NOTE: To keep runtime below CRAN limits, this example processes only 1 subject.
# You can expand the pattern to include all subjects for real use.

# Example: Create a database from a single synthetic PET image (control group)
controlPattern <- "^syntheticControl1\\.nii\\.gz$"
databaseControls <- databaseCreator(pattern = controlPattern, control = TRUE, quiet = TRUE)
head(databaseControls)
#>   CN_number z x y pet
#> 1         1 1 1 1   0
#> 2         1 1 1 2   0
#> 3         1 1 1 3   0
#> 4         1 1 1 4   0
#> 5         1 1 1 5   0
#> 6         1 1 1 6   0