I converted a BRIK and HEAD file to nifti using 3dAFNItoNIFTI. The resulting .nii file is more than 4 dimensions and can’t be read by some standard softwares, resulting in errors such as “Input data has incompatible dimensionality: Expected dimension is 4D and you provided a 5D image”. Is there a way to restrict the dimensions in the conversion or modify the header so it is 4D (x, y, z and time), perhaps with nifti_tool?
I tried “nifti_tool -mod_hdr -overwrite -infile 025_prob_trial_reg.nii -mod_field dim ‘4 64 64 1’” to overwrite the file with 4 dimensions, but that resulted in “** found 4 of 8 modify values”
With nifti_tool -disp_hdr -infiles 025_prob_trial_reg.niii I can see there are 8 dimensions.
If it is helpful, nifti_tool -check_hdr -infiles 025_prob_trial_reg.nii results in
'header IS GOOD for file 025_prob_trial_reg.nii"
and nifti_tool -check_nim -infiles 002_prob_trial_reg.nii results in
“nifti_image IS GOOD for file 025_prob_trial_reg.nii”
Just to be clear, the NIFTI standard reserves the 4th
dimension for time. So a dataset of beta weights or
t-stats should be stored in 5 dimensions.
If this is not a time series dataset, then the problem
is with the reading software, and it might be good to
make them aware of it.
Regarding nifti_tool, your command has only specified
3 of the 4 dimension values, and a full 8 are required
(the first number should be the number of dimensions,
then actual dimension values, and anything beyond the
number of dimensions can be 0 or 1). For example,
if there were 20 volumes (these are just slices?), then
the command might be:
Thank you for all your responses and clarifications!
3dTcat solution worked well.
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.