MRF-SEEG Coordinate Space Reference

MRF-SEEG
methods
reference
Published

June 30, 2026

This note documents the image spaces used across the MRF-SEEG electrode analysis pipeline, reconstructed by tracing file dates and registration scripts after some confusion about which files corresponded to which space.

Per-patient native anchor space

Each patient’s analysis is anchored to res_T1_bet.nii, a brain-extracted T1 sitting on a patient-specific grid (e.g., for ith2: 210x288x210, 1mm isotropic, origin -105/-127/-138). This is distinct from the raw MRF reconstruction output, which lives at the top level of each patient folder (T1_data_brain.nii, T2_data_brain.nii, etc., generated directly from MRF reconstruction, dated Nov 28 2023 for ith2) on a different native grid (300x300x144 for ith2). The top-level MRF reconstruction files are not used directly in downstream analysis; they are the raw material from which everything else derives.

Electrode coordinates

Electrode contact coordinates are stored in <patient>/all_1mm.pom, a Curry-format point file. Coordinates in this file are voxel indices (not world-space mm) directly matching the res_T1_bet.nii / ANTs_1mm/mrf_2_t1_* grid described below. An earlier file, all.pom, contains coordinates in a different, untransformed space (likely native Curry/implant space) and should not be used for voxel-based sampling; all_1mm.pom is the resampled, analysis-ready version.

MRF-to-T1 registration (within-subject)

MRF-derived parameter maps (T1, T2, tissue segmentation) were registered to each patient’s res_T1_bet.nii via ANTs SyN registration, with outputs prefixed mrf_2_t1_* and stored in <patient>/ANTs_1mm/. This registration shares the same grid as res_T1_bet.nii (confirmed identical affine and shape for ith2). The key output files used in downstream sphere-sampling analyses are mrf_2_t1_T1_data_brain.nii.gz, mrf_2_t1_T2_data_brain.nii.gz (or the _trilinear variants), alongside the tissue segmentation files pvol_pve_0/1/2.nii.gz (CSF/GM/WM probability maps) and res_T1_bet_mask.nii (brain mask), all on this same grid.

Normative z-score pipeline (group-level, round-tripped to native space)

A separate registration brings each patient’s res_T1_bet.nii into a common MNI-aligned template space (“peter” space, target image mni/MNI_T1w_cropped_peter_bet.nii.gz), with outputs in <patient>/mni_peter/resT1bet_2_MNI_*. A normative mean/SD dictionary (peter_mean_std/T1_mean.nii, T1_std.nii, etc.) was built in this same MNI/peter space from a separate cohort of normal subjects (FreeSurfer-processed, see peter_mean_std and fs_normals pipelines). Each patient’s MNI-space T1/T2 is z-scored against this dictionary, producing <patient>/z_score/T1_z_mni10.nii (and earlier non-“10” suffixed versions).

These MNI-space z-score images are then warped back into the patient’s native space using the inverse of the resT1bet_2_MNI transform (loop_ants_apply_inverse_res_t1bet_z10.sh), producing <patient>/z_score/T1_z_ptspace10.nii.gz. This output shares the identical grid as res_T1_bet.nii and ANTs_1mm/mrf_2_t1_* (confirmed for ith2: identical shape and affine across all three).

Conclusion

Electrode coordinates, MRF T1/T2 maps, tissue segmentation, and native-space z-score images are all mutually aligned on a single shared per-patient grid anchored to res_T1_bet.nii. The electrode-stats extraction scripts (read_and_convert_pom*.m, extract_zvalue.m) correctly sample from this shared space. No coordinate mismatch was found upon investigation (June 30 2026); confusion arose from the existence of multiple registration pipelines (within-subject MRF-to-T1, and group-level MNI normalization) producing differently-named outputs that are easy to conflate at a glance.

Naming convention summary (for future reference)

File pattern Meaning Grid
T1_data_brain.nii (top level) Raw native MRF reconstruction output Native MRF grid (different from everything below; not used downstream)
res_T1_bet.nii Brain-extracted native T1 Per-patient anchor space
ANTs_1mm/mrf_2_t1_* MRF maps registered to res_T1_bet space Same as res_T1_bet
mni_peter/resT1bet_2_MNI_* res_T1_bet registered to MNI/peter template MNI/peter space
z_score/*_mni10.nii Z-scored MRF maps in MNI/peter space MNI/peter space
z_score/*_ptspace10.nii.gz MNI z-score maps warped back to native space Same as res_T1_bet (same as electrodes)

Outstanding items

  • This was verified in detail for ith2 only. Worth a quick affine/shape spot-check on 2-3 more patients (e.g., ith9, ith13) to confirm the pattern holds across the cohort, particularly since some patients have differing num_elec counts and slightly different file suffixes (_ptspace vs _ptspace2 vs _ptspace10).
  • The all.pomall_1mm.pom conversion step (and the POINT_TRAFO matrix embedded in the .pom header) was not fully reverse-engineered. Not currently blocking anything since all_1mm.pom coordinates were empirically confirmed to align correctly, but if this ever needs to be redone for a new patient, the conversion logic itself isn’t documented anywhere and would need to be reconstructed or re-asked of Spencer.