Converting nii.gz file into BRIK.gz and HEAD files

AFNI version info (afni -23.1.09)

I need to convert my nifti file antinsula_lr_resampleafni+tlrc.nii.gz into a BRIK.gz file and a HEAD file. When I attempt the command 3dcopy antinsula_lr_resampleafni+tlrc.nii.gz antinsula_lr_resampleafni it says FATAL ERROR: No datasets found

Please advise.

That looks like a "design flaw" for NIFTI datasets that contain the "+tlrc" or "+orig" inside them. You can work around this by either moving/renaming the file to one without the offending characters first or by using another command like 3dcalc to copy the dataset:

3dcalc -a antinsula_lr_resampleafni+tlrc.nii.gz -expr a -prefix antinsula_lr_resampleafni 

Would I be able to rename it back to tlrc after the 3dcopy command is executed? I would like to retain that format.

Yes, or use the 3dcalc command in my previous post.

It worked. Thanks!

1 Like