MATLAB: How to convert .gii files to .nii

.gii to.niicat12

I have brain cortical thickness data as CAT12 results(.gii format) and i want to convert those files into .nii. Can anyone provide an script?