Error during CAT12 surface & thickness estimation

Dear members of the neuroimaging community,

I am looking into analyzing longitudinal data with CAT12. Unfortunately, I am constantly running into preprocessing erros occurring exclusively during thickness estimation phase.

I am running the longitudinal preprocessing pipeline with default parameters in an up-to-date version of CAT 12 running on Matlab 2022b on a Macbook Pro M1 from 2021 (macOS Sonoma Version 14.4). The error message starts with “1 bad base64 chars found in DataArray”. This seems to be a systematic error, as it comes up in different (but not all) data sets from our project. Some datasets are successfully preprocessed without errors, some end up preprocessing successfully after repeating preprocessing several times, and some just fail every single time.

I’ve checked the file permissions and all content of the CAT12 folder is rwx. I disabled the Mac gatekeeper and also tried with a newer version of Matlab (2024a). Not sure if it has anything to do with this, but I also compiled the SPM MEX files as recommended here Compilation of SPM on macOS - SPM Documentation. Unfortunately, the errors persist.

Batch used (same as using GUI):

matlabbatch{1}.spm.tools.cat.long.datalong.subjects = {
                                                       {
                                                       '/Volumes/VERTEX/status/structural_data/sub_58/baseline/t1_baseline.nii,1'
                                                       '/Volumes/VERTEX/status/structural_data/sub_58/followup2/t1_followup2.nii,1'
                                                       }
                                                       }';
matlabbatch{1}.spm.tools.cat.long.longmodel = 3;
matlabbatch{1}.spm.tools.cat.long.enablepriors = 1;
matlabbatch{1}.spm.tools.cat.long.prepavg = 2;
matlabbatch{1}.spm.tools.cat.long.bstr = 0;
matlabbatch{1}.spm.tools.cat.long.avgLASWMHC = 0;
matlabbatch{1}.spm.tools.cat.long.nproc = 8;
matlabbatch{1}.spm.tools.cat.long.opts.tpm = {'/Users/bernardopimentel/spm12/tpm/TPM.nii'};
matlabbatch{1}.spm.tools.cat.long.opts.affreg = 'mni';
matlabbatch{1}.spm.tools.cat.long.opts.biasacc = 0.5;
matlabbatch{1}.spm.tools.cat.long.extopts.restypes.optimal = [1 0.3];
matlabbatch{1}.spm.tools.cat.long.extopts.setCOM = 1;
matlabbatch{1}.spm.tools.cat.long.extopts.APP = 1070;
matlabbatch{1}.spm.tools.cat.long.extopts.affmod = 0;
matlabbatch{1}.spm.tools.cat.long.extopts.LASstr = 0.5;
matlabbatch{1}.spm.tools.cat.long.extopts.LASmyostr = 0;
matlabbatch{1}.spm.tools.cat.long.extopts.gcutstr = 2;
matlabbatch{1}.spm.tools.cat.long.extopts.WMHC = 2;
matlabbatch{1}.spm.tools.cat.long.extopts.registration.shooting.shootingtpm = {'/Users/bernardopimentel/spm12/toolbox/cat12/templates_MNI152NLin2009cAsym/Template_0_GS.nii'};
matlabbatch{1}.spm.tools.cat.long.extopts.registration.shooting.regstr = 0.5;
matlabbatch{1}.spm.tools.cat.long.extopts.vox = 1.5;
matlabbatch{1}.spm.tools.cat.long.extopts.bb = 12;
matlabbatch{1}.spm.tools.cat.long.extopts.SRP = 22;
matlabbatch{1}.spm.tools.cat.long.extopts.ignoreErrors = 1;
matlabbatch{1}.spm.tools.cat.long.output.BIDS.BIDSno = 1;
matlabbatch{1}.spm.tools.cat.long.output.surface = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.neuromorphometrics = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.lpba40 = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.cobra = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.hammers = 0;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.thalamus = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.thalamic_nuclei = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.suit = 1;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.ibsr = 0;
matlabbatch{1}.spm.tools.cat.long.ROImenu.atlases.ownatlas = {''};
matlabbatch{1}.spm.tools.cat.long.longTPM = 1;
matlabbatch{1}.spm.tools.cat.long.modulate = 1;
matlabbatch{1}.spm.tools.cat.long.dartel = 0;
matlabbatch{1}.spm.tools.cat.long.printlong = 2;
matlabbatch{1}.spm.tools.cat.long.delete_temp = 1;

spm_jobman('run',matlabbatch) % execute the batch
clear matlabbatch % clear matlabbatch

Error output

    2s
Write result maps                                                     6s
Surface and thickness estimation                                  
lh:
  Thickness estimation (0.50 mm³)                                    38s
  Create initial surface                                             37s
  Topology correction:                                            /Users/bernardopimentel/spm12/toolbox/cat12/CAT.maca64/CAT_MarkDefects "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.sphere.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.defects0.avg_t1_baseline": Segmentation fault
/Users/bernardopimentel/spm12/toolbox/cat12/CAT.maca64/CAT_MarkDefects "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.sphere.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.defects0.avg_t1_baseline": Segmentation fault
** 1 bad base64 chars found in DataArray[1]

WARNING: Surface processing will not work because
(1) File permissions are not correct (for unix use chmod a+x) or
(1) CAT binaries are not compatible to your system or
(3) Antivirus software in Windwos or Gatekeeper in MAC OS is blocking to execute binaries
System: Darwin MacBook-Pro-von-Bernardo.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 x86_64



For future support of your system please send this message to christian.gaser@uni-jena.de

/Users/bernardopimentel/spm12/toolbox/cat12/CAT.maca64/CAT_FixTopology -lim 128 -bw 512 -n 81920 -refine_length 2 "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.sphere.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.avg_t1_baseline.gii": Segmentation fault
/Users/bernardopimentel/spm12/toolbox/cat12/CAT.maca64/CAT_FixTopology -lim 128 -bw 512 -n 81920 -refine_length 2 "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.sphere.nofix.avg_t1_baseline.gii" "/Volumes/VERTEX/status/structural_data/sub_58/baseline/surf/lh.central.avg_t1_baseline.gii": Segmentation fault
** 1 bad base64 chars found in DataArray[1]

I’d appreciate any help/tips on how to solve this.
Thank you very much,

Best wishes,
Bernardo Pimentel