Various CAT12 Errors with Different Versions of Matlab + Operating Systems

The problem with that, the operation completes without a problem but the small window showing CAT12 operation gets stuck, hence Branstorm gets stuck as if the operation still continues. If you exit the small window, brainstorm still pretends like it is working, which you can tell since the cursor keeps running, however no segmentation files appear under the subject MRI data or anatomy folder in the brainstorm.

The window that shows the CAT logo is the wait bar of Brainstorm, sometimes it doesn't get closed correctly, either because the code crashes before, or because the code doesn't explicitly close it. It might remain open while nothing else happens.
In order to check if a task is still running in Matlab: in the Matlab command window press the ENTER key, if it shows "busy" in the bottom left corner of the Matlab window, something is still running. If it just goes to the next line and shows the prompt ">>" immediately, then nothing is being executed: you can safely close the Brainstorm wait bar, or press the "Close all figures" button (X) to also restore the mouse cursor.

I guess there is one of the following problem:

  1. CAT12 doesn't return correctly to the calling function (problem with the SPM job manager?)
  2. Brainstorm does something that keeps running for a while after CAT12 is done (importing the atlases into Brainstorm takes a while, and maybe the algorithm I wrote is not very stable and needs to fixes...)

I will repeat the problem again, and get a screenshot and report back to this thread if that would help.

Yes, please, it would help a lot to have the full text printed in the Matlab command window from the beginning of the execution of CAT12.
When you reach this moment where you think Brainstorm is stuck for no reason, instead of closing the wait bar with the CAT logo, press CTRL+C in the Matlab command window, possibly multiple times until it just prints the next prompt ">>". If you get any text after killing the current script: post it here as well

I recommend you also try with other MRI volumes. Maybe there are some a few subjects that won't work.

This is at least how I am getting with Windows 8 in Matlab 2017, 2018 and 2019 versions when I get int32 error.
So it might worth to report this bit to SPM team as well, so at least they might know the consequence of having that warning message.

This is not an error, it is a warning, and it has no impact on any computation.
The SPM developers are aware of it and already made the appropriate modifications. If it's not already part of the SPM12 you can download from their website, it will be updated soon.

Thanks for helping us debugging these new tools!