Loads a NIfTI-format neuroimaging file and transforms it into a structured data frame,
organizing voxel-level information for downstream analysis. This function is the first step
in the neuroimaging processing pipeline in neuroSCC, converting raw PET data into
a format suitable for functional data analysis. SCCs are later computed using functions
from the ImageSCC package, such as ImageSCC::scc.image().
Arguments
- name
character. The full path to the NIfTI file to process.- demo
Optional
data.framecontaining demographic information. If provided, it should include columns (case-insensitive):PPT,Group,Sex, andAge. If automatic matching via thePPTcolumn fails, the row specified bydemoRowis used. Default isNULL.- demoRow
integer. Row to use from the demographic table if automatic matching fails. Default is1.
Value
A data frame where each row represents a voxel (3D pixel).
If demographics are provided: the columns include
PPT,Group,Sex,Age,z,x,y, andpet.If demographics are not provided: the columns include
z,x,y, andpet.
The pet column contains the PET intensity value at each voxel location.
Details
The function performs the following steps
Loads the NIfTI file using
oro.nifti::readNIfTI().Converts the 3D image into a tidy data frame.
Adds
z,x, andyvoxel coordinates.If demographic data is provided, attempts to match based on
PPT(case-insensitive). If no match is found,demoRowis used.
The resulting data frame serves as input for databaseCreator, matrixCreator,
and other core functions in the neuroSCC pipeline.
See also
databaseCreator for batch image processing. readNIfTI for reading NIfTI-format files.
Examples
# Load a sample Control NIfTI file
niftiFile <- system.file("extdata", "syntheticControl1.nii.gz", package = "neuroSCC")
# Example Without demographic data
petData <- neuroCleaner(niftiFile)
petData[sample(nrow(petData), 10), ] # Show 10 random voxels
#> z x y pet
#> 727430 74 31 73 0
#> 782978 79 86 31 0
#> 682067 69 70 54 6
#> 860620 87 70 65 0
#> 667570 68 28 54 10
#> 118523 12 87 40 0
#> 391197 40 40 105 0
#> 29528 3 89 98 0
#> 297705 31 2 26 0
#> 142307 15 32 62 5
