@niivue/niivue 0.43.2 → 0.43.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/dist/index.d.ts CHANGED
@@ -681,6 +681,7 @@ type DocumentData = {
681
681
  meshesString?: string;
682
682
  sceneData?: SceneData;
683
683
  connectomes?: string[];
684
+ customData?: string;
684
685
  };
685
686
  type ExportDocumentData = {
686
687
  encodedImageBlobs: string[];
@@ -693,6 +694,7 @@ type ExportDocumentData = {
693
694
  meshesString: string;
694
695
  labels: NVLabel3D[];
695
696
  connectomes: string[];
697
+ customData: string;
696
698
  };
697
699
  /**
698
700
  * Creates and instance of NVDocument
@@ -752,6 +754,8 @@ declare class NVDocument {
752
754
  * Sets the 3D labels of the {@link Niivue} instance
753
755
  */
754
756
  set labels(labels: NVLabel3D[]);
757
+ get customData(): string | undefined;
758
+ set customData(data: string);
755
759
  /**
756
760
  * Checks if document has an image by id
757
761
  */
package/dist/index.js CHANGED
@@ -100669,7 +100669,7 @@ var forEach3 = function() {
100669
100669
  }();
100670
100670
 
100671
100671
  // package.json
100672
- var version = "0.43.2";
100672
+ var version = "0.43.3";
100673
100673
 
100674
100674
  // src/logger.ts
100675
100675
  var _Log = class _Log {
@@ -123311,7 +123311,7 @@ var NVImage = class _NVImage {
123311
123311
  */
123312
123312
  toUint8Array(drawingBytes = null) {
123313
123313
  const isDrawing = drawingBytes !== null;
123314
- const hdrBytes = hdrToArrayBuffer(this.hdr, isDrawing);
123314
+ const hdrBytes = hdrToArrayBuffer({ ...this.hdr, vox_offset: 352 }, isDrawing);
123315
123315
  let drawingBytesToBeConverted = drawingBytes;
123316
123316
  if (isDrawing) {
123317
123317
  const perm = this.permRAS;
@@ -123688,6 +123688,12 @@ var NVDocument = class _NVDocument {
123688
123688
  set labels(labels) {
123689
123689
  this.data.labels = labels;
123690
123690
  }
123691
+ get customData() {
123692
+ return this.data.customData;
123693
+ }
123694
+ set customData(data) {
123695
+ this.data.customData = data;
123696
+ }
123691
123697
  /**
123692
123698
  * Checks if document has an image by id
123693
123699
  */
@@ -123760,6 +123766,7 @@ var NVDocument = class _NVDocument {
123760
123766
  data.opts.meshThicknessOn2D = "infinity";
123761
123767
  }
123762
123768
  data.labels = [...this.data.labels];
123769
+ data.customData = this.customData;
123763
123770
  if (this.volumes.length) {
123764
123771
  let imageOptions = this.imageOptionsArray[0];
123765
123772
  if (!imageOptions) {
@@ -127946,6 +127953,14 @@ var Niivue = class _Niivue {
127946
127953
  }
127947
127954
  const image = NVImage.loadFromBase64({ base64: base642, ...imageOptions });
127948
127955
  if (image) {
127956
+ if (image.colormapLabel) {
127957
+ const length4 = Object.keys(image.colormapLabel.lut).length;
127958
+ const uint8ClampedArray = new Uint8ClampedArray(length4);
127959
+ for (const key2 in image.colormapLabel.lut) {
127960
+ uint8ClampedArray[key2] = image.colormapLabel.lut[key2];
127961
+ }
127962
+ image.colormapLabel.lut = uint8ClampedArray;
127963
+ }
127949
127964
  this.addVolume(image);
127950
127965
  }
127951
127966
  }