Skip to content

Commit

Permalink
AMD process label subejcts
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Nov 26, 2021
1 parent 5e017eb commit d837e3d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eelbrain/plot/_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ def __init__(
subjects_dir: PathArg = None,
):
self._data = []
self._source = None # for mask
self._subject = subject
self._subjects_dir = subjects_dir
self._frame_dim = None
Expand Down Expand Up @@ -1212,7 +1213,9 @@ def set_brain(
Parameters
----------
source
Brain model on which to plot.
Brain model on which to plot. The coverage if the source space is
also used for the mask (the first source space that is added takes
precedence).
subject
Specify subject directly.
subjects_dir
Expand All @@ -1233,6 +1236,9 @@ def set_brain(
elif subjects_dir and subjects_dir != self._subjects_dir:
raise ValueError(f"different subjects_dir ({subjects_dir}) than previously added ({self._subjects_dir})")

if self._source is None and isinstance(source, SourceSpace):
self._source = source

def _n_items(self):
if self._bin_kind == SPLayer.SEQUENCE:
raise RuntimeError("Trying to retrieve number of items for dimension-based plot")
Expand Down Expand Up @@ -1638,9 +1644,10 @@ def _generate_ims(
) -> dict:
bins = self._bins
ims = {}
source_space = self._source or self._subject
for hemi in hemis:
# plot brain
b = brain(self._subject, hemi=hemi, views='lateral', w=w, h=h, time_label='', subjects_dir=self._subjects_dir, **self._brain_args)
b = brain(source_space, hemi=hemi, views='lateral', w=w, h=h, time_label='', subjects_dir=self._subjects_dir, **self._brain_args)

if self._bin_kind == SPLayer.SEQUENCE:
for l in self._data:
Expand Down

0 comments on commit d837e3d

Please sign in to comment.