forked from PantelisGeorgiadis/dcmjs-imaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
238 lines (202 loc) · 4.53 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
import log from 'loglevel';
declare namespace StandardColorPalette {
const Grayscale: number;
const HotIron: number;
const Pet: number;
const HotMetalBlue: number;
const Pet20Step: number;
}
declare namespace TransferSyntax {
const ImplicitVRLittleEndian: string;
const ExplicitVRLittleEndian: string;
const DeflatedExplicitVRLittleEndian: string;
const ExplicitVRBigEndian: string;
const RleLossless: string;
const JpegBaselineProcess1: string;
const JpegBaselineProcess2_4: string;
const JpegLosslessProcess14: string;
const JpegLosslessProcess14V1: string;
const JpegLsLossless: string;
const JpegLsLossy: string;
const Jpeg2000Lossless: string;
const Jpeg2000Lossy: string;
const HtJpeg2000Lossless: string;
const HtJpeg2000LosslessRpcl: string;
const HtJpeg2000Lossy: string;
}
declare class Histogram {
/**
* Creates an instance of Histogram.
*/
constructor(identifier: string, min: number, max: number);
/**
* Gets histogram identifier.
*/
getIdentifier(): string;
/**
* Gets minimum value.
*/
getMinimum(): number;
/**
* Gets maximum value.
*/
getMaximum(): number;
/**
* Increments histogram at bin position.
*/
add(bin: number): void;
/**
* Resets histogram at bin position.
*/
clear(bin: number): void;
/**
* Gets the value count at histogram bin.
*/
get(bin: number): number | undefined;
/**
* Gets the histogram description.
*/
toString(): string;
}
declare class WindowLevel {
/**
* Creates an instance of WindowLevel.
*/
constructor(window: number, level: number, description?: string);
/**
* Gets window value.
*/
getWindow(): number;
/**
* Sets window value.
*/
setWindow(value: number): void;
/**
* Gets level value.
*/
getLevel(): number;
/**
* Sets level value.
*/
setLevel(value: number): void;
/**
* Gets description.
*/
getDescription(): string | undefined;
/**
* Sets description.
*/
setDescription(description: string): void;
/**
* Creates an array of window/level objects based on the image elements.
*/
static fromDicomImageElements(elements: Record<string, unknown>): Array<WindowLevel>;
/**
* Gets the window/level description.
*/
toString(): string;
}
declare class NativePixelDecoder {
/**
* Initializes native pixel decoder.
*/
static initializeAsync(opts?: {
webAssemblyModulePathOrUrl?: string;
logNativeDecodersMessages?: boolean;
}): Promise<void>;
}
declare class DicomImage {
/**
* Creates an instance of DicomImage.
*/
constructor(
elementsOrBuffer?: Record<string, unknown> | ArrayBuffer,
transferSyntaxUid?: string,
opts?: {
pixelPipelineCacheSize?: number;
lutPipelineCacheSize?: number;
}
);
/**
* Gets element value.
*/
getElement(tag: string): string | undefined;
/**
* Sets element value.
*/
setElement(tag: string, value: string): void;
/**
* Gets all elements.
*/
getElements(): Record<string, unknown>;
/**
* Gets DICOM transfer syntax UID.
*/
getTransferSyntaxUid(): string;
/**
* Sets DICOM transfer syntax UID.
*/
setTransferSyntaxUid(transferSyntaxUid: string): void;
/**
* Gets elements encoded in a DICOM dataset buffer.
*/
getDenaturalizedDataset(
writeOptions?: Record<string, unknown>,
nameMap?: Record<string, unknown>
): ArrayBuffer;
/**
* Gets the image width.
*/
getWidth(): number;
/**
* Gets the image height.
*/
getHeight(): number;
/**
* Gets the number of frames.
*/
getNumberOfFrames(): number;
/**
* Renders the image.
*/
render(opts?: {
frame?: number;
windowLevel?: WindowLevel;
renderOverlays?: boolean;
calculateHistograms?: boolean;
colorPalette?: number;
}): {
frame: number;
width: number;
height: number;
pixels: ArrayBuffer;
windowLevel?: WindowLevel;
histograms?: Array<Histogram>;
colorPalette?: number;
};
/**
* Renders the icon image located within an icon image sequence, if exists.
*/
renderIcon(): {
frame: number;
width: number;
height: number;
pixels: ArrayBuffer;
windowLevel?: WindowLevel;
histograms?: Array<Histogram>;
colorPalette?: number;
};
/**
* Gets the image description.
*/
toString(): string;
}
/**
* Version.
*/
declare const version: string;
export namespace constants {
export { StandardColorPalette };
export { TransferSyntax };
}
export { DicomImage, NativePixelDecoder, WindowLevel, Histogram, log, version };