-
Notifications
You must be signed in to change notification settings - Fork 10
spmup_skip.m
fMRI data almost always come with some 'unstable' initial volumes that we want to discard. This can be done directly at the scanner or off-line. While with 3D files, we just need to select the right volumes, with 4D files, it needs to be edited, and this is what spmup_skip.m does.
fmri_out = spmup_skip
fmri_out = spmup_skip(fmri_in,n);
fmri_out = spmup_skip(fmri_in,n);
fmri_out = spmup_skip(fmri_in,'bids_derivatives','on');
fmri_out = spmup_skip(fmri_in,'bids_derivatives','off', 'rename',fullfile(mypath,[myname '.nii'])};If called with no input, the user is prompted. Input fmri_in is the 4D volume name and n is the number of initial volumes to remove.
Options are key, value pairs: {'bids_derivatives','on/off'} and {'rename','newname'}
Indicating 'bids_derivatives','on' means you want the updated data to be written under bids_folder/derivatives/sub-XXX/func/sub-XXX_*_skip-n_bold.nii. Optionally, a newname can be given, with a completely non bids valid path.
The updated 4D fMRI file is written on drive.