View source: R/afni_subset_4d.R
afni_subset_4d | R Documentation |
Subset 4D images
afni_subset_4d(file, time_start = 0, time_end = "$", by = 1,
retimg = FALSE)
file |
4-dimensional Filename or nifti object to subset |
time_start |
the time point to subset from. Remember timepoint numbering starts from 0 |
time_end |
the last time point to subset |
by |
How should the subsetting be done. If you want to subset every second time point, use by = 2 for example |
retimg |
Should an image be returned ( |
A nifti
object or an output file depending on
retimg
library(kirby21.fmri)
if (have_afni()) {
tdir = tempfile()
res = download_fmri_data(outdir = tdir)
file = kirby21.fmri::get_fmri_filenames(outdir = tdir)[1]
sub_file = afni_subset_4d(file, time_start = 0, time_end = 1)
dim(neurobase::readnii(sub_file))[4] == 2
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.