mm1.html 4.85 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 1 -->
  <section>
    <h2 style="margin: 20px;">
      Oxford-MM-1/oxford-mm-1_T1_brain.nii.gz
    </h2>
  </section>
  <section style="margin: 20px;">
    <button onclick="toggleSliceType1()">2D/3D</button>
  </section>
  <section>
    <div id="demo1" style="width:90%; height:400px; margin:20px;">
      <canvas id="gl1" height=480 width=640>
      </canvas>
    </div>
  </section>

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

  <!-- panel 3 -->
  <section style="margin-top: 40px;">
    <h2 style="margin: 20px;">
      Oxford-MM-1/oxford-mm-1_T2_FLAIR_head.nii.gz
    </h2>
  </section>
  <section style="margin: 20px;">
    <button onclick="toggleSliceType3()">2D/3D</button>
  </section>
  <section>
    <div id="demo3" style="width:90%; height:400px; margin:20px;">
      <canvas id="gl3" 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
  </script>
  <script>
    var volumeList1 = [
      {
        url: "./Oxford-MM-1/oxford-mm-1_T1_brain.nii.gz",
        //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,
      }
    ]
103
    var nv1 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
104
    nv1.attachTo('gl1')
105
    nv1.isRadiologicalConvention = true
Taylor Hanayik's avatar
Taylor Hanayik committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
    nv1.loadVolumes(volumeList1)
    nv1.setSliceType(nv1.sliceTypeMultiplanar)
  </script>

  <script>
    var volumeList2 = [
      // first item is brackground image
      {
        url: "./Oxford-MM-1/oxford-mm-1_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,
      },
    ]
125
    var nv2 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
126
    nv2.attachTo('gl2')
127
    nv2.isRadiologicalConvention = true
Taylor Hanayik's avatar
Taylor Hanayik committed
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
    nv2.loadVolumes(volumeList2)
    nv2.setSliceType(nv2.sliceTypeMultiplanar)
  </script>

  <script>
    var volumeList3 = [
      // first item is brackground image
      {
        url: "./Oxford-MM-1/oxford-mm-1_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,
      },
    ]
147
    var nv3 = new niivue.Niivue({trustCalMinMax:false})
Taylor Hanayik's avatar
Taylor Hanayik committed
148
    nv3.attachTo('gl3')
149
    nv3.isRadiologicalConvention = true
Taylor Hanayik's avatar
Taylor Hanayik committed
150
151
152
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
    nv3.loadVolumes(volumeList3)
    nv3.setSliceType(nv3.sliceTypeMultiplanar)

  </script>

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

    function toggleSliceType2() {
      if (nv2.sliceType === nv2.sliceTypeRender) {
        nv2.setSliceType(nv2.sliceTypeMultiplanar)
      } else {
        nv2.setSliceType(nv2.sliceTypeRender)
      }
    }

    function toggleSliceType3() {
      if (nv3.sliceType === nv3.sliceTypeRender) {
        nv3.setSliceType(nv3.sliceTypeMultiplanar)
      } else {
        nv3.setSliceType(nv3.sliceTypeRender)
      }
    }
  </script>
</body>

182
</html>