Integration of SPM12 and FieldTrip functions on standalone version

Good morning,

I am following the tutorial for epileptogenicity mapping, and the very first step of importing preimplantation MRI and “compute MNI normalization” → Segment option, I get this error:

I tried running in on windows and Mac OS, with same result

I am running Matlab runtime 2023a, and brainstorm 29-Oct-2025 standalone

Hi @aalshammaa, I was able to replicate this issue, it is caused by an incomplete compilation of the standalone version. We'll update the standalone version in the next days.


For sake of completeness, full error message that is printed in the CMD:

------------------------------------------------------------------------
27-Nov-2025 13:24:23 - Running job #1
------------------------------------------------------------------------
27-Nov-2025 13:24:23 - Running 'Segment'

SPM12: spm_preproc_run (v7670)                     13:24:23 - 27/11/2025
========================================================================
Warning: spm_existfile is not compiled for your platform.
> In spm_existfile (line 23)
In spm_vol>spm_vol_hdr (line 79)
In spm_vol (line 61)
In spm_load_priors8 (line 21)
In spm_preproc_run>run_job (line 61)
In spm_preproc_run (line 41)
In spm_cfg_preproc8>spm_local_preproc_run (line 474)
In cfg_run_cm (line 29)
In cfg_util>local_runcj (line 1717)
In cfg_util (line 972)
In spm_jobman>fill_run_job (line 469)
In spm_jobman (line 247)
In mri_normalize_segment (line 100)
In bst_normalize_mni (line 186)
In process_mni_normalize>Compute (line 135)
In process_mni_normalize>ComputeInteractive (line 203)
In process_mni_normalize (line 28)
In figure_mri>ComputeMniCoordinates (line 3017)
In figure_mri>@(h,ev)ComputeMniCoordinates(hFig) (line 311)
In import_mri (line 566)
In bst_call (line 28)
In tree_callbacks>@(h,ev)bst_call(@import_mri,iSubject,[],[],1) (line 577)
In bst_startup (line 802)
In brainstorm (line 134)
27-Nov-2025 13:24:27 - Failed  'Segment'
Error using spm_slice_vol
spm_slice_vol.c not compiled - see Makefile
In file "C:\Users\rcassani\AppData\Local\Temp\rcassani\mcrCache9.14\bst_ja0\home\rcassani\.brainstorm\spmtrip\spm_slice_vol.m" (???), function "spm_slice_vol" at line 32.
In file "C:\Users\rcassani\AppData\Local\Temp\rcassani\mcrCache9.14\bst_ja0\home\rcassani\.brainstorm\spmtrip\spm_load_priors8.m" (???), function "spm_load_priors8" at line 38.
In file "C:\Users\rcassani\AppData\Local\Temp\rcassani\mcrCache9.14\bst_ja0\home\rcassani\.brainstorm\spmtrip\spm_preproc_run.m" (???), function "run_job" at line 61.
In file "C:\Users\rcassani\AppData\Local\Temp\rcassani\mcrCache9.14\bst_ja0\home\rcassani\.brainstorm\spmtrip\spm_preproc_run.m" (???), function "spm_preproc_run" at line 41.
In file "C:\Users\rcassani\AppData\Local\Temp\rcassani\mcrCache9.14\bst_ja0\home\rcassani\.brainstorm\spmtrip\config\spm_cfg_preproc8.m" (???), function "spm_local_preproc_run" at line 474.

The following modules did not run:
Failed: Segment


***************************************************************************
** Error: bst_normalize_mni/segment: Error using MATLABbatch system
** Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing the exact #job as displayed in this error message)
** ------------------
** Running job #1
** ------------------
**
***************************************************************************

@aalshammaa, this is now fixed. Commit: 1e35968

Please download the update standalone version: 28-Nov-2025

Thank you, I confirm it is working now.

@Raymundo.Cassani

I continued to follow the tutorial, and at the following step, i get an error.

Run process: Import > Import anatomy > Generate SPM canonical surfaces.
Select the subject Subject01, and the highest number of verices available (20484). This number represents the resolution of SPM template surfaces used in this process. The higher the better, but it will slow down significantly the computation of the epileptogenicity maps.

It still generated the different surfaces, but I am not sure if they are valid?

Yes, the surfaces are valid.

The error message that you get is because there was a bug on reporting "no errors".

This is now addressed in the current standalone version.
Please download it again.

@Raymundo.Cassani

Thank you for the quick responses.

I downloaded it again and ran the process again, and got the same message. But if surfaces are valid then that’s good!

Try again. The update is now there, it took a bit to update the file in the server

@Raymundo.Cassani

Actually I ran into another error later in the epileptogenicity mapping tutorial at this step when running the pipeline: Time-frequency analysis (pre-onset baseline).

Hi @aalshammaa, we were able to replicate the reported bug and we are working on solving it.

The root of it is how SPM12 and FieldTrip functions are added to the compilation of the standalone version.

I'll let you know when it is tested and ready.

Thanks reporting this, it helps us to keep the functionality of the standalone version on a par with one in the source version.

Hello @aalshammaa, please download the update standalone version: 03-Dec-2025