Export MRI but found mismatched image ratio

Hi,

I have a processed brainstorm database. The protocol includes MRI and head models.
I was trying to export the MRIs of subjects into files (.nii) for further analysis. But when I open the .nii files using other software or re-import into Brainstorm, I found the image ratio was incorrect in some subjects. Basically, the MRI was compressed in x axis (left-right).

The MRI was ok in Brainstorm, and I do not have access to the raw MRI data.
I am not sure if this was caused by missing some transformation or other issues.

I attached an image showing the exported MRI and its pre-export look in Brainstorm.

Please let me know if anyone would have an idea.
Thank you very much.
images.pdf (71.9 KB)

Hi @Jarmck

can you share the two MRI files format that you have in brainstorm (before the export and then the one you imported back to brainstorm).

You can check the information on both files : right click on the MRI and then => file, and =>view file contents

Can you check if there are differences on the fields from those two files?

Hi @tmedani,

Thank you for reply.
I put the information below.

Before exportation:
Name: CAT/subjectimage_s981001908-0006-00001-000344-01.mat

|
|- Cube: [256x344x256 uint8]
|- Voxsize: [0.9766, 0.7, 0.9766]
|- Comment: 's981001908-0006-00001-000344-01'
|- Header:
| |- key:
| | |- sizeof_hdr: 348
| | |- data_type: ''
| | |- db_name: ''
| | |- extents: 0
| | |- session_error: 0
| | |- regular: 'r'
| | |- hkey_un0: ''
| |- dim:
| | |- dim: [3, 256, 256, 344, 1, 1, 1, 1]
| | |- vox_units: ''
| | |- cal_units: ''
| | |- unused1: 0
| | |- datatype: 4
| | |- bitpix: 16
| | |- dim_un0: 0
| | |- pixdim: [-1, 0.9766, 0.9766, 0.7, 0, 0, 0, 0]
| | |- vox_offset: 352
| | |- funused1: 1
| | |- funused2: 0
| | |- funused3: 6.163e-33
| | |- cal_max: 0
| | |- cal_min: 0
| | |- compressed: 0
| | |- verified: 0
| | |- glmax: 0
| | |- glmin: 0
| |- hist:
| | |- descrip: '3T 3D GR TR=8.164ms/TE=3.192ms/FA=12deg/SO=FAST_GEMS\EDR_GEMS\PFP 17-May-2016 16'
| | |- aux_file: ''
| | |- orient: 1
| | |- originator: [256, 0, 0, -3328, 13572]
| | |- generated: '?ó5?oõBê'
| | |- scannum: 'æåB`eíÂvz'
| | |- patient_id: '¿o'
| | |- exp_date: 'õB'
| | |- exp_time: '433¿éæåB'
| | |- hist_un0: ''
| | |- views: 1064960629
| | |- vols_added: 0
| | |- start_field: 3270337888
| | |- field_skip: 0
| | |- omax: 0
| | |- omin: 0
| | |- smax: 0
| | |- smin: 3222382
| |- nifti:
| | |- magic: [110, 43, 49, 0]
| | |- dim_info: ''
| | |- intent_p1: 0
| | |- intent_p2: 0
| | |- intent_p3: 0
| | |- intent_code: 0
| | |- slice_start: 0
| | |- scl_slope: 1
| | |- scl_inter: 0
| | |- slice_end: 0
| | |- slice_code: 0
| | |- xyzt_units: 18
| | |- slice_duration: 0
| | |- toffset: 0
| | |- qform_code: 0
| | |- sform_code: 2
| | |- quatern_b: 0
| | |- quatern_c: 0
| | |- quatern_d: 0
| | |- qoffset_x: 0
| | |- qoffset_y: 0
| | |- qoffset_z: 0
| | |- srow_x: [0.9766, 0, 0, -126.497]
| | |- srow_y: [0, 0.7, 0, -125.149]
| | |- srow_z: [0, 0, 0.9766, -118.698]
| | |- intent_name: [1x16 double]
| | |- sform: [4x4 double]
| | |- qform: []
| | |- vox2ras: [4x4 double]
|- InitTransf: {'vox2ras', [4x4 double]}
|- History: {'01-May-2019 11:21:21', 'import', 'Import from: ...\s981001908-0006-00001-000344-01.nii'}
|- Histogram:
| |- fncY: [1x256 double]
| |- fncX: [1x256 double]
| |- intensityMax: 255
| |- cumulFncY: [1x256 double]
| |- smoothFncX: [1x200 double]
| |- smoothFncY: [1x200 double]
| |- max: [1x2 struct]
| | |- <struct #1>
| | | |- x: 4
| | | |- y: 2329370.4091
| | | |- power: 2222694.4153
| | |- <struct #2>
| | | |- x: 26
| | | |- y: 116157.6653
| | | |- power: 9481.6715
| |- min:
| | |- x: 17
| | |- y: 106675.9938
| | |- power: 1116088.0434
| |- bgLevel: 17
| |- whiteLevel: 21
|- SCS:
| |- NAS: [136.0913, 211.9763, 98.6301]
| |- LPA: [46.5215, 126.1043, 96.815]
| |- RPA: [201.0024, 104.7791, 82.2739]
| |- R: [0.12614, 0.98765, 0.092956; -0.98886, 0.11772, 0.091121; 0.079052, -0.10341, 0.99149]
| |- T: [-137.9509; 100.6337; -86.6279]
| |- Origin: [123.7619; 115.4417; 89.5444]
|- NCS:
| |- AC: [127.9813, 129.7428, 128.8656]
| |- PC: [124.6816, 103.2932, 127.621]
| |- IH: [128.7007, 108.4932, 181.3553]
| |- R: [1.0507, -0.12796, -0.066203; 0.1581, 1.031, 0.16755; 0.089741, -0.14143, 1.1608]
| |- T: [-109.333; -172.5917; -146.7224]
| |- Origin: [127.7629, 126.3705, 131.9175]

After exportation:
Name: Subject03/subjectimage_s981001908-0006-00001-000344-01.mat

|
|- FileName: 'Subject03/subjectimage_s981001908-0006-00001-000344-01.mat'
|- Comment: 's981001908-0006-00001-000344-01'
|- Cube: [256x344x256 uint8]
|- Voxsize: [0.9766, 0.9766, 0.7]
|- SCS:
| |- NAS: [136.1032, 295.5198, 70.7782]
| |- LPA: [46.4151, 176.1492, 69.5989]
| |- RPA: [201.2913, 146.3469, 59.1574]
| |- R: [0.090753, 0.99474, 0.047415; -0.99424, 0.087773, 0.061553; 0.057068, -0.052728, 0.99698]
| |- T: [-174.6931; 105.0236; -62.7493]
| |- Origin: [123.8532; 161.2481; 64.3781]
|- NCS:
| |- AC: [127.9973, 181.0002, 92.5464]
| |- PC: [124.7172, 144.2065, 91.6851]
| |- IH: [128.643, 151.2437, 130.1952]
| |- R: [1.0482, -0.09133, -0.090162; 0.15868, 0.74129, 0.23787; 0.089864, -0.10027, 1.6191]
| |- T: [-109.2882; -173.4978; -147.1983]
| |- Origin: [127.776, 176.2973, 94.7379]
|- Header:
| |- key:
| | |- sizeof_hdr: 348
| | |- data_type: ''
| | |- db_name: ''
| | |- extents: 0
| | |- session_error: 0
| | |- regular: 'r'
| | |- hkey_un0: ' '
| |- dim:
| | |- dim: [3, 256, 344, 256, 1, 0, 0, 0]
| | |- vox_units: ''
| | |- cal_units: ''
| | |- unused1: 0
| | |- datatype: 2
| | |- bitpix: 8
| | |- dim_un0: 0
| | |- pixdim: [-1, 0.9766, 0.9766, 0.7, 0, 0, 0, 0]
| | |- vox_offset: 352
| | |- funused1: 0
| | |- funused2: 0
| | |- funused3: 4.039e-28
| | |- cal_max: 0
| | |- cal_min: 0
| | |- compressed: 0
| | |- verified: 0
| | |- glmax: 255
| | |- glmin: 0
| |- hist:
| | |- descrip: 'Written with Brainstorm'
| | |- aux_file: ''
| | |- orient: 0
| | |- originator: [512, 0, 0, 0, 0]
| | |- generated: ''
| | |- scannum: 'vz'
| | |- patient_id: '?x'
| | |- exp_date: 'þüÂ433'
| | |- exp_time: '?LLúÂ'
| | |- hist_un0: ''
| | |- views: 0
| | |- vols_added: 1064960629
| | |- start_field: 3270337888
| | |- field_skip: 0
| | |- omax: 0
| | |- omin: 0
| | |- smax: 0
| | |- smin: 3222382
| |- nifti:
| | |- magic: [110, 43, 49, 0]
| | |- dim_info: ' '
| | |- intent_p1: 0
| | |- intent_p2: 0
| | |- intent_p3: 0
| | |- intent_code: 0
| | |- slice_start: 0
| | |- scl_slope: 0
| | |- scl_inter: 0
| | |- slice_end: 0
| | |- slice_code: 0
| | |- xyzt_units: 18
| | |- slice_duration: 0
| | |- toffset: 0
| | |- qform_code: 0
| | |- sform_code: 2
| | |- quatern_b: 0
| | |- quatern_c: 0
| | |- quatern_d: 0
| | |- qoffset_x: 0
| | |- qoffset_y: 0
| | |- qoffset_z: 0
| | |- srow_x: [0.9766, 0, 0, -126.497]
| | |- srow_y: [0, 0.7, 0, -125.149]
| | |- srow_z: [0, 0, 0.9766, -118.698]
| | |- intent_name: [1x16 double]
| | |- sform: [4x4 double]
| | |- qform: [4x4 double]
| | |- vox2ras: [4x4 double]
|- Histogram:
| |- fncY: [1x256 double]
| |- fncX: [1x256 double]
| |- intensityMax: 255
| |- cumulFncY: [1x256 double]
| |- smoothFncX: [1x200 double]
| |- smoothFncY: [1x200 double]
| |- max: [1x2 struct]
| | |- <struct #1>
| | | |- x: 4
| | | |- y: 2329370.4091
| | | |- power: 2222694.4153
| | |- <struct #2>
| | | |- x: 26
| | | |- y: 116157.6653
| | | |- power: 9481.6715
| |- min:
| | |- x: 17
| | |- y: 106675.9938
| | |- power: 1116088.0434
| |- bgLevel: 17
| |- whiteLevel: 21
|- InitTransf: {'vox2ras', [4x4 double]}
|- Labels: []
|- History: {'27-Jul-2023 17:08:12', 'import', 'Import from: ...\s981001908-0006-00001-000344-01.nii'}

I haven't done co-registration on the re-imported images, due to the mis-scaling in x-axis.
Thank you.

@tmedani
Probably the voxel size is flipped during exportation?

I checked another subject whose MRI was correct after exportation, and the voxel size matches.
Would you know if this could be the issue?
Thank you.