I just tried to compute the 5 tissue segmentation on ICBM152 (vesion 2026) but there is something strange happening:
The original T1 is 1x1x1 mm but the voxel size of the tisssue segmentation reports [0.96953, 0.97011, 0.99202] meaning it latter causes issue with NIRSTORM.
BST> SPM12 template found: /home/jeanborn/.brainstorm/defaults/spm/TPM.nii
BST> Checking latest online version for spm12...
BST> Adding plugin spm12 to path: /NAS/home/jeanborn/.brainstorm/plugins/spm12/spm12
BST> Adding plugin spm12 to path: /NAS/home/jeanborn/.brainstorm/plugins/spm12/spm12/matlabbatch
BST> Executing callback LoadedFcn: spm('defaults','EEG');
------------------------------------------------------------------------
27-Jul-2026 13:30:51 - Running job #1
------------------------------------------------------------------------
27-Jul-2026 13:30:51 - Running 'Segment'
SPM12: spm_preproc_run (v7670) 13:30:51 - 27/07/2026
========================================================================
Segment /home/jeanborn/.brainstorm/tmp/spmsegment_260727_133040/spm_segment_T1.nii,1
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Warning: QFORM0 representation has been rounded.
Completed : 13:34:13 - 27/07/2026
27-Jul-2026 13:34:13 - Done 'Segment'
27-Jul-2026 13:34:13 - Done
BST> Saving protocol "ForTuto"...
I think there might be something wrong in the template T1. as we get the following warning when openning it in freeview:
WARNING: MRIsetRas2VoxFromMatrix(): voxels sizes are inconsistent
(1,0.969529) (1,0.970113) (1,0.992022)
This is probably due to shear in the vox2ras matrix
Input Vox2RAS ------
0.96952 0.00132 -0.00051 -92.58877;
-0.00226 0.97008 0.01199 -129.31645;
0.00309 0.00750 0.99195 -78.72895;
0.00000 0.00000 0.00000 0.00000;
0.00000 0.00000 0.00000 0.00000;
as matrix
inconsistent
Also, exporting the T1 and mid-surface seems to not be aligned outside of brainstorm:
It seems this is introduced in SPM12 when the volume is processed. This size ([0.96953, 0.97011, 0.99202]) is the one read from the .nii files that result from mri_normalize_segment()
Is the issue with SPM or the original MRI ? we find back the voxel size different than 1 in the warning of freeview when we try to open the corresponding MRI:
Could you tell us the path to follow to solve our issue?
For both the volume and surface, we right clicked on the file in the database and used export to file: as nifti (MRI: NIFTi -1 .nii) for the volume and Freesurfer (.fs) for the surface
It's an "issue" with SPM and the Default Anatomy, not with the original ICBM152 T1 MRI.
The original file is the ICBM 2009c Nonlinear Asymmetricmore info. That volume has a vox2ras transformation that is fully orthogonal.
In Brainstorm, we use that T1 MRI as base for Default Anatomy, then it gets processed more info to end up with the Default AnatomyICBM152 2026 (and previous) distributed with Brainstorm. One of first steps is to do MNI normalization with SPM (maff8), ideally it should return an identity matrix (in field sMRI.NCS.R), as the template is already MNI space it self, but it is not, it's quite close but not 1.
Then on exporting this MRI as NIfTI file in Brainstorm, we export using nifti.sform_code = 4; % NIFTI_XFORM_MNI_152 so, we use the sMRI.NCS to create the sform transformation in the .nii file. So far so good, the voxel sizes [1,1,1] are also written in the NIfTI header. So the warning that is reported is becase the voxel size in header does not match with the voxel size obtained from sform, computed as sqrt(sum(bst_fix.NCS.R.^2,1)).
Now with the voxel sizes in the tissue_segment files. The MRI in the Default Anatomy is saved as NIfTI, and this files in the SPM input. Here it seems that SPM ignores the voxel sizes in the input file header, computes the sizes from sform and write those sizes in the header of the output files. Then the voxel sizes in the headers do not match any more, although the volumes have the same size.
A way to fix it would be to replace sMRI.NCS in the distributed Default Anatomy so it is the same as the vox2ras transformation in the really original T1. I'd need to check the implications of this change in other parts of Brainstorm.
For the moment, you can:
Import the original MRI
Run the SPM12: Tissue, MNI normalization
This would work as exporting the imported original MRI will not use sMRI.NCS to compute sform, but the sform that was already in the original NIfTI