zincjs 1.19.1 → 1.19.3
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/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as nifti from 'nifti-reader-js';
|
|
2
|
-
|
|
2
|
+
import {
|
|
3
|
+
THREE,
|
|
4
|
+
TextureArray,
|
|
5
|
+
TextureSlides
|
|
6
|
+
} from "zincjs";
|
|
3
7
|
|
|
4
8
|
const defaultTextureSettings = {
|
|
5
9
|
"id": "mesh-location-orientation",
|
|
@@ -346,7 +350,7 @@ function getTransformationFromHeader(header, options) {
|
|
|
346
350
|
|
|
347
351
|
function createTextureArray(sources) {
|
|
348
352
|
if (sources?.data) {
|
|
349
|
-
const tArray = new
|
|
353
|
+
const tArray = new TextureArray();
|
|
350
354
|
tArray.impl = new THREE.DataTexture2DArray(
|
|
351
355
|
sources.data, sources.width, sources.height, sources.depth);
|
|
352
356
|
tArray.impl.anisotropy = 4;
|
|
@@ -364,7 +368,7 @@ function createTextureArray(sources) {
|
|
|
364
368
|
|
|
365
369
|
function createTexturePrimitives(niftiHeader, sources, useHeaderInfo, textureSettings, options) {
|
|
366
370
|
if (sources?.data) {
|
|
367
|
-
const newTexture = new
|
|
371
|
+
const newTexture = new TextureSlides();
|
|
368
372
|
const tArray = createTextureArray(sources);
|
|
369
373
|
if (tArray) {
|
|
370
374
|
newTexture.groupName = "Images";
|
|
@@ -445,9 +449,7 @@ async function createPrimitivesFromNIFTI(url, useHeaderInfo, maskURL, textureSet
|
|
|
445
449
|
}
|
|
446
450
|
if (timeEnabled && textureP) {
|
|
447
451
|
for (let i = 1; i < url.length; i++) {
|
|
448
|
-
console.log(i, url[i])
|
|
449
452
|
const tArray = await createTextureFromNIFTI(url[i], maskURL, optionsIn);
|
|
450
|
-
console.log(tArray)
|
|
451
453
|
textureP.addTextureArray(tArray);
|
|
452
454
|
}
|
|
453
455
|
textureP.timeEnabled = true;
|
|
@@ -47,7 +47,6 @@ const TexturePrimitive = function (textureIn) {
|
|
|
47
47
|
if (this.textureList.length === 0 && this.texture) {
|
|
48
48
|
this.textureList.push(this.texture);
|
|
49
49
|
}
|
|
50
|
-
console.log("addTextureArray", tArray)
|
|
51
50
|
if (tArray && tArray.isTextureArray) {
|
|
52
51
|
this.textureList.push(tArray);
|
|
53
52
|
}
|
|
@@ -415,7 +415,6 @@ const TextureSlides = function (textureIn) {
|
|
|
415
415
|
const t0 = Math.floor(iTime);
|
|
416
416
|
const t1 = Math.ceil(iTime);
|
|
417
417
|
const ratio = iTime - t0;
|
|
418
|
-
console.log("update", t0, t1, ratio)
|
|
419
418
|
this.morph.children.forEach((mesh) => {
|
|
420
419
|
const material = mesh.material;
|
|
421
420
|
if (material.type === "ShaderMaterial") {
|