dwv 0.35.0 → 0.35.1

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/dwv.d.ts CHANGED
@@ -396,12 +396,13 @@ export declare class AnnotationGroupFactory {
396
396
  * Main application class.
397
397
  *
398
398
  * @example
399
+ * import {App, AppOptions, ViewConfig} from '//esm.sh/dwv';
399
400
  * // create the dwv app
400
- * const app = new dwv.App();
401
+ * const app = new App();
401
402
  * // initialise
402
- * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
403
+ * const viewConfig0 = new ViewConfig('layerGroup0');
403
404
  * const viewConfigs = {'*': [viewConfig0]};
404
- * const options = new dwv.AppOptions(viewConfigs);
405
+ * const options = new AppOptions(viewConfigs);
405
406
  * app.init(options);
406
407
  * // load dicom data
407
408
  * app.loadURLs([
@@ -592,12 +593,13 @@ export declare class App {
592
593
  *
593
594
  * @param {AppOptions} opt The application options.
594
595
  * @example
596
+ * import {App, AppOptions, ViewConfig} from '//esm.sh/dwv';
595
597
  * // create the dwv app
596
- * const app = new dwv.App();
598
+ * const app = new App();
597
599
  * // initialise
598
- * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
600
+ * const viewConfig0 = new ViewConfig('layerGroup0');
599
601
  * const viewConfigs = {'*': [viewConfig0]};
600
- * const options = new dwv.AppOptions(viewConfigs);
602
+ * const options = new AppOptions(viewConfigs);
601
603
  * options.viewOnFirstLoadItem = false;
602
604
  * app.init(options);
603
605
  * // render button
@@ -1482,10 +1484,11 @@ export declare class DicomData {
1482
1484
  * DicomParser class.
1483
1485
  *
1484
1486
  * @example
1487
+ * import {DicomParser} from '//esm.sh/dwv';
1485
1488
  * // XMLHttpRequest onload callback
1486
1489
  * const onload = function (event) {
1487
1490
  * // setup the dicom parser
1488
- * const dicomParser = new dwv.DicomParser();
1491
+ * const dicomParser = new DicomParser();
1489
1492
  * // parse the buffer
1490
1493
  * dicomParser.parse(event.target.response);
1491
1494
  * // get the dicom tags
@@ -1611,6 +1614,7 @@ export declare class DicomSRContent {
1611
1614
  * DICOM writer.
1612
1615
  *
1613
1616
  * @example
1617
+ * import {DicomParser, DicomWriter} from '//esm.sh/dwv';
1614
1618
  * // add link to html
1615
1619
  * const link = document.createElement("a");
1616
1620
  * link.appendChild(document.createTextNode("download"));
@@ -1618,10 +1622,10 @@ export declare class DicomSRContent {
1618
1622
  * div.appendChild(link);
1619
1623
  * // XMLHttpRequest onload callback
1620
1624
  * const onload = function (event) {
1621
- * const parser = new dwv.DicomParser();
1625
+ * const parser = new DicomParser();
1622
1626
  * parser.parse(event.target.response);
1623
1627
  * // create writer
1624
- * const writer = new dwv.DicomWriter();
1628
+ * const writer = new DicomWriter();
1625
1629
  * // get buffer using default rules
1626
1630
  * const dicomBuffer = writer.getBuffer(parser.getDicomElements());
1627
1631
  * // create blob
@@ -2613,13 +2617,14 @@ export declare namespace i18n {
2613
2617
  * - planar configuration (default RGBRGB...).
2614
2618
  *
2615
2619
  * @example
2620
+ * import {DicomParser, createImage} from '//esm.sh/dwv';
2616
2621
  * // XMLHttpRequest onload callback
2617
2622
  * const onload = function (event) {
2618
2623
  * // parse the dicom buffer
2619
- * const dicomParser = new dwv.DicomParser();
2624
+ * const dicomParser = new DicomParser();
2620
2625
  * dicomParser.parse(event.target.response);
2621
2626
  * // create the image object
2622
- * const image = dwv.createImage(dicomParser.getDicomElements());
2627
+ * const image = createImage(dicomParser.getDicomElements());
2623
2628
  * // result div
2624
2629
  * const div = document.getElementById('dwv');
2625
2630
  * // display the image size
@@ -5214,6 +5219,7 @@ export declare class ToolConfig {
5214
5219
  * the default ones.
5215
5220
  *
5216
5221
  * @example
5222
+ * import {App, AppOptions, ViewConfig, toolList} from '//esm.sh/dwv';
5217
5223
  * // custom tool
5218
5224
  * class AlertTool {
5219
5225
  * mousedown() {alert('AlertTool mousedown');}
@@ -5221,13 +5227,13 @@ export declare class ToolConfig {
5221
5227
  * activate() {}
5222
5228
  * }
5223
5229
  * // pass it to dwv tool list
5224
- * dwv.toolList['Alert'] = AlertTool;
5230
+ * toolList['Alert'] = AlertTool;
5225
5231
  * // create the dwv app
5226
- * const app = new dwv.App();
5232
+ * const app = new App();
5227
5233
  * // initialise
5228
- * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
5234
+ * const viewConfig0 = new ViewConfig('layerGroup0');
5229
5235
  * const viewConfigs = {'*': [viewConfig0]};
5230
- * const options = new dwv.AppOptions(viewConfigs);
5236
+ * const options = new AppOptions(viewConfigs);
5231
5237
  * options.tools = {Alert: {}};
5232
5238
  * app.init(options);
5233
5239
  * // activate tool
@@ -5250,6 +5256,8 @@ export declare const toolList: {
5250
5256
  * the default ones.
5251
5257
  *
5252
5258
  * @example
5259
+ * import {App, AppOptions, ViewConfig, toolOptions, ROI, Point2D}
5260
+ * from '//esm.sh/dwv';
5253
5261
  * // custom factory
5254
5262
  * class LoveFactory {
5255
5263
  * getName() {return 'love';}
@@ -5259,10 +5267,10 @@ export declare const toolList: {
5259
5267
  * setAnnotationMathShape(annotation, points) {
5260
5268
  * const px = points[0].getX();
5261
5269
  * const py = points[0].getY();
5262
- * annotation.mathShape = new dwv.ROI([
5263
- * new dwv.Point2D(px+15,py), new dwv.Point2D(px+10,py-10),
5264
- * new dwv.Point2D(px,py), new dwv.Point2D(px-10,py-10),
5265
- * new dwv.Point2D(px-15,py), new dwv.Point2D(px,py+20)
5270
+ * annotation.mathShape = new ROI([
5271
+ * new Point2D(px+15,py), new Point2D(px+10,py-10),
5272
+ * new Point2D(px,py), new Point2D(px-10,py-10),
5273
+ * new Point2D(px-15,py), new Point2D(px,py+20)
5266
5274
  * ]);
5267
5275
  * annotation.getFactory = function () {return new LoveFactory();}
5268
5276
  * }
@@ -5289,13 +5297,13 @@ export declare const toolList: {
5289
5297
  * }
5290
5298
  * }
5291
5299
  * // pass it to dwv option list
5292
- * dwv.toolOptions['draw'] = {LoveFactory};
5300
+ * toolOptions['draw'] = {LoveFactory};
5293
5301
  * // create the dwv app
5294
- * const app = new dwv.App();
5302
+ * const app = new App();
5295
5303
  * // initialise
5296
- * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
5304
+ * const viewConfig0 = new ViewConfig('layerGroup0');
5297
5305
  * const viewConfigs = {'*': [viewConfig0]};
5298
- * const options = new dwv.AppOptions(viewConfigs);
5306
+ * const options = new AppOptions(viewConfigs);
5299
5307
  * options.tools = {Draw: {options: ['Love']}};
5300
5308
  * app.init(options);
5301
5309
  * // activate tool
@@ -5400,15 +5408,16 @@ export declare class Vector3D {
5400
5408
  * (either directly or with helper methods).
5401
5409
  *
5402
5410
  * @example
5411
+ * import {DicomParser, createImage, createView} from '//esm.sh/dwv';
5403
5412
  * // XMLHttpRequest onload callback
5404
5413
  * const onload = function (event) {
5405
5414
  * // parse the dicom buffer
5406
- * const dicomParser = new dwv.DicomParser();
5415
+ * const dicomParser = new DicomParser();
5407
5416
  * dicomParser.parse(event.target.response);
5408
5417
  * // create the image object
5409
- * const image = dwv.createImage(dicomParser.getDicomElements());
5418
+ * const image = createImage(dicomParser.getDicomElements());
5410
5419
  * // create the view
5411
- * const view = dwv.createView(dicomParser.getDicomElements(), image);
5420
+ * const view = createView(dicomParser.getDicomElements(), image);
5412
5421
  * // setup canvas
5413
5422
  * const canvas = document.createElement('canvas');
5414
5423
  * canvas.width = 256;