Skip to content

Commit

Permalink
FIX: Dim
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Sep 11, 2024
1 parent 29cc7c6 commit 4290d9a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mne_nirs/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def examples_path():
)


# TODO: Change ax= to axes= once nilearn 0.11 is out
@pytest.mark.filterwarnings('ignore:The parameter "ax" will be removed.*:')
@pytest.mark.filterwarnings("ignore:No bad channels to interpolate.*:")
@pytest.mark.filterwarnings("ignore:divide by zero encountered.*:")
@pytest.mark.filterwarnings("ignore:invalid value encountered.*:")
Expand Down
6 changes: 5 additions & 1 deletion mne_nirs/utils/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def _tidy_Contrast(data, glm_est, design_matrix):
contrast_type = glm_est.stat_type
else: # nilearn < 0.10
contrast_type = glm_est.contrast_type
effect = glm_est.effect
if effect.ndim == 2: # old nilearn
assert effect.shape[0] == 1
effect = effect[0]
for idx, ch in enumerate(data.ch_names):
df = pd.concat(
[
Expand All @@ -79,7 +83,7 @@ def _tidy_Contrast(data, glm_est, design_matrix):
"ch_name": ch,
"ContrastType": contrast_type,
"variable": "effect",
"value": glm_est.effect[0][idx],
"value": effect[idx],
},
index=[0],
),
Expand Down
5 changes: 4 additions & 1 deletion mne_nirs/visualisation/_plot_GLM_topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ def _plot_glm_contrast_topo(inst, contrast, figsize=(12, 7), sphere=None):
types = np.unique(info.get_channel_types())

# Extract values to plot and rescale to uM
estimates = contrast.effect[0]
estimates = contrast.effect
if estimates.ndim == 2: # old nilearn
assert estimates.shape[0] == 1
estimates = estimates[0]
estimates = estimates * 1e6

# Create subplots for figures
Expand Down

0 comments on commit 4290d9a

Please sign in to comment.