Crash when segmenting MRI

hi everyone!
I was trying to segment a MRI with SIMNimbs, but an error warning appeared:

Running job #1
Running 'Segment'
SPM12: spm_preproc_run (v6365) 18:28:28 - 27/12/2022
========================================================================
Segment C:\Users\Omar.brainstorm\tmp\roast\default_subjectT1.nii
Warning: Using 'seed' to set RAND's internal state causes RAND, RANDI, and RANDN to use legacy random number generators.
This syntax is not recommended. See Replace Discouraged Syntaxes of rand and randn to use RNG to replace the old syntax.
In spm_maff8>loadbuf (line 82)
In spm_maff8 (line 25)
In spm_preproc_run>run_job (line 107)
In spm_preproc_run (line 41)
In spm_cfg_preproc8>spm_local_preproc_run (line 450)
In cfg_run_cm (line 29)
In cfg_util>local_runcj (line 1688)
In cfg_util (line 959)
In spm_jobman>fill_run_job (line 469)
In spm_jobman (line 247)
In start_seg (line 129)
In process_fem_mesh>Compute (line 851)
In process_fem_mesh>ComputeInteractive (line 1237)
In process_fem_mesh (line 32)
In bst_call (line 28)
In tree_callbacks>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,iAnatomy) (line 3079)
Completed : 18:34:05 - 27/12/2022
Done 'Segment'
Done
loading data...
smoothing masks...
** Error: Line 50: Undefined function 'fspecial' for input arguments of type 'char'.
**
** Call stack:
** >segTouchup.m at 50
** >process_fem_mesh.m>Compute at 867
** >process_fem_mesh.m>ComputeInteractive at 1237
** >process_fem_mesh.m at 32
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,iAnatomy) at 3079
**
** Error: The FEM mesh generation failed.
** Check the Matlab command window for additional information.
**


I tried to segment my file with another tools (Roast, Brain2Mesh) but I got the same error

Then (just to be sure It was no my file) I tried to segment the Default Anatomy and again, same error

What's wrong?
I have the latest version of BS and I use Matlab 2018b
Thank in advance!

Hi @tourette95

It seems to be an error at the segmentation level with SPM; this is why all the methods fail.

Could you update the SPM from the Brainstorm plugins menu and try again:
Check this tuto: https://neuroimage.usc.edu/brainstorm/Tutorials/Plugins
Update also "cat"

You may also need to remove all previous versions of SPM from your Matlab path.

Let us know if this solves your issue.

1 Like

Thank you!

I followed your advice and I got another warning message, but this time the problem was I had not installed the Matlab Image Processing Toolbox, so I installed it and it works!!

Thanks :smiley:

1 Like