Bug when calling cat12 for segmentation

Dear community,

I want to to report a potential bug when calling cat12 to perform segmentation of a T1 weighted scan.

When being called, the underlying code looks for a template file for processing
File: 'full_directory\spm12\toolbox\cat12\templates_1.50mm\Template_1_IXI555_MNI152.nii".

However, cat12 has updated its package and renamed the folder 'templates_1.50mm' to 'templates_volumes'.

When running cat12 segmentation, an error is given because brainstorm cannot find this templates_1.50mm folder.

I think there is one particular step in which the call to folder/file is hard-coded thus making it unable to find the renamed folder.

Intermediate solution for individual use:
duplicate the folder 'templates_volumes'. and rename it to 'templates_1.50mm'.
Don't remove 'templates_volumes'. as after the initial errors, the full pathway is called dynamically. So you need both folders to run cat12 segmentation at this point.

To investigate this issue:
Install the latest version of cat12 and call cat12 segmentation through brainstorm and this error should pop up. Subsequently, you can look up the script and line number where this error is produced.

Cheers

Guy Rens
grens@uwo.ca
renguy1@gmail.com

With help from @CGaser, I updated this process to work with the latest CAT12 version:
https://github.com/brainstorm-tools/brainstorm3/commit/1d91b3ed351c80c72647c31806aad41bfe61ffbc
Please update Brainstorm and try again.

I also added a few more options, documented here:
https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12#Running_CAT_from_Brainstorm

Hi,

Despite updating Brainstorm and add spm12 to the pass on Matlab, the same error persist.

Missing CAT12 template : spm12\toolbox\cat12\templates_1.50mm\Template_1_IXI555_MNI152.nii

Thanks for your help,

My guess is that this is a path issue: you get an error message with a full path to the SPM12 folder. For example:
Missing CAT12 template : C:\Users\username\MATLAB\spm12\toolbox\cat12\templates_1.50mm\Template_1_IXI555_MNI152.nii

You are not supposed to add the Brainstorm or SPM12 to the MATLAB path, this is done automatically by Brainstorm. Please try the following:

  1. Edit the Matlab path: remove all the folders that are not directly related with the MATLAB installation folder
  2. Save the path, close and restart Matlab
  3. Go to the brainstorm3 folder, run brainstorm.m
  4. File > Edit preferences > Set the SPM12 path
  5. Run CAT12 for your subject
  6. If you still get an error, please copy-paste the exact error message
  7. With your file explorer, go to the folder spm12\toolbox\cat12 and take a screen capture of the folders you see (no need to see all the files, only the folders are useful here)