cifti.stop.if.cifti.name: Refuse a CIFTI-2 file name for a file that is not a CIFTI-2...

View source: R/write_cifti.R

cifti.stop.if.cifti.nameR Documentation

Refuse a CIFTI-2 file name for a file that is not a CIFTI-2 file.

Description

The writers of this package that are not CIFTI writers (write.fs.morph(), write.fs.volume()) derive the format from the file name, and a CIFTI-2 file name looks like a NIFTI name. Writing a NIFTI file under a name like .dscalar.nii would produce a file whose content contradicts its name: this package (and Connectome Workbench) refuse to read it, because the name promises the CIFTI XML metadata that describes what the matrix dimensions contain. This function turns that into an error that names the writer to use instead.

Usage

cifti.stop.if.cifti.name(filepath)

Arguments

filepath

character string, the name of the file that is about to be written.

Value

NULL, invisibly. Stops if the name is one of the standard CIFTI-2 file names.


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.