Flip left and right hemispheres in the horizontal dimension Parameters ---------- v : list View layout list h : list Hemisphere layout list Returns ------- list, list Flipped view and hemisphere layouts
(v, h)
| 76 | |
| 77 | |
| 78 | def _flip_hemispheres(v, h): |
| 79 | """Flip left and right hemispheres in the horizontal dimension |
| 80 | |
| 81 | Parameters |
| 82 | ---------- |
| 83 | v : list |
| 84 | View layout list |
| 85 | h : list |
| 86 | Hemisphere layout list |
| 87 | |
| 88 | Returns |
| 89 | ------- |
| 90 | list, list |
| 91 | Flipped view and hemisphere layouts |
| 92 | """ |
| 93 | v = np.array(v) |
| 94 | h = np.array(h) |
| 95 | if (v.ndim == 1) and (v.shape[0] > 1): |
| 96 | # flip row |
| 97 | flip_axis = 0 |
| 98 | elif (v.ndim == 2) and (v.shape[1] > 1): |
| 99 | # flip grid |
| 100 | flip_axis = 1 |
| 101 | return np.flip(v, flip_axis).tolist(), np.flip(h, flip_axis).tolist() |
| 102 | |
| 103 | |
| 104 | def _check_data(data): |