CAT12 Segmentation Error (Line343)

Hi all,
When I run CAT12 segmentation on MRI from HCP, I got the following error:
Error in tbx_cfg_cat.m
Line343: The operators of the || and && operations must be convertible to logical scalar values.
Call stack:
** >tbx_cfg_cat.m>vout at 343
** >harvest.m at 99
** >harvest.m at 49
** >harvest.m at 49
** >harvest.m at 49
** >harvest.m at 62
** >cfg_util.m>local_initjob/@(cucj)harvest(cucj,cucj,false,false) at 0
** >cfg_util.m>local_initjob at 1557
** >cfg_util.m at 815
** >spm_jobman.m at 246
** >process_segment_cat12.m>Compute at 359
** >process_segment_cat12.m>ComputeInteractive at 442
** >process_segment_cat12.m at 28
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_segment_cat12,'ComputeInteractive',iSubject,iAnatomy) at 3051
CAT12 and SPM12 are updated to the latest version. Could you give me some advice?

Thank you in advance.

Best,
Jun

Was CAT12 installed as a Brainstorm plugin?

After you get the error run the lines below in Matlab, and paste the result in this post:

% Find if there is more than one installation of CAT12 in path
which('tbx_cfg_cat', '-all')
% Print CAT12 release and version
[CATrel, CATver]  = cat_version()

Hi Cassani,
Thank you for your reply. I run the lines you showed after I got the error.
The result is;

which('tbx_cfg_cat', '-all')
C:\Program Files\spm12\toolbox\cat12\tbx_cfg_cat.m
C:\Users\XPS.brainstorm\plugins\cat12\cat12\tbx_cfg_cat.m % Shadowed
[CATrel, CATver] = cat_version()

CATrel =
CAT12.7

CATver =
1742

Thank you in advance.

Best,
Jun

This is origin of the problem. There are two versions of CAT12 in your system, and the one that is being called is not the one that is installed by Brainstorm.

Remove manual SPM installation (C:\Program Files\spm12) from your Matlab path.
FYI. Current CATver that is installed in Brainstorm is 2170.

Hi Cassani,
Sorry for delay reply. I removed Matlab path ( C:\Program Files\spm12). Then, I run CAT12 again, and received error again.
Could you give me some advice?

Thank you in advance.

Best,
Jun

SPM12 template found: C:\spm\spm12b\tpm\TPM.nii
BST> Checking latest online version for cat12...
BST> Processing dependencies: cat12 requires: spm12 
BST> Plugin spm12 already loaded: C:\spm\spm12b
BST> Adding plugin cat12 to path: C:\Users\XPS\.brainstorm\plugins\cat12\cat12
BST> Executing callback LoadedFcn: LinkCatSpm(2);
BST> Creating symbolic link: mklink /D "C:\spm\spm12b\toolbox\cat12" "C:\Users\XPS\.brainstorm\plugins\cat12\cat12"

***************************************************************************
** Error: Could not load plugin cat12:
** Error executing callback LoadedFcn: 
** Error: bst_plugin>LinkCatSpm (line 2732)
** Error creating link: You do not have sufficient privileges to perform this operation.
** 
***************************************************************************

SPM12 template found: C:\spm\spm12b\tpm\TPM.nii
BST> Processing dependencies: cat12 requires: spm12 
BST> Plugin cat12 already loaded: C:\Users\XPS\.brainstorm\plugins\cat12
BST> Emptying temporary directory...

** Error: Line 235: The operators of the || and && operations must be convertible to logical scalar values.
** 
** Call stack:
** >spm_cat12.m at 235
** >cat12.m at 65
** >process_segment_cat12.m>Compute at 274
** >process_segment_cat12.m>ComputeInteractive at 442
** >process_segment_cat12.m at 28
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_segment_cat12,'ComputeInteractive',iSubject,iAnatomy) at 3051
**

As you can see in these first lines, a SPM installation is in in your C:\ drive, in C:\spm\spm12b
You need to remove this one also from the Matlab path.

A post was merged into an existing topic: CAT12 segmentation error: No executable modules