|
1 | 1 | """
|
| 2 | +============================ |
2 | 3 | Display Probabilistic Labels
|
3 | 4 | ============================
|
4 | 5 |
|
|
16 | 17 | config_opts=dict(cortex="low_contrast"))
|
17 | 18 |
|
18 | 19 | """
|
19 |
| -The simplest way is to use add_label. |
| 20 | +The easiest way to label any vertex that could be in the region is with |
| 21 | +add_label. |
20 | 22 | """
|
21 |
| -brain.add_label("BA1", color="darkblue") |
| 23 | +brain.add_label("BA1", color="#A6BDDB") |
22 | 24 |
|
23 | 25 | """
|
24 |
| -You can also threshold based on the probability of that |
25 |
| -region being at each vertex. |
| 26 | +You can also threshold based on the probability of that region being at each |
| 27 | +vertex. |
26 | 28 | """
|
27 |
| -brain.add_label("BA1", color="dodgerblue", scalar_thresh=.5) |
| 29 | +brain.add_label("BA1", color="#2B8CBE", scalar_thresh=.5) |
28 | 30 |
|
29 | 31 | """
|
30 |
| -It's also possible to plot just the label boundary, in case |
31 |
| -you wanted to overlay the label on an activation plot to |
32 |
| -asses whether it falls within that region. |
| 32 | +It's also possible to plot just the label boundary, in case you wanted to |
| 33 | +overlay the label on an activation plot to asses whether it falls within that |
| 34 | +region. |
33 | 35 | """
|
34 |
| -brain.add_label("BA45", color="firebrick", borders=True) |
35 |
| -brain.add_label("BA45", color="salmon", borders=True, scalar_thresh=.5) |
| 36 | +brain.add_label("BA45", color="#F0F8FF", borders=True, scalar_thresh=.5) |
| 37 | +brain.add_label("BA45", color="#F0F8FF", alpha=.3, scalar_thresh=.5) |
36 | 38 |
|
37 | 39 | """
|
38 | 40 | Finally, with a few tricks, you can display the whole probabilistic map.
|
39 | 41 | """
|
40 |
| -label_file = join(environ["SUBJECTS_DIR"], |
41 |
| - "fsaverage", "label", "lh.BA6.label") |
| 42 | +subjects_dir = environ["SUBJECTS_DIR"] |
| 43 | +label_file = join(subjects_dir, "fsaverage", "label", "lh.BA6.label") |
| 44 | + |
42 | 45 | prob_field = np.zeros_like(brain._geo.x)
|
43 | 46 | ids, probs = io.read_label(label_file, read_scalars=True)
|
44 | 47 | prob_field[ids] = probs
|
45 |
| -brain.add_data(prob_field, thresh=1e-5) |
| 48 | +brain.add_data(prob_field, thresh=1e-5, colormap="RdPu") |
46 | 49 |
|
47 | 50 | """
|
48 |
| -Adjust the colorbar to represent the coarseness of the probability |
49 |
| -estimates more closely. |
| 51 | +Adjust the colorbar to represent the coarseness of the probability estimates |
| 52 | +more closely. |
50 | 53 | """
|
51 | 54 | brain.data["colorbar"].number_of_colors = 10
|
52 | 55 | brain.data["colorbar"].number_of_labels = 11
|
0 commit comments