@niivue/niivue 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/niivue.es.js +6 -7
- package/dist/niivue.umd.js +1 -1
- package/package.json +7 -5
- package/src/niivue.js +279 -50
- package/src/nvimage.js +86 -6
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ NiiVue is a WebGL 2.0 medical image viewer. This repository contains the **core
|
|
|
4
4
|
|
|
5
5
|
The NiiVue package is intented to be used by individuals developing interactive web pages related to showing [nifti](https://nifti.nimh.nih.gov) images. NiiVue includes many mouse and keyboard interactions that enable browsing and manipulating images displayed in the canvas. This core package does not include a comprehensive user interface outside of the canvas (e.g. buttons, and other widgets). However, developers who wish to build custom user interfaces around the NiiVue canvas can manipulate the rendered images and change settings via the API. Our [web-based user interface implementation](https://github.com/niivue/niivue-ui) (under development) will demonstrate how to integrate NiiVue into a more comprehensive [VueJS](https://vuejs.org/) UI.
|
|
6
6
|
|
|
7
|
+
# Getting started Docs and References
|
|
8
|
+
|
|
9
|
+
[click here to go to the docs web page](https://niivue.github.io/niivue/devdocs/)
|
|
10
|
+
|
|
7
11
|
# Active Projects
|
|
8
12
|
|
|
9
13
|
[See our active projects here](https://github.com/orgs/niivue/projects)
|
|
@@ -34,7 +38,7 @@ We host many NiiVue examples via github pages. These are updated and deployed au
|
|
|
34
38
|
|
|
35
39
|
## existing html page
|
|
36
40
|
```html
|
|
37
|
-
<script src="https://unpkg.com/@niivue/niivue@0.12.
|
|
41
|
+
<script src="https://unpkg.com/@niivue/niivue@0.12.1/dist/niivue.js"></script>
|
|
38
42
|
|
|
39
43
|
<canvas id="gl" height=480 width=640></canvas>
|
|
40
44
|
|
package/dist/niivue.es.js
CHANGED
|
@@ -12283,7 +12283,7 @@ var defaultFontMetrics = {
|
|
|
12283
12283
|
glyphs,
|
|
12284
12284
|
kerning
|
|
12285
12285
|
};
|
|
12286
|
-
const Niivue = function(
|
|
12286
|
+
const Niivue = function(options = {}) {
|
|
12287
12287
|
this.opts = {};
|
|
12288
12288
|
this.defaults = {
|
|
12289
12289
|
textHeight: 0.03,
|
|
@@ -12294,8 +12294,6 @@ const Niivue = function(opts = {}) {
|
|
|
12294
12294
|
selectionBoxColor: [1, 1, 1, 0.5],
|
|
12295
12295
|
clipPlaneColor: [1, 1, 1, 0.5],
|
|
12296
12296
|
colorBarMargin: 0.05,
|
|
12297
|
-
briStep: 1,
|
|
12298
|
-
conStep: 1,
|
|
12299
12297
|
trustCalMinMax: true,
|
|
12300
12298
|
clipPlaneHotKey: "KeyC",
|
|
12301
12299
|
viewModeHotKey: "KeyV",
|
|
@@ -12379,7 +12377,7 @@ const Niivue = function(opts = {}) {
|
|
|
12379
12377
|
this.DISTANCE_FROM_CAMERA = -0.54;
|
|
12380
12378
|
this.initialized = false;
|
|
12381
12379
|
for (let prop in this.defaults) {
|
|
12382
|
-
this.opts[prop] =
|
|
12380
|
+
this.opts[prop] = options[prop] === void 0 ? this.defaults[prop] : options[prop];
|
|
12383
12381
|
}
|
|
12384
12382
|
this.eventsToSubjects = {
|
|
12385
12383
|
location: this.scene.location$
|
|
@@ -12823,11 +12821,11 @@ Niivue.prototype.sph2cartDeg = function sph2cartDeg(azimuth, elevation) {
|
|
|
12823
12821
|
ret[2] /= len;
|
|
12824
12822
|
return ret;
|
|
12825
12823
|
};
|
|
12826
|
-
Niivue.prototype.clipPlaneUpdate = function(
|
|
12824
|
+
Niivue.prototype.clipPlaneUpdate = function(azimuthElevation) {
|
|
12827
12825
|
if (this.sliceType != this.sliceTypeRender)
|
|
12828
12826
|
return;
|
|
12829
|
-
let v = this.sph2cartDeg(
|
|
12830
|
-
this.scene.clipPlane = [v[0], v[1], v[2],
|
|
12827
|
+
let v = this.sph2cartDeg(azimuthElevation[0], azimuthElevation[1]);
|
|
12828
|
+
this.scene.clipPlane = [v[0], v[1], v[2], azimuthElevation[2]];
|
|
12831
12829
|
this.drawScene();
|
|
12832
12830
|
};
|
|
12833
12831
|
Niivue.prototype.setCrosshairColor = function(color) {
|
|
@@ -12860,6 +12858,7 @@ Niivue.prototype.setScale = function(scale2) {
|
|
|
12860
12858
|
};
|
|
12861
12859
|
Niivue.prototype.setClipPlaneColor = function(color) {
|
|
12862
12860
|
this.opts.clipPlaneColor = color;
|
|
12861
|
+
this.drawScene();
|
|
12863
12862
|
};
|
|
12864
12863
|
Niivue.prototype.overlayRGBA = function(volume) {
|
|
12865
12864
|
let hdr = volume.hdr;
|