@niivue/niivue 0.59.0 → 0.61.0

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/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { mat4, vec3, vec4, vec2 } from 'gl-matrix';
2
- import { NIFTI1, NIFTI2 } from 'nifti-reader-js';
2
+ import { NIFTI1, NIFTI2, NIFTIEXTENSION } from 'nifti-reader-js';
3
3
 
4
4
  type ColorMap = {
5
5
  R: number[];
@@ -341,6 +341,7 @@ declare class NVImage {
341
341
  extentsMaxOrtho?: number[];
342
342
  mm2ortho?: mat4;
343
343
  hdr: NIFTI1 | NIFTI2 | null;
344
+ extensions?: NIFTIEXTENSION[];
344
345
  imageType?: ImageType;
345
346
  img?: TypedVoxelArray;
346
347
  imaginary?: Float32Array;
@@ -597,7 +598,8 @@ declare enum DRAG_MODE {
597
598
  pan = 3,
598
599
  slicer3D = 4,
599
600
  callbackOnly = 5,
600
- roiSelection = 6
601
+ roiSelection = 6,
602
+ angle = 7
601
603
  }
602
604
  declare enum DRAG_MODE_SECONDARY {
603
605
  none = 0,
@@ -606,7 +608,8 @@ declare enum DRAG_MODE_SECONDARY {
606
608
  pan = 3,
607
609
  slicer3D = 4,
608
610
  callbackOnly = 5,
609
- roiSelection = 6
611
+ roiSelection = 6,
612
+ angle = 7
610
613
  }
611
614
  declare enum DRAG_MODE_PRIMARY {
612
615
  crosshair = 0,
@@ -1568,6 +1571,8 @@ type UIData = {
1568
1571
  max3D?: number;
1569
1572
  windowX: number;
1570
1573
  windowY: number;
1574
+ angleFirstLine: number[];
1575
+ angleState: 'none' | 'drawing_first_line' | 'drawing_second_line' | 'complete';
1571
1576
  };
1572
1577
  type SaveImageOptions = {
1573
1578
  filename: string;
@@ -1720,6 +1725,7 @@ declare class Niivue {
1720
1725
  dragModes: {
1721
1726
  contrast: DRAG_MODE;
1722
1727
  measurement: DRAG_MODE;
1728
+ angle: DRAG_MODE;
1723
1729
  none: DRAG_MODE;
1724
1730
  pan: DRAG_MODE;
1725
1731
  slicer3D: DRAG_MODE;
@@ -3696,7 +3702,32 @@ declare class Niivue {
3696
3702
  * Draw a measurement line with end caps and length text on a 2D tile.
3697
3703
  * @internal
3698
3704
  */
3699
- drawMeasurementTool(startXYendXY: number[]): void;
3705
+ drawMeasurementTool(startXYendXY: number[], isDrawText?: boolean): void;
3706
+ /**
3707
+ * Draw angle measurement tool with two lines and angle display.
3708
+ * @internal
3709
+ */
3710
+ drawAngleMeasurementTool(): void;
3711
+ /**
3712
+ * Calculate and draw angle text at the intersection of two lines.
3713
+ * @internal
3714
+ */
3715
+ drawAngleText(): void;
3716
+ /**
3717
+ * Calculate angle between two lines in degrees.
3718
+ * @internal
3719
+ */
3720
+ calculateAngleBetweenLines(line1: number[], line2: number[]): number;
3721
+ /**
3722
+ * Reset the angle measurement state.
3723
+ * @internal
3724
+ */
3725
+ resetAngleMeasurement(): void;
3726
+ /**
3727
+ * Set the drag mode for mouse interactions.
3728
+ * @param mode - The drag mode to set ('none', 'contrast', 'measurement', 'angle', 'pan', 'slicer3D', 'callbackOnly', 'roiSelection')
3729
+ */
3730
+ setDragMode(mode: string | DRAG_MODE): void;
3700
3731
  /**
3701
3732
  * Draw a rectangle or outline at given position with specified color or default crosshair color.
3702
3733
  * @internal