Skip to content

Commit e6086c7

Browse files
committed
fiff: port the MNE-C head -> MNI -> Talairach transform chain
FiffCoordTransSet holds MNE-C's coordTransSet chain and gains readMniTransform (talairach.xfm), addTalairach (plus M. Brett's two MNI -> Talairach matrices), read/write, headToMni (= mne.head_to_mni) and mniToTalairach. MriMghIO tagged the talairach.xfm transform MRI -> MRI_DISPLAY and never emitted surface RAS -> RAS; it now returns surface RAS -> RAS and the RAS -> MNI -> Talairach chain with MNE-C's frames. mne_collect_transforms gains --mgh and collects the whole chain like MNE-C instead of only device->head and MRI->head.
1 parent 26c1bed commit e6086c7

26 files changed

Lines changed: 536 additions & 229 deletions

‎doc/api_registry.json‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8121,7 +8121,14 @@
81218121
"mne_python": null,
81228122
"sklearn": null,
81238123
"test": null,
8124-
"example": null,
8124+
"example": "ex_fiff_api",
8125+
"example_snippet": [
8126+
"ex_fiff_api/main.cpp#fiff_coord_trans_set_usage"
8127+
],
8128+
"example_mode": "run",
8129+
"required_data": [
8130+
"mne-cpp-test-data"
8131+
],
81258132
"status": "documented",
81268133
"skigen_candidate": false,
81278134
"documented": true,

‎doc/release/v2.4.0/api-evidence-baseline.json‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"registered_stale": 0,
1313
"registered_with_test": 101,
1414
"registered_test_unresolved": 0,
15-
"registered_with_example": 267,
15+
"registered_with_example": 268,
1616
"registered_example_not_built": 0,
1717
"registered_with_python_equiv": 88,
1818
"registered_without_api_page": 0,
19-
"with_snippet": 328,
19+
"with_snippet": 329,
2020
"public_api_units": 478,
2121
"example_eligible": 383,
2222
"example_exempt": 95,
23-
"eligible_backed_by_registry_example": 267,
24-
"eligible_used_by_some_example": 327,
23+
"eligible_backed_by_registry_example": 268,
24+
"eligible_used_by_some_example": 328,
2525
"examples_on_disk": 68,
2626
"examples_built": 68
2727
},
@@ -94,9 +94,9 @@
9494
"registered": 32,
9595
"with_test": 10,
9696
"eligible": 37,
97-
"eligible_with_registry_example": 31,
98-
"eligible_used_by_example": 34,
99-
"with_snippet": 36
97+
"eligible_with_registry_example": 32,
98+
"eligible_used_by_example": 35,
99+
"with_snippet": 37
100100
},
101101
"fs": {
102102
"public": 8,
@@ -6142,10 +6142,14 @@
61426142
"registry_status": "documented",
61436143
"test": null,
61446144
"test_resolves": false,
6145-
"example": null,
6146-
"example_state": "none",
6147-
"including_examples": [],
6148-
"snippets": [],
6145+
"example": "ex_fiff_api",
6146+
"example_state": "built",
6147+
"including_examples": [
6148+
"ex_fiff_api"
6149+
],
6150+
"snippets": [
6151+
"ex_fiff_api/main.cpp#fiff_coord_trans_set_usage"
6152+
],
61496153
"api_page": "doc/website/docs/api/fiff/fiff-coord-trans-set.mdx",
61506154
"python_equiv": null,
61516155
"example_eligible": true,

‎doc/release/v2.4.0/api-evidence-baseline.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ Generated by `tools/quality/audit_api_evidence.py`. Do not edit by hand.
1515
## Evidence
1616

1717
- Registry test reference: 101 / 354 (28.5%) (0 unresolved)
18-
- Registry example reference: 267 / 354 (75.4%) (0 missing or not built)
18+
- Registry example reference: 268 / 354 (75.7%) (0 missing or not built)
1919
- Python equivalent recorded: 88 / 354 (24.9%)
20-
- Doxygen `@snippet` references: 328
20+
- Doxygen `@snippet` references: 329
2121

2222
## G3 example metric
2323

2424
Public API units (exported classes, registered function namespaces and header-only types): 478. Example-eligible: **383** (95 exempt under the proposed policy).
2525

26-
- Eligible with a built registry example: 267 / 383 (69.7%)
27-
- Eligible whose header is included by any example: 327 / 383 (85.4%)
26+
- Eligible with a built registry example: 268 / 383 (70.0%)
27+
- Eligible whose header is included by any example: 328 / 383 (85.6%)
2828
- Examples on disk / built: 68 / 68
2929

3030
## By library
@@ -38,7 +38,7 @@ Public API units (exported classes, registered function namespaces and header-on
3838
| `disp` | 66 | 66 | 0 | 8 | 8 | 8 | 8 |
3939
| `disp3D` | 46 | 10 | 0 | 22 | 6 | 11 | 9 |
4040
| `dsp` | 80 | 51 | 28 | 80 | 51 | 80 | 80 |
41-
| `fiff` | 37 | 32 | 10 | 37 | 31 | 34 | 36 |
41+
| `fiff` | 37 | 32 | 10 | 37 | 32 | 35 | 37 |
4242
| `fs` | 8 | 8 | 4 | 8 | 8 | 8 | 8 |
4343
| `fwd` | 13 | 13 | 3 | 12 | 10 | 8 | 10 |
4444
| `inv` | 43 | 35 | 19 | 41 | 33 | 39 | 39 |

‎doc/release/v2.4.0/maintainability-baseline.json‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"generated_by": "tools/quality/audit_maintainability.py",
44
"policy": "tools/quality/maintainability_policy.json",
55
"scanned_files": 1508,
6-
"scanned_lines": 394648,
6+
"scanned_lines": 394768,
77
"oversized_threshold": 2000,
88
"metrics": {
99
"null_macro": {
@@ -406,12 +406,12 @@
406406
}
407407
},
408408
"console_io": {
409-
"total": 370,
410-
"files": 54,
409+
"total": 358,
410+
"files": 53,
411411
"by_scope": {
412412
"applications": 7,
413413
"libraries": 59,
414-
"tools": 304
414+
"tools": 292
415415
},
416416
"suppressed": [],
417417
"top": {
@@ -420,7 +420,6 @@
420420
"src/tools/inverse/mne_compute_raw_inverse/main.cpp": 19,
421421
"src/libraries/utils/layoutmaker.cpp": 16,
422422
"src/tools/info/mne_show_fiff/mne_show_fiff_settings.cpp": 16,
423-
"src/tools/info/mne_collect_transforms/main.cpp": 12,
424423
"src/tools/inverse/mne_map_data/main.cpp": 11,
425424
"src/tools/preprocessing/mne_rename_channels/main.cpp": 10,
426425
"src/tools/visualization/mne_screenshot_regression/main.cpp": 10,
@@ -429,7 +428,8 @@
429428
"src/tools/conversion/mne_convert_surface/main.cpp": 8,
430429
"src/tools/conversion/mne_epochs2mat/main.cpp": 8,
431430
"src/tools/conversion/mne_eximia2fiff/main.cpp": 8,
432-
"src/tools/forward/mne_surf2bem/surfacechecks.cpp": 8
431+
"src/tools/forward/mne_surf2bem/surfacechecks.cpp": 8,
432+
"src/tools/info/mne_check_eeg_locations/main.cpp": 8
433433
},
434434
"all_files": {
435435
"src/applications/mne_analyze/plugins/view3d/view3d.cpp": 1,
@@ -465,7 +465,6 @@
465465
"src/tools/forward/mne_surf2bem/surfacechecks.cpp": 8,
466466
"src/tools/forward/mne_transform_points/main.cpp": 5,
467467
"src/tools/info/mne_check_eeg_locations/main.cpp": 8,
468-
"src/tools/info/mne_collect_transforms/main.cpp": 12,
469468
"src/tools/info/mne_list_bem/main.cpp": 8,
470469
"src/tools/info/mne_list_coil_def/main.cpp": 5,
471470
"src/tools/info/mne_list_proj/main.cpp": 6,

‎doc/release/v2.4.0/maintainability-baseline.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Generated by `tools/quality/audit_maintainability.py`. Do not edit by hand.
44
Counts are lexical candidates with comments and string literals removed; they rank work, they do not prove defects.
55

6-
Scanned 1,508 files / 394,648 lines in `src/libraries`, `src/applications`, `src/tools`. Compiler warnings: 0 (the build is `-Werror`, T6.1).
6+
Scanned 1,508 files / 394,768 lines in `src/libraries`, `src/applications`, `src/tools`. Compiler warnings: 0 (the build is `-Werror`, T6.1).
77

88
| Metric | Total | Files | libraries | applications | tools |
99
|---|---:|---:|---:|---:|---:|
@@ -12,7 +12,7 @@ Scanned 1,508 files / 394,648 lines in `src/libraries`, `src/applications`, `src
1212
| `c_style_cast` | 429 | 73 | 275 | 61 | 93 |
1313
| `raw_new` | 169 | 90 | 63 | 100 | 6 |
1414
| `raw_delete` | 275 | 101 | 98 | 155 | 22 |
15-
| `console_io` | 370 | 54 | 59 | 7 | 304 |
15+
| `console_io` | 358 | 53 | 59 | 7 | 292 |
1616
| `numeric_define` | 834 | 31 | 730 | 69 | 35 |
1717
| `qt_new_unparented` | 825 | 83 | 108 | 715 | 2 |
1818
| `oversized_unit` | 8 | 8 | 5 | 3 | 0 |
@@ -107,7 +107,6 @@ Scanned 1,508 files / 394,648 lines in `src/libraries`, `src/applications`, `src
107107
| 19 | `src/tools/inverse/mne_compute_raw_inverse/main.cpp` |
108108
| 16 | `src/libraries/utils/layoutmaker.cpp` |
109109
| 16 | `src/tools/info/mne_show_fiff/mne_show_fiff_settings.cpp` |
110-
| 12 | `src/tools/info/mne_collect_transforms/main.cpp` |
111110
| 11 | `src/tools/inverse/mne_map_data/main.cpp` |
112111
| 10 | `src/tools/preprocessing/mne_rename_channels/main.cpp` |
113112
| 10 | `src/tools/visualization/mne_screenshot_regression/main.cpp` |
@@ -117,6 +116,7 @@ Scanned 1,508 files / 394,648 lines in `src/libraries`, `src/applications`, `src
117116
| 8 | `src/tools/conversion/mne_epochs2mat/main.cpp` |
118117
| 8 | `src/tools/conversion/mne_eximia2fiff/main.cpp` |
119118
| 8 | `src/tools/forward/mne_surf2bem/surfacechecks.cpp` |
119+
| 8 | `src/tools/info/mne_check_eeg_locations/main.cpp` |
120120

121121
## `numeric_define` — top files
122122

‎doc/release/v2.4.0/quality-baseline.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"public_api_units": 478,
5151
"exported_not_registered": 124,
5252
"example_eligible": 383,
53-
"eligible_backed_percent": 69.71,
54-
"snippets": 328,
53+
"eligible_backed_percent": 69.97,
54+
"snippets": 329,
5555
"registered_test_percent": 28.53
5656
},
5757
"G4_screenshots": {
@@ -68,7 +68,7 @@
6868
"c_style_cast": 429,
6969
"raw_new": 169,
7070
"raw_delete": 275,
71-
"console_io": 370,
71+
"console_io": 358,
7272
"numeric_define": 834,
7373
"qt_new_unparented": 825,
7474
"oversized_unit": 8

‎doc/release/v2.4.0/quality-baseline.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Coverage from `5053fe099` (https://github.com/mne-tools/mne-cpp/actions/runs/362
1313
| G2 | Applications >= 50.0% line | 24.9% | **open** |
1414
| G2 | Tools >= 50.0% line | 61.68% | met |
1515
| G2 | Libraries >= 65.0% branch | 42.9% | **open** |
16-
| G3 | Eligible APIs have an executable example | 69.71% of 383; 328 snippets | **open** |
16+
| G3 | Eligible APIs have an executable example | 69.97% of 383; 329 snippets | **open** |
1717
| G3 | Exported API is registered | 124 exported classes unregistered | **open** |
1818
| G4 | Documentation images generated in CI | 19 referenced, 0 without producer, placeholders in 0 workflows | met |
1919
| G4 | Visual regression compares to goldens | 0 golden comparisons | **open** |
2020
| G5 | Zero compiler warnings | enforced by -Werror on every matrix entry | met |
21-
| G5 | Debt metrics ratcheted | null_macro 43, typedef_struct 12, c_style_cast 429, raw_new 169, raw_delete 275, console_io 370, numeric_define 834, qt_new_unparented 825, oversized_unit 8 | baseline recorded |
21+
| G5 | Debt metrics ratcheted | null_macro 43, typedef_struct 12, c_style_cast 429, raw_new 169, raw_delete 275, console_io 358, numeric_define 834, qt_new_unparented 825, oversized_unit 8 | baseline recorded |
2222
| G6 | Pinned reference environment | MNE-Python 1.11.0; unpinned in CI: none | met |
2323
| G6 | Parity claims cross-validated | cross-validated-static 3, cross-validated-live 1, tested 84, unverified 270 | **open** |
2424

‎doc/website/docs/api/class-members.mdx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_position: 5
77

88
# Class Members
99

10-
Index of 6270 public class members (functions, variables, typedefs, enums) across all documented classes.
10+
Index of 6275 public class members (functions, variables, typedefs, enums) across all documented classes.
1111

1212
**Jump to:** [A](#a) · [B](#b) · [C](#c) · [D](#d) · [E](#e) · [F](#f) · [G](#g) · [H](#h) · [I](#i) · [J](#j) · [K](#k) · [L](#l) · [M](#m) · [N](#n) · [O](#o) · [P](#p) · [Q](#q) · [R](#r) · [S](#s) · [T](#t) · [U](#u) · [V](#v) · [W](#w) · [X](#x) · [Y](#y) · [Z](#z)
1313

@@ -98,6 +98,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
9898
- **addSubject** `[slot]` in [BidsViewModel](/docs/api/disp/bids-view-model) — Adds subject with given input name.
9999
- **addSurface** `[fn]` in `BrainTreeModel`
100100
- **addTable** `[fn]` in [Report](/docs/api/utils/report) — Add a table section.
101+
- **addTalairach** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Sets the RAS -> MNI transform from a ``.xfm file and the two MNI -> FreeSurfer Talairach transforms (MNE-C mne_mri_add_talairach_transforms).
101102
- **addText** `[fn]` in [Report](/docs/api/utils/report) — Add a text section.
102103
- **addToData** `[slot]` in [BidsViewModel](/docs/api/disp/bids-view-model) — Adds a sub-item to a data item (ex.
103104
- **addTriangleData** `[fn]` in [MNEBemSurface](/docs/api/mne/mne-bem-surface) — Definition of the mne_add_triangle_data function in mne_add_geometry_info.c.
@@ -1624,7 +1625,6 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
16241625
- **FiffCoordTrans** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Copy constructor.
16251626
- **FiffCoordTrans** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Constructs a coordinate transformation from a rotation matrix and translation vector.
16261627
- **FiffCoordTrans** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Constructs a coordinate transformation from a 4×4 homogeneous matrix.
1627-
- **FiffCoordTransSet** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Constructs the [`FiffCoordTransSet`](/docs/api/fiff/fiff-coord-trans-set).
16281628
- **FiffCov** `[fn]` in [FiffCov](/docs/api/fiff/fiff-cov) — Constructs the covariance data matrix.
16291629
- **FiffCov** `[fn]` in [FiffCov](/docs/api/fiff/fiff-cov) — Constructs a covariance data matrix, by reading from a IO device.
16301630
- **FiffCov** `[fn]` in [FiffCov](/docs/api/fiff/fiff-cov) — Copy constructor.
@@ -2406,6 +2406,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
24062406
- **headerData** `[fn]` in [FrequencySpectrumModel](/docs/api/disp/frequency-spectrum-model) — Returns the data for the given role and section in the header with the specified orientation.
24072407
- **headerData** `[fn]` in [RtFiffRawViewModel](/docs/api/disp/rt-fiff-raw-view-model) — Returns the data for the given role and section in the header with the specified orientation.
24082408
- **headToDevice** `[fn]` in [PolhemusCoregistration](/docs/api/utils/polhemus-coregistration)
2409+
- **headToMni** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Maps MEG head coordinates to MNI Talairach coordinates, as `mne.head_to_mni` does.
24092410
- **headToWorld** `[fn]` in [PolhemusCoregistration](/docs/api/utils/polhemus-coregistration)
24102411
- **height** `[var]` in [MNEVolGeom](/docs/api/mne/mne-vol-geom)
24112412
- **height** `[var]` in `MriSlice` — Height of the image in pixels.
@@ -3316,6 +3317,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
33163317
- **MNEVolGeom** `[fn]` in [MNEVolGeom](/docs/api/mne/mne-vol-geom) — Constructs the [`MNE`](/docs/api/mne/mne-class) Volume Geometry.
33173318
- **MNI_tal_tal_gtz_t** `[var]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Transform MNI Talairach to FreeSurfer Talairach coordinates (z > 0).
33183319
- **MNI_tal_tal_ltz_t** `[var]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Transform MNI Talairach to FreeSurfer Talairach coordinates (z < 0).
3320+
- **mniToTalairach** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Maps MNI Talairach coordinates to FreeSurfer Talairach coordinates, using the transform for points above or below the AC-PC plane (MNI z > 0 or not).
33193321
- **modalitiesChanged** `[signal]` in [ModalitySelectionView](/docs/api/disp/modality-selection-view) — Emit this signal whenever the user changed the modality.
33203322
- **modality** `[fn]` in `RtSensorStreamManager`
33213323
- **modalityChanged** `[signal]` in [DipoleFitView](/docs/api/disp/dipole-fit-view) — Send new modality selection.
@@ -4133,6 +4135,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
41334135
- **read** `[fn]` in [BidsRawData](/docs/api/bids/bids-raw-data) — Read a BIDS dataset from disk.
41344136
- **read** `[fn]` in [FiffAnnotations](/docs/api/fiff/fiff-annotations) — Auto-detects format and reads annotations.
41354137
- **read** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Reads a coordinate transform from a fif file.
4138+
- **read** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Takes every transform of the chain stored in a FIFF file, such as a `-trans.fif` file or a `COR.fif` MRI set (MNE-C mne_collect_transforms).
41364139
- **read** `[fn]` in [FiffEvents](/docs/api/fiff/fiff-events) — Read events from a FIFF or ASCII event file.
41374140
- **read** `[fn]` in [FiffEvoked](/docs/api/fiff/fiff-evoked) — fiff_read_evoked
41384141
- **read** `[fn]` in [FiffEvokedSet](/docs/api/fiff/fiff-evoked-set) — fiff_read_evoked
@@ -4246,6 +4249,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
42464249
- **readMetadata** `[fn]` in `RtDataClient` — Reads fiff metaata class from data connection.
42474250
- **readMNESelFile** `[fn]` in [SelectionIO](/docs/api/utils/selection-io) — Reads the specified MNE sel file.
42484251
- **readMNESelFile** `[fn]` in [SelectionIO](/docs/api/utils/selection-io) — Reads the specified MNE sel file.
4252+
- **readMniTransform** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Reads the scanner RAS -> MNI Talairach transform of a FreeSurfer/MNI ``.xfm file (MNE-C read_mni_coord_transform_file).
42494253
- **readMriTransform** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Reads the MRI → head coordinate transform from a FIFF file.
42504254
- **readRawBuffer** `[fn]` in `RtDataClient` — Reads fiff measurement information of a data the connection.
42514255
- **readRawSegment** `[fn]` in [AbstractFormatReader](/docs/api/bids/abstract-format-reader) — Read a segment of raw data.
@@ -6202,6 +6206,7 @@ Index of 6270 public class members (functions, variables, typedefs, enums) acros
62026206
- **write** `[fn]` in [BidsRawData](/docs/api/bids/bids-raw-data) — Convenience overload — write with default options.
62036207
- **write** `[fn]` in [FiffAnnotations](/docs/api/fiff/fiff-annotations) — Auto-detects format and writes annotations.
62046208
- **write** `[fn]` in [FiffCoordTrans](/docs/api/fiff/fiff-coord-trans) — Writes the transformation to file.
6209+
- **write** `[fn]` in [FiffCoordTransSet](/docs/api/fiff/fiff-coord-trans-set) — Writes every non-empty transform, head -> MRI first.
62056210
- **write** `[fn]` in [FiffDigPointSet](/docs/api/fiff/fiff-dig-point-set) — Writes the [`FiffDigPointSet`](/docs/api/fiff/fiff-dig-point-set) to a FIFF file.
62066211
- **write** `[fn]` in [FiffDigPointSet](/docs/api/fiff/fiff-dig-point-set) — Convenience overload: write the digitizer point set to a path on disk.
62076212
- **write** `[fn]` in [FiffIO](/docs/api/fiff/fiff-io) — Write data to a single pIODevice.

0 commit comments

Comments
 (0)