-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplot_gii_surface.py
More file actions
36 lines (26 loc) · 1.37 KB
/
plot_gii_surface.py
File metadata and controls
36 lines (26 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
"""
Example usage:
python plot_gii_surface.py /path/to/my/mesh /path/to/my/map.gii \
<hemisphere> /path/to/my/img.png \
<view>
"""
from nilearn import plotting
from argparse import ArgumentParser
def main():
parser = ArgumentParser("Visualize surface data")
parser.add_argument('in_mesh', help="Surface mesh: .gii or Freesurfer specific files \
such as .orig, .pial, .sphere, .white, .inflated")
parser.add_argument('in_map', help="Data to visualize: valid formats are .gii, .mgz, .nii, \
.nii.gz, or Freesurfer specific files such as .thickness, \
.area, .curv, .sulc, .annot, .label")
parser.add_argument("hem", help="Hemisphere: 'right' or 'left'")
parser.add_argument("plot_loc", help="Target location of plot")
parser.add_argument("view", help="Brain view: ‘lateral’, ‘medial’, ‘dorsal’, 'ventral', \
'anterior', 'posterior' (Default = Lateral)")
results = parser.parse_args()
fig = plotting.plot_surf(results.in_mesh, surf_map=results.in_map,
hemi=results.hem, view=results.view,
output_file=results.plot_loc)
if __name__ == "__main__":
main()