mm0.html 4.82 KB
Newer Older
Taylor Hanayik's avatar
Taylor Hanayik committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <title>oxford-mm-templates</title>
</head>

<body style="font-family: sans-serif;">
  <noscript>
    <strong>niivue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  </noscript>

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  <section style="margin: 20px;">
    <h2>
      Viewer Controls
    </h2>
    <p>
      <ul>
        <li>
          moving crossshair: left click and drag, or touch on mobile
        </li>
        <li>
          slice scrolling: mouse or touchpad scrolling up/down (not supported on mobile)
        </li>
        <li>
          selecting min/max intensity: right click and drag (not supported on mobile)
        </li>
        <li>
          zooming: in 3D mode, mouse or touchpad scrolling (not supported in 2D mode yet, not supported on mobile)
        </li>
      </ul>
    </p>
  </section>
Taylor Hanayik's avatar
Taylor Hanayik committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

  <!-- panel 4 -->
  <section>
    <h2 style="margin: 20px;">
      oxford-mm-0_T1_brain.nii.gz
    </h2>
  </section>
  <section style="margin: 20px;">
    <button onclick="toggleSliceType4()">2D/3D</button>
  </section>
  <section>
    <div id="demo4" style="width:90%; height:400px; margin:20px;">
      <canvas id="gl4" height=480 width=640>
      </canvas>
    </div>
  </section>

  <!-- panel 5 -->
  <section style="margin-top: 40px;">
    <h2 style="margin: 20px;">
      Oxford-MM-0/oxford-mm-0_T1_head.nii.gz
    </h2>
  </section>
  <section style="margin: 20px;">
    <button onclick="toggleSliceType5()">2D/3D</button>
  </section>
  <section>
    <div id="demo5" style="width:90%; height:400px; margin:20px;">
      <canvas id="gl5" height=480 width=640>
      </canvas>
    </div>
  </section>

  <!-- panel 6 -->
  <section style="margin-top: 40px;">
    <h2 style="margin: 20px;">
      Oxford-MM-0/oxford-mm-0_T2_FLAIR_head.nii.gz
    </h2>
  </section>
  <section style="margin: 20px;">
    <button onclick="toggleSliceType6()">2D/3D</button>
  </section>
  <section>
    <div id="demo6" style="width:90%; height:400px; margin:20px;">
      <canvas id="gl6" height=480 width=640>
      </canvas>
    </div>
  </section>

86
  <script src="https://unpkg.com/@niivue/niivue@0.8.1/dist/niivue.js"></script>
Taylor Hanayik's avatar
Taylor Hanayik committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  </script>

  <script>
    var volumeList4 = [
      // first item is brackground image
      {
        url: "./Oxford-MM-0/oxford-mm-0_T1_brain.nii.gz",
        volume: { hdr: null, img: null },
        name: "",
        intensityMin: 0, // not used yet
        intensityMax: 100, // not used yet
        intensityRange: [0, 100], // not used yet
        colorMap: "gray",
        opacity: 100,
        visible: true,
      },
    ]
104
    var nv4 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
105
    nv4.attachTo('gl4')
106
    nv4.isRadiologicalConvention = true
Taylor Hanayik's avatar
Taylor Hanayik committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    nv4.loadVolumes(volumeList4)
    nv4.setSliceType(nv4.sliceTypeMultiplanar)

  </script>

  <script>
    var volumeList5 = [
      // first item is brackground image
      {
        url: "./Oxford-MM-0/oxford-mm-0_T1_head.nii.gz",
        volume: { hdr: null, img: null },
        name: "",
        intensityMin: 0, // not used yet
        intensityMax: 100, // not used yet
        intensityRange: [0, 100], // not used yet
        colorMap: "gray",
        opacity: 100,
        visible: true,
      },
    ]
127
    var nv5 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
128
    nv5.attachTo('gl5')
129
    nv5.isRadiologicalConvention = true
Taylor Hanayik's avatar
Taylor Hanayik committed
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
    nv5.loadVolumes(volumeList5)
    nv5.setSliceType(nv5.sliceTypeMultiplanar)

  </script>

  <script>
    var volumeList6 = [
      // first item is brackground image
      {
        url: "./Oxford-MM-0/oxford-mm-0_T2_FLAIR_head.nii.gz",
        volume: { hdr: null, img: null },
        name: "",
        intensityMin: 0, // not used yet
        intensityMax: 100, // not used yet
        intensityRange: [0, 100], // not used yet
        colorMap: "gray",
        opacity: 100,
        visible: true,
      },
    ]
150
    var nv6 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
151
    nv6.attachTo('gl6')
152
    nv6.isRadiologicalConvention = true 
Taylor Hanayik's avatar
Taylor Hanayik committed
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
    nv6.loadVolumes(volumeList6)
    nv6.setSliceType(nv6.sliceTypeMultiplanar)

  </script>

  <script>
    
    function toggleSliceType4() {
      if (nv4.sliceType === nv4.sliceTypeRender) {
        nv4.setSliceType(nv4.sliceTypeMultiplanar)
      } else {
        nv4.setSliceType(nv4.sliceTypeRender)
      }
    }

    function toggleSliceType5() {
      if (nv5.sliceType === nv5.sliceTypeRender) {
        nv5.setSliceType(nv5.sliceTypeMultiplanar)
      } else {
        nv5.setSliceType(nv5.sliceTypeRender)
      }
    }

    function toggleSliceType6() {
      if (nv6.sliceType === nv6.sliceTypeRender) {
        nv6.setSliceType(nv6.sliceTypeMultiplanar)
      } else {
        nv6.setSliceType(nv6.sliceTypeRender)
      }
    }

  </script>
</body>

187
</html>