Test plotting of -trans.fif files and MEG sensor layouts.
(tmp_path, renderer, mixed_fwd_cov_evoked)
| 515 | @pytest.mark.slowtest # can be slow on OSX |
| 516 | @testing.requires_testing_data |
| 517 | def test_plot_alignment_basic(tmp_path, renderer, mixed_fwd_cov_evoked): |
| 518 | """Test plotting of -trans.fif files and MEG sensor layouts.""" |
| 519 | # generate fiducials file for testing |
| 520 | fiducials_path = tmp_path / "fiducials.fif" |
| 521 | fid = [ |
| 522 | { |
| 523 | "coord_frame": 5, |
| 524 | "ident": 1, |
| 525 | "kind": 1, |
| 526 | "r": [-0.08061612, -0.02908875, -0.04131077], |
| 527 | }, |
| 528 | { |
| 529 | "coord_frame": 5, |
| 530 | "ident": 2, |
| 531 | "kind": 1, |
| 532 | "r": [0.00146763, 0.08506715, -0.03483611], |
| 533 | }, |
| 534 | { |
| 535 | "coord_frame": 5, |
| 536 | "ident": 3, |
| 537 | "kind": 1, |
| 538 | "r": [0.08436285, -0.02850276, -0.04127743], |
| 539 | }, |
| 540 | ] |
| 541 | write_dig(fiducials_path, fid, 5) |
| 542 | evoked = read_evokeds(evoked_fname)[0] |
| 543 | info = evoked.info |
| 544 | |
| 545 | sample_src = read_source_spaces(src_fname) |
| 546 | pytest.raises( |
| 547 | TypeError, |
| 548 | plot_alignment, |
| 549 | "foo", |
| 550 | trans_fname, |
| 551 | subject="sample", |
| 552 | subjects_dir=subjects_dir, |
| 553 | ) |
| 554 | pytest.raises( |
| 555 | OSError, |
| 556 | plot_alignment, |
| 557 | info, |
| 558 | trans_fname, |
| 559 | subject="sample", |
| 560 | subjects_dir=subjects_dir, |
| 561 | src="foo", |
| 562 | ) |
| 563 | pytest.raises( |
| 564 | ValueError, |
| 565 | plot_alignment, |
| 566 | info, |
| 567 | trans_fname, |
| 568 | subject="fsaverage", |
| 569 | subjects_dir=subjects_dir, |
| 570 | src=sample_src, |
| 571 | ) |
| 572 | sample_src.plot(subjects_dir=subjects_dir, head=True, skull=True, brain="white") |
| 573 | # mixed source space |
| 574 | mixed_src = mixed_fwd_cov_evoked[0]["src"] |
nothing calls this directly
no test coverage detected