remove_qunex_metadata#

qx_utilities.general.img.remove_qunex_metadata(infile, outfile=None)#

remove_qunex_metadata <infile> [outfile=None]

Remove QuNex metadata (extension code 64) from a NIfTI file.

Parameters

--infile (str):

Path to the input NIfTI file (.nii or .nii.gz)

--outfile (str):

Path to the output file (optional).

Notes

This function inspects a NIfTI file for QuNex metadata extensions. If found, it removes them and saves the file. All other metadata blocks (e.g., CIFTI) are preserved.

Returns True if QuNex metadata was found and removed, False otherwise.

Examples

# Remove QuNex metadata from file (replace original)
remove_qunex_metadata('bold1.nii')

# Remove QuNex metadata and save to new file
remove_qunex_metadata('bold1.nii', 'bold1_clean.nii')