dwv 0.37.0-beta.20 → 0.37.0-beta.21
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/assets/workers/labeling.worker.min.js.map +1 -1
- package/dist/assets/workers/resampling.worker.min.js.map +1 -1
- package/dist/dwv.d.ts +159 -41
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/dist/dwv.node.min.js +1 -1
- package/dist/dwv.node.min.js.map +1 -1
- package/package.json +5 -3
package/dist/dwv.d.ts
CHANGED
|
@@ -11,8 +11,7 @@ import Konva from 'konva';
|
|
|
11
11
|
export declare function addTagsToDictionary(group: string, tags: Record<string, string[]>): void;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @import {
|
|
15
|
-
* @import {NumberValue} from '../math/number.js';
|
|
14
|
+
* @import {NumberValue} from '../math/types.js';
|
|
16
15
|
* @import {ViewController} from '../app/viewController.js';
|
|
17
16
|
* @import {PlaneHelper} from './planeHelper.js';
|
|
18
17
|
* @import {DicomCode} from '../dicom/dicomCode.js';
|
|
@@ -1725,7 +1724,7 @@ export declare function demoCreateView(elements: Record<string, DataElement>, im
|
|
|
1725
1724
|
|
|
1726
1725
|
/**
|
|
1727
1726
|
* @import {Point} from '../math/point.js';
|
|
1728
|
-
* @import {NumberValue} from '../math/
|
|
1727
|
+
* @import {NumberValue} from '../math/types.js';
|
|
1729
1728
|
*/
|
|
1730
1729
|
/**
|
|
1731
1730
|
* Diameter type.
|
|
@@ -2789,9 +2788,10 @@ export declare class Geometry {
|
|
|
2789
2788
|
* @param {Spacing} spacing The object spacing.
|
|
2790
2789
|
* @param {Matrix33} [orientation] The object orientation (3*3 matrix,
|
|
2791
2790
|
* default to 3*3 identity).
|
|
2792
|
-
* @param {
|
|
2791
|
+
* @param {SourcedNumberValue} [time] Optional time: a volume id or, without
|
|
2792
|
+
* source, a frame index (for example `{value: 2}`).
|
|
2793
2793
|
*/
|
|
2794
|
-
constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?:
|
|
2794
|
+
constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?: SourcedNumberValue);
|
|
2795
2795
|
/**
|
|
2796
2796
|
* Clone the geometry.
|
|
2797
2797
|
*
|
|
@@ -2799,17 +2799,42 @@ export declare class Geometry {
|
|
|
2799
2799
|
*/
|
|
2800
2800
|
clone(): Geometry;
|
|
2801
2801
|
/**
|
|
2802
|
-
* Get the time
|
|
2802
|
+
* Get the time that was passed at construction.
|
|
2803
2803
|
*
|
|
2804
|
-
* @returns {
|
|
2804
|
+
* @returns {SourcedNumberValue|undefined} The time.
|
|
2805
2805
|
*/
|
|
2806
|
-
getInitialTime():
|
|
2806
|
+
getInitialTime(): SourcedNumberValue | undefined;
|
|
2807
2807
|
/**
|
|
2808
2808
|
* Set the initial time.
|
|
2809
2809
|
*
|
|
2810
|
-
* @param {
|
|
2810
|
+
* @param {SourcedNumberValue} time The new time: a volume id or, without
|
|
2811
|
+
* source, a frame index.
|
|
2812
|
+
*/
|
|
2813
|
+
setInitialTime(time: SourcedNumberValue): void;
|
|
2814
|
+
/**
|
|
2815
|
+
* Get the volume ids: the time of each volume, sorted by ascending
|
|
2816
|
+
* value, the array index being the volume index. Times are volume
|
|
2817
|
+
* ids if they have a source.
|
|
2818
|
+
*
|
|
2819
|
+
* @returns {SourcedNumberValue[]|undefined} The volume ids, undefined if the
|
|
2820
|
+
* times are not volume ids.
|
|
2811
2821
|
*/
|
|
2812
|
-
|
|
2822
|
+
getVolumeIds(): SourcedNumberValue[] | undefined;
|
|
2823
|
+
/**
|
|
2824
|
+
* Set the volume ids of a geometry without times (for example a
|
|
2825
|
+
* resampled one): the volumes all have the current origins.
|
|
2826
|
+
*
|
|
2827
|
+
* @param {SourcedNumberValue[]} volumeIds The volume ids, sorted by ascending
|
|
2828
|
+
* value, one per volume (fourth dimension).
|
|
2829
|
+
*/
|
|
2830
|
+
setVolumeIds(volumeIds: SourcedNumberValue[]): void;
|
|
2831
|
+
/**
|
|
2832
|
+
* Get the index of a volume id value.
|
|
2833
|
+
*
|
|
2834
|
+
* @param {number} value The volume id value.
|
|
2835
|
+
* @returns {number} The volume index, -1 if not found.
|
|
2836
|
+
*/
|
|
2837
|
+
getVolumeIndex(value: number): number;
|
|
2813
2838
|
/**
|
|
2814
2839
|
* Get the total number of slices.
|
|
2815
2840
|
* Can be different from what is stored in the size object
|
|
@@ -2821,7 +2846,7 @@ export declare class Geometry {
|
|
|
2821
2846
|
/**
|
|
2822
2847
|
* Check if a time point has associated slices.
|
|
2823
2848
|
*
|
|
2824
|
-
* @param {number} time The time
|
|
2849
|
+
* @param {number} time The time value to check.
|
|
2825
2850
|
* @returns {boolean} True if slices are present.
|
|
2826
2851
|
*/
|
|
2827
2852
|
hasSlicesAtTime(time: number): boolean;
|
|
@@ -2829,10 +2854,19 @@ export declare class Geometry {
|
|
|
2829
2854
|
* Get the number of slices stored for time points preceding
|
|
2830
2855
|
* the input one.
|
|
2831
2856
|
*
|
|
2832
|
-
* @param {number} time The time
|
|
2857
|
+
* @param {number} time The time value to check.
|
|
2833
2858
|
* @returns {number|undefined} The count.
|
|
2834
2859
|
*/
|
|
2835
2860
|
getCurrentNumberOfSlicesBeforeTime(time: number): number | undefined;
|
|
2861
|
+
/**
|
|
2862
|
+
* Check that all time points have the same origins as the
|
|
2863
|
+
* initial time point (same number and same values in the
|
|
2864
|
+
* same order).
|
|
2865
|
+
*
|
|
2866
|
+
* @returns {BooleanResult} Result with success set to true if
|
|
2867
|
+
* the time origins are consistent.
|
|
2868
|
+
*/
|
|
2869
|
+
checkTimeOrigins(): BooleanResult;
|
|
2836
2870
|
/**
|
|
2837
2871
|
* Get the object origin.
|
|
2838
2872
|
* This should be the lowest origin to ease calculations (?).
|
|
@@ -2918,7 +2952,7 @@ export declare class Geometry {
|
|
|
2918
2952
|
* Point3D#getClosest) instead for that case.
|
|
2919
2953
|
*
|
|
2920
2954
|
* @param {Point3D} origin The origin to locate.
|
|
2921
|
-
* @param {number} [time] Optional time
|
|
2955
|
+
* @param {number} [time] Optional time value.
|
|
2922
2956
|
* @returns {number} The slice index.
|
|
2923
2957
|
*/
|
|
2924
2958
|
getSliceIndex(origin: Point3D, time?: number): number;
|
|
@@ -2935,7 +2969,7 @@ export declare class Geometry {
|
|
|
2935
2969
|
* Check if an origin can be appended to this geometry.
|
|
2936
2970
|
*
|
|
2937
2971
|
* @param {Point3D} origin The origin to append.
|
|
2938
|
-
* @param {number} [time] Optional time
|
|
2972
|
+
* @param {number} [time] Optional time value.
|
|
2939
2973
|
* @returns {BooleanResult} Result with success set to true if
|
|
2940
2974
|
* the origin is compatible.
|
|
2941
2975
|
*/
|
|
@@ -2945,16 +2979,17 @@ export declare class Geometry {
|
|
|
2945
2979
|
*
|
|
2946
2980
|
* @param {Point3D} origin The origin to append.
|
|
2947
2981
|
* @param {number} index The index at which to append.
|
|
2948
|
-
* @param {number} [time] Optional time
|
|
2982
|
+
* @param {number} [time] Optional time value.
|
|
2949
2983
|
*/
|
|
2950
2984
|
appendOrigin(origin: Point3D, index: number, time?: number): void;
|
|
2951
2985
|
/**
|
|
2952
2986
|
* Append a frame to the geometry.
|
|
2953
2987
|
*
|
|
2954
2988
|
* @param {Point3D} origin The origin to append.
|
|
2955
|
-
* @param {
|
|
2989
|
+
* @param {SourcedNumberValue} time The frame time: a volume id or, without
|
|
2990
|
+
* source, a frame index.
|
|
2956
2991
|
*/
|
|
2957
|
-
appendFrame(origin: Point3D, time:
|
|
2992
|
+
appendFrame(origin: Point3D, time: SourcedNumberValue): void;
|
|
2958
2993
|
/**
|
|
2959
2994
|
* Get a string representation of the geometry.
|
|
2960
2995
|
*
|
|
@@ -3094,7 +3129,7 @@ export declare function getDicomTagGroupName(tag: Tag): string | undefined;
|
|
|
3094
3129
|
export declare function getDicomTagInfo(tag: Tag): TagInfo | undefined;
|
|
3095
3130
|
|
|
3096
3131
|
/**
|
|
3097
|
-
* @import {IntTypedArray, TypedArray} from '../math/
|
|
3132
|
+
* @import {IntTypedArray, TypedArray} from '../math/types.js';
|
|
3098
3133
|
*/
|
|
3099
3134
|
/**
|
|
3100
3135
|
* List of DICOM data elements indexed via a 8 character string formed from
|
|
@@ -3722,10 +3757,11 @@ declare class Image_2 extends EventTarget {
|
|
|
3722
3757
|
/**
|
|
3723
3758
|
* Append a frame to the image.
|
|
3724
3759
|
*
|
|
3725
|
-
* @param {
|
|
3760
|
+
* @param {SourcedNumberValue} time The frame time: a volume id or, without
|
|
3761
|
+
* source, a frame index.
|
|
3726
3762
|
* @param {Point3D} origin The origin of the frame.
|
|
3727
3763
|
*/
|
|
3728
|
-
appendFrame(time:
|
|
3764
|
+
appendFrame(time: SourcedNumberValue, origin: Point3D): void;
|
|
3729
3765
|
/**
|
|
3730
3766
|
* Get the data range.
|
|
3731
3767
|
*
|
|
@@ -3790,6 +3826,17 @@ declare class Image_2 extends EventTarget {
|
|
|
3790
3826
|
* Warning: No size check...
|
|
3791
3827
|
*/
|
|
3792
3828
|
getRescaledValueAtOffset(offset: number): number;
|
|
3829
|
+
/**
|
|
3830
|
+
* Get the rescaled values of all volumes (fourth dimension) at
|
|
3831
|
+
* a position.
|
|
3832
|
+
*
|
|
3833
|
+
* @param {Point} position The world position, only its first
|
|
3834
|
+
* three dimensions are used.
|
|
3835
|
+
* @returns {VolumeValue[]} The values with their unit and volume id,
|
|
3836
|
+
* ordered by volume index, empty if the position is out of bounds
|
|
3837
|
+
* or if the image cannot be quantified (more than one component).
|
|
3838
|
+
*/
|
|
3839
|
+
getRescaledValuesAtPosition(position: Point): VolumeValue[];
|
|
3793
3840
|
/**
|
|
3794
3841
|
* Calculate the data range of the image.
|
|
3795
3842
|
* WARNING: for speed reasons, only calculated on the first frame...
|
|
@@ -4265,6 +4312,20 @@ export declare class Label {
|
|
|
4265
4312
|
maxZ: number;
|
|
4266
4313
|
}
|
|
4267
4314
|
|
|
4315
|
+
/**
|
|
4316
|
+
* Histogram of the segment voxels of a label.
|
|
4317
|
+
*/
|
|
4318
|
+
export declare type LabelHistogram = {
|
|
4319
|
+
/**
|
|
4320
|
+
* The label.
|
|
4321
|
+
*/
|
|
4322
|
+
label: Label;
|
|
4323
|
+
/**
|
|
4324
|
+
* The label histogram.
|
|
4325
|
+
*/
|
|
4326
|
+
histogram: ImageHistogram;
|
|
4327
|
+
};
|
|
4328
|
+
|
|
4268
4329
|
/**
|
|
4269
4330
|
* CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
|
|
4270
4331
|
* unsigned int CIE LAB ([0, 65535]).
|
|
@@ -4910,18 +4971,9 @@ export declare class MaskImage extends Image_2 {
|
|
|
4910
4971
|
* @param {Image} image The reference image (intensities).
|
|
4911
4972
|
* @param {string} segmentId Segment tracking UID, or segment number as
|
|
4912
4973
|
* string.
|
|
4913
|
-
* @returns {
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
*/
|
|
4917
|
-
getHistogramBySegment(image: Image_2, segmentId: string): {
|
|
4918
|
-
volume: number;
|
|
4919
|
-
histogram: ImageHistogram;
|
|
4920
|
-
labelHistograms?: {
|
|
4921
|
-
label: Label;
|
|
4922
|
-
histogram: ImageHistogram;
|
|
4923
|
-
}[];
|
|
4924
|
-
}[];
|
|
4974
|
+
* @returns {SegmentHistogram[]} One entry per volume.
|
|
4975
|
+
*/
|
|
4976
|
+
getHistogramBySegment(image: Image_2, segmentId: string): SegmentHistogram[];
|
|
4925
4977
|
#private;
|
|
4926
4978
|
}
|
|
4927
4979
|
|
|
@@ -5175,7 +5227,7 @@ export declare class MaskSegmentViewHelper {
|
|
|
5175
5227
|
}
|
|
5176
5228
|
|
|
5177
5229
|
/**
|
|
5178
|
-
* @import {TypedArray} from './
|
|
5230
|
+
* @import {TypedArray} from './types.js';
|
|
5179
5231
|
*/
|
|
5180
5232
|
/**
|
|
5181
5233
|
* Immutable 3x3 Matrix.
|
|
@@ -5360,18 +5412,20 @@ export declare class NumberRange {
|
|
|
5360
5412
|
}
|
|
5361
5413
|
|
|
5362
5414
|
/**
|
|
5363
|
-
*
|
|
5415
|
+
* Number value and its unit.
|
|
5364
5416
|
*/
|
|
5365
|
-
export declare
|
|
5417
|
+
export declare type NumberValue = {
|
|
5366
5418
|
/**
|
|
5367
|
-
*
|
|
5419
|
+
* The value.
|
|
5368
5420
|
*/
|
|
5369
5421
|
value: number;
|
|
5370
5422
|
/**
|
|
5371
|
-
*
|
|
5423
|
+
* The value unit, passed to `i18n.t` for
|
|
5424
|
+
* display: an i18n key (for example 'unit.mm') or a plain unit
|
|
5425
|
+
* (for example 'HU').
|
|
5372
5426
|
*/
|
|
5373
|
-
unit
|
|
5374
|
-
}
|
|
5427
|
+
unit?: string;
|
|
5428
|
+
};
|
|
5375
5429
|
|
|
5376
5430
|
export declare namespace Orientation {
|
|
5377
5431
|
let Axial: string;
|
|
@@ -5956,7 +6010,7 @@ export declare type PrivateBValueRule = {
|
|
|
5956
6010
|
|
|
5957
6011
|
/**
|
|
5958
6012
|
* @import {Point2D} from '../math/point.js';
|
|
5959
|
-
* @import {NumberValue} from './
|
|
6013
|
+
* @import {NumberValue} from './types.js';
|
|
5960
6014
|
* @import {ViewController} from '../app/viewController.js';
|
|
5961
6015
|
*/
|
|
5962
6016
|
/**
|
|
@@ -6607,6 +6661,25 @@ export declare class SegmentCollection {
|
|
|
6607
6661
|
#private;
|
|
6608
6662
|
}
|
|
6609
6663
|
|
|
6664
|
+
/**
|
|
6665
|
+
* Histogram of the voxels of a segment for one volume.
|
|
6666
|
+
*/
|
|
6667
|
+
export declare type SegmentHistogram = {
|
|
6668
|
+
/**
|
|
6669
|
+
* The volume index.
|
|
6670
|
+
*/
|
|
6671
|
+
volume: number;
|
|
6672
|
+
/**
|
|
6673
|
+
* The segment histogram.
|
|
6674
|
+
*/
|
|
6675
|
+
histogram: ImageHistogram;
|
|
6676
|
+
/**
|
|
6677
|
+
* One histogram per label
|
|
6678
|
+
* of the segment, if available.
|
|
6679
|
+
*/
|
|
6680
|
+
labelHistograms?: LabelHistogram[];
|
|
6681
|
+
};
|
|
6682
|
+
|
|
6610
6683
|
/**
|
|
6611
6684
|
* A simple sequence (VR=SQ) tag value.
|
|
6612
6685
|
*/
|
|
@@ -6781,6 +6854,20 @@ export declare class Size {
|
|
|
6781
6854
|
#private;
|
|
6782
6855
|
}
|
|
6783
6856
|
|
|
6857
|
+
/**
|
|
6858
|
+
* Number value with its source, as for example a volume id: the value
|
|
6859
|
+
* of the volume (fourth dimension) index, for example
|
|
6860
|
+
* `{source: 'EchoTime', value: 4.6, tagKey: '00180081', unit: 'unit.ms'}`.
|
|
6861
|
+
* A number value with:
|
|
6862
|
+
* - source: the name of the value source, for example the volume id
|
|
6863
|
+
* candidate that produced it,
|
|
6864
|
+
* - tagKey: the key of the DICOM tag the value is read from.
|
|
6865
|
+
*/
|
|
6866
|
+
export declare type SourcedNumberValue = NumberValue & {
|
|
6867
|
+
source?: string;
|
|
6868
|
+
tagKey?: string;
|
|
6869
|
+
};
|
|
6870
|
+
|
|
6784
6871
|
/**
|
|
6785
6872
|
* @import {Scalar2D} from '../math/scalar.js';
|
|
6786
6873
|
*/
|
|
@@ -8336,6 +8423,13 @@ export declare class ViewController {
|
|
|
8336
8423
|
* @returns {Index} The index.
|
|
8337
8424
|
*/
|
|
8338
8425
|
getIndexFromPosition(point: Point): Index;
|
|
8426
|
+
/**
|
|
8427
|
+
* Get the world position of an index.
|
|
8428
|
+
*
|
|
8429
|
+
* @param {Index} index The index.
|
|
8430
|
+
* @returns {Point} The position.
|
|
8431
|
+
*/
|
|
8432
|
+
getPositionFromIndex(index: Index): Point;
|
|
8339
8433
|
/**
|
|
8340
8434
|
* Set the current index.
|
|
8341
8435
|
*
|
|
@@ -8828,7 +8922,9 @@ export declare type VolumeIdCandidate = {
|
|
|
8828
8922
|
*/
|
|
8829
8923
|
name: string;
|
|
8830
8924
|
/**
|
|
8831
|
-
* The volume id getter
|
|
8925
|
+
* The volume id getter:
|
|
8926
|
+
* `(elements) => SourcedNumberValue|undefined`, the returned volume id
|
|
8927
|
+
* does not need a source (the candidate name is used).
|
|
8832
8928
|
*/
|
|
8833
8929
|
getter: Function;
|
|
8834
8930
|
/**
|
|
@@ -8836,6 +8932,28 @@ export declare type VolumeIdCandidate = {
|
|
|
8836
8932
|
* while loading.
|
|
8837
8933
|
*/
|
|
8838
8934
|
preLoad?: boolean;
|
|
8935
|
+
/**
|
|
8936
|
+
* Flag to make the volume id values
|
|
8937
|
+
* relative to the smallest one, for example to get times since
|
|
8938
|
+
* the first acquisition instead of timestamps. Not applied while
|
|
8939
|
+
* loading.
|
|
8940
|
+
*/
|
|
8941
|
+
relative?: boolean;
|
|
8942
|
+
};
|
|
8943
|
+
|
|
8944
|
+
/**
|
|
8945
|
+
* Pixel value of one volume.
|
|
8946
|
+
*/
|
|
8947
|
+
export declare type VolumeValue = {
|
|
8948
|
+
/**
|
|
8949
|
+
* The volume id: with name and unit
|
|
8950
|
+
* if the image has volume ids, else just the volume index.
|
|
8951
|
+
*/
|
|
8952
|
+
volumeId: SourcedNumberValue;
|
|
8953
|
+
/**
|
|
8954
|
+
* The rescaled pixel value and its unit.
|
|
8955
|
+
*/
|
|
8956
|
+
pixValue: NumberValue;
|
|
8839
8957
|
};
|
|
8840
8958
|
|
|
8841
8959
|
/**
|