Test TRIUX system support.
()
| 1502 | @pytest.mark.slowtest |
| 1503 | @testing.requires_testing_data |
| 1504 | def test_triux(): |
| 1505 | """Test TRIUX system support.""" |
| 1506 | raw = read_crop(tri_fname, (0, 0.999)) |
| 1507 | _assert_mag_coil_type(raw.info, FIFF.FIFFV_COIL_VV_MAG_T1) |
| 1508 | assert_allclose(raw.info["chs"][2]["cal"], 1.33e-10, rtol=1e-6) |
| 1509 | # standard |
| 1510 | with use_coil_def(elekta_def_fname): |
| 1511 | sss_py = maxwell_filter(raw, coord_frame="meg", regularize=None) |
| 1512 | _assert_mag_coil_type(sss_py.info, FIFF.FIFFV_COIL_VV_MAG_T3) |
| 1513 | assert_meg_snr(sss_py, read_crop(tri_sss_fname), 37, 700) |
| 1514 | # cross-talk |
| 1515 | sss_py = maxwell_filter( |
| 1516 | raw, coord_frame="meg", regularize=None, cross_talk=tri_ctc_fname |
| 1517 | ) |
| 1518 | assert_meg_snr(sss_py, read_crop(tri_sss_ctc_fname), 31, 250) |
| 1519 | # fine cal |
| 1520 | sss_py = maxwell_filter( |
| 1521 | raw, coord_frame="meg", regularize=None, calibration=tri_cal_fname |
| 1522 | ) |
| 1523 | assert_meg_snr(sss_py, read_crop(tri_sss_cal_fname), 5, 100) |
| 1524 | # ctc+cal |
| 1525 | sss_py = maxwell_filter( |
| 1526 | raw, |
| 1527 | coord_frame="meg", |
| 1528 | regularize=None, |
| 1529 | calibration=tri_cal_fname, |
| 1530 | cross_talk=tri_ctc_fname, |
| 1531 | ) |
| 1532 | assert_meg_snr(sss_py, read_crop(tri_sss_ctc_cal_fname), 5, 100) |
| 1533 | # regularization |
| 1534 | sss_py = maxwell_filter(raw, coord_frame="meg", regularize="in") |
| 1535 | sss_mf = read_crop(tri_sss_reg_fname) |
| 1536 | assert_meg_snr(sss_py, sss_mf, 0.6, 9) |
| 1537 | _check_reg_match(sss_py, sss_mf, 1) |
| 1538 | # all three |
| 1539 | sss_py = maxwell_filter( |
| 1540 | raw, |
| 1541 | coord_frame="meg", |
| 1542 | regularize="in", |
| 1543 | calibration=tri_cal_fname, |
| 1544 | cross_talk=tri_ctc_fname, |
| 1545 | ) |
| 1546 | sss_mf = read_crop(tri_sss_ctc_cal_reg_in_fname) |
| 1547 | assert_meg_snr(sss_py, sss_mf, 0.6, 9) |
| 1548 | _check_reg_match(sss_py, sss_mf, 1) |
| 1549 | # tSSS |
| 1550 | raw = read_crop(tri_fname).fix_mag_coil_types() |
| 1551 | with use_coil_def(elekta_def_fname): |
| 1552 | sss_py = maxwell_filter( |
| 1553 | raw, coord_frame="meg", regularize=None, st_duration=4.0, verbose=True |
| 1554 | ) |
| 1555 | assert_meg_snr(sss_py, read_crop(tri_sss_st4_fname), 700.0, 1600) |
| 1556 | |
| 1557 | |
| 1558 | @testing.requires_testing_data |
nothing calls this directly
no test coverage detected