Skip to content

Commit e85753e

Browse files
DingkunLiularsoner
authored andcommitted
ENH: Add kwargs in Brain.add_* and pass it to mayavi modules (#276)
* Feat: add kwargs in Brain.add_* and pass it to mayavi modules, so that we could directly manipulate mayavi display settings, like point resolution and overlay opacity. * Fix: Fix code styles which failed in the flake test. * Modify test_viz to pass the kwargs to the mayavi module. * fix flake test. * Specifying `kwargs` as `mlab_kws` and make the documentation more clear. * Revert "Specifying `kwargs` as `mlab_kws` and make the documentation more clear." This reverts commit c7a5912. * Link mayavi documents. * Give detailed explanations about the kwargs passed to the functions. * Revert "Link mayavi documents." This reverts commit 2c86a04. * Change the position of line breaking. * Fix the typo and unavailable links. * Fix render errors. * Revert "Fix render errors." This reverts commit ac0b7b8. * Fix render error. * Improve code rendering. * Revert "Fix render error." This reverts commit bbf7631. * Fix line breaking error. * Revert "Fix line breaking error." This reverts commit 6efccac. * Fix line breaking error. * Revert "Fix line breaking error." This reverts commit a7abf61. * Force line breaking to fix the rendering error on long code. * Revert "Force line breaking to fix the rendering error on long code." This reverts commit 6a9cdf1. * Force line breaking to fix the rendering error on long code. * Revert "Force line breaking to fix the rendering error on long code." This reverts commit c7f6a9f. * Force line breaking to fix the rendering error on long code. * Revert "Force line breaking to fix the rendering error on long code." This reverts commit de31e5f. * Fix render error Force line breaking to avoid render error. * Render undocumented function as plain code. * Fix sectioning. * FIX: Formatting
1 parent 64a1069 commit e85753e

File tree

4 files changed

+79
-40
lines changed

4 files changed

+79
-40
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.orig
88
*.mov
99
build
10+
.idea/
1011

1112
dist/
1213
doc/_build/

doc/_static/navy.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,8 @@ ul.keywordmatches li.goodmatch a {
546546
div.sphx-glr-footer-example a code span:last-child {
547547
font-size: unset;
548548
}
549-
}
549+
}
550+
551+
table.longtable.align-default {
552+
width: 100%;
553+
}

surfer/tests/test_viz.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_annot():
153153
view = get_view(brain)
154154

155155
for a, b, p in zip(annots, borders, alphas):
156-
brain.add_annotation(a, b, p)
156+
brain.add_annotation(a, b, p, opacity=0.8)
157157
check_view(brain, view)
158158

159159
brain.set_surf('white')
@@ -226,7 +226,11 @@ def test_foci():
226226
coords = [[-36, 18, -3],
227227
[-43, 25, 24],
228228
[-48, 26, -2]]
229-
brain.add_foci(coords, map_surface="white", color="gold", name='test1')
229+
brain.add_foci(coords,
230+
map_surface="white",
231+
color="gold",
232+
name='test1',
233+
resolution=25)
230234

231235
subj_dir = utils._get_subjects_dir()
232236
annot_path = pjoin(subj_dir, subject_id, 'label', 'lh.aparc.a2009s.annot')
@@ -398,7 +402,7 @@ def test_overlay():
398402
brain = Brain(*std_args)
399403
brain.add_overlay(overlay_file)
400404
brain.overlays["sig"].remove()
401-
brain.add_overlay(overlay_file, min=5, max=20, sign="pos")
405+
brain.add_overlay(overlay_file, min=5, max=20, sign="pos", opacity=0.7)
402406
sig1 = io.read_scalar_data(pjoin(data_dir, "lh.sig.nii.gz"))
403407
sig2 = io.read_scalar_data(pjoin(data_dir, "lh.alt_sig.nii.gz"))
404408

0 commit comments

Comments
 (0)