Export source spaces to nifti or mgz file. Parameters ---------- fname : path-like Name of nifti or mgz file to write. include_surfaces : bool If True, include surface source spaces. include_discrete : bool If True, include
(
self,
fname,
include_surfaces=True,
include_discrete=True,
dest="mri",
trans=None,
mri_resolution=False,
use_lut=True,
overwrite=False,
verbose=None,
)
| 522 | |
| 523 | @verbose |
| 524 | def export_volume( |
| 525 | self, |
| 526 | fname, |
| 527 | include_surfaces=True, |
| 528 | include_discrete=True, |
| 529 | dest="mri", |
| 530 | trans=None, |
| 531 | mri_resolution=False, |
| 532 | use_lut=True, |
| 533 | overwrite=False, |
| 534 | verbose=None, |
| 535 | ): |
| 536 | """Export source spaces to nifti or mgz file. |
| 537 | |
| 538 | Parameters |
| 539 | ---------- |
| 540 | fname : path-like |
| 541 | Name of nifti or mgz file to write. |
| 542 | include_surfaces : bool |
| 543 | If True, include surface source spaces. |
| 544 | include_discrete : bool |
| 545 | If True, include discrete source spaces. |
| 546 | dest : ``'mri'`` | ``'surf'`` |
| 547 | If ``'mri'`` the volume is defined in the coordinate system of the |
| 548 | original T1 image. If ``'surf'`` the coordinate system of the |
| 549 | FreeSurfer surface is used (Surface RAS). |
| 550 | trans : dict, str, or None |
| 551 | Either a transformation filename (usually made using mne_analyze) |
| 552 | or an info dict (usually opened using read_trans()). If string, an |
| 553 | ending of ``.fif`` or ``.fif.gz`` will be assumed to be in FIF |
| 554 | format, any other ending will be assumed to be a text file with a |
| 555 | 4x4 transformation matrix (like the ``--trans`` MNE-C option. |
| 556 | Must be provided if source spaces are in head coordinates and |
| 557 | include_surfaces and mri_resolution are True. |
| 558 | mri_resolution : bool | str |
| 559 | If True, the image is saved in MRI resolution |
| 560 | (e.g. 256 x 256 x 256), and each source region (surface or |
| 561 | segmentation volume) filled in completely. If "sparse", only a |
| 562 | single voxel in the high-resolution MRI is filled in for each |
| 563 | source point. |
| 564 | |
| 565 | .. versionchanged:: 0.21.0 |
| 566 | Support for ``"sparse"`` was added. |
| 567 | use_lut : bool |
| 568 | If True, assigns a numeric value to each source space that |
| 569 | corresponds to a color on the freesurfer lookup table. |
| 570 | %(overwrite)s |
| 571 | |
| 572 | .. versionadded:: 0.19 |
| 573 | %(verbose)s |
| 574 | |
| 575 | Notes |
| 576 | ----- |
| 577 | This method requires nibabel. |
| 578 | """ |
| 579 | _check_fname(fname, overwrite) |
| 580 | _validate_type(mri_resolution, (bool, str), "mri_resolution") |
| 581 | if isinstance(mri_resolution, str): |