Changes for page Widget 3D Head

Last modified by paulapopa on 2025/05/30 15:03

From version 7.1
edited by paulapopa
on 2022/03/30 15:23
Change comment: There is no comment for this version
To version 1.1
edited by ldomide
on 2022/03/23 21:41
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.paulapopa
1 +XWiki.ldomide
Content
... ... @@ -1,103 +1,10 @@
1 -TODO - Not yet released!
2 -
3 -== Purpose ==
4 -
5 -It is a Jupyter widget intended for visualization of the 3D data available for a patient:
6 -
7 -* surfaces of different types (cortex, face, skull, etc)
8 -* connectivity region centers
9 -* sensors locations (SEEG, MEG, EEG)
10 -
11 -== Inputs ==
12 -
13 -It supports the above data in the form of their corresponding TVB datatypes:
14 -
15 -* Surface (CorticalSurface, FaceSurface, etc)
16 -* Connectivity
17 -* Sensors (SensorsInternal, SensorsMEG, SensorsEEG)
18 -
19 -== Installation ==
20 -
21 -(% class="box" %)
22 -(((
23 -pip install tvb-widgets
24 -)))
25 -
26 -== API usage ==
27 -
28 -We need to first import the widget __API from tvbwidgets__// //package, together with the __TVB API __and the __display__ function:
29 -
30 -(% class="box" %)
31 -(((
32 -import tvbwidgets.api as api
33 -
34 -from tvb.simulator.lab import *
35 -
36 -from IPython.core.display_functions import display
37 -)))
38 -
39 -Then, we instantiate the **ThreeDWidget** and a **FaceSurface** datatype that we want to visualize. Using the //**add_datatype**// method we add the surface to our widget and __display__ the widget:
40 -
41 -(% class="box" %)
42 -(((
43 -widget_3d = api.ThreeDWidget()
44 -
45 -face = surfaces.FaceSurface().from_file()
46 -
47 -face.configure()
48 -
49 -widget_3d.add_datatype(face)
50 -display(widget_3d)
51 -)))
52 -
1 +TODO
2 +! pip install -i tvb-widgets
3 +from tvbwidgets.api import SurfaceWidget
4 +from IPython.core.display_functions import display
5 +w3d = SurfaceWidget(...)
6 +display(w3d)
7
53 53  {{html}}
54 -<iframe src="https://drive.google.com/file/d/1Egp9Lk-HGMATc9em6Kw_jSHmybTD2vzM/preview" width="840" height="480" allow="autoplay"></iframe>
9 +<iframe src=" https://drive.google.com/file/d/1PXsxLqydNDDORIK85cQaEgGt9QdWLcC7/preview" width="640" height="480" allow="autoplay"></iframe>
55 55  {{/html}}
56 -
57 -Next, we can continue adding other datatypes to this widget, by calling //**add_datatype**// multiple times. A maximum of 10 datatypes are supported by this widget.
58 -
59 -The **Config** object can be used to tweak the display options for each datatype.
60 -
61 -In the code below, we add a **Connectivity** and SEEG **Sensors:**
62 -
63 -(% class="box" %)
64 -(((
65 -conn = connectivity.Connectivity().from_file()
66 -
67 -conn.configure()
68 -
69 -widget_3d.add_datatype(conn)
70 -
71 -
72 -seeg = sensors.SensorsInternal().from_file()
73 -
74 -seeg.configure()
75 -
76 -widget_3d.add_datatype(seeg, api.Config(name='SEEG'))
77 -)))
78 -
79 -{{html}}
80 -<iframe src="https://drive.google.com/file/d/1vFqqzXle8VGcHaLB-OdE-6BdetK9aJ1T/preview" width="840" height="480" allow="autoplay"></iframe>
81 -{{/html}}
82 -
83 -We can also provide a **RegionMapping** to be used as colormap for a surface:
84 -
85 -(% class="box" %)
86 -(((
87 -reg_map = region_mapping.RegionMapping.from_file()
88 -
89 -config = api.Config(name='Cortex')
90 -
91 -config.add_region_mapping_as_cmap(reg_map)
92 -
93 -
94 -cortex = surfaces.CorticalSurface().from_file()
95 -
96 -cortex.configure()
97 -
98 -widget_3d.add_datatype(cortex, config)
99 -
100 -{{html}}
101 -<iframe src="https://drive.google.com/file/d/1z2yEuQWUT2Poxh63adYbBdhKPcWGskex/preview" width="840" height="480" allow="autoplay"></iframe>
102 -{{/html}}
103 -)))
Public

TVB Widgets