Extracts voxel dimension information from a NIfTI or similar neuroimaging file.
This function is designed to work with neuroCleaner
, but it can also be used
independently to inspect image dimensions.
Value
A named list with the following elements
xDim
– Number of voxels along the X axis.yDim
– Number of voxels along the Y axis.zDim
– Number of slices along the Z axis.dim
– Total number of voxels in a 2D slice (calculated asxDim * yDim
).
Details
The function accepts either a file path or a preloaded nifti
object.
If a file path is provided, it uses oro.nifti::readNIfTI()
to load the image.
This function ensures consistent dimension extraction across the neuroSCC
pipeline.
Examples
# Get the file path for a sample NIfTI file
niftiFile <- system.file("extdata", "syntheticControl1.nii.gz", package = "neuroSCC")
# Extract dimensions from the NIfTI file
dimensions <- getDimensions(niftiFile)
# Display the extracted dimensions
print(dimensions)
#> $xDim
#> [1] 91
#>
#> $yDim
#> [1] 109
#>
#> $zDim
#> [1] 91
#>
#> $dim
#> [1] 9919
#>