Skip to content

Commit

Permalink
feature(viewer.js): Polygon/Point/Ellipse/Rectangle 2D and 3D bulk an…
Browse files Browse the repository at this point in the history
…notations support (#116)

* Bump dcmjs, dicomweb-client and ol versions

* Export utils

* Only render polygons inside boundaries of viewport

* Reload annotations on viewport changes

* Address caching of bulk data annotations

* Rollback annotations optimization

* Improve for loop

* Improve performance

* Improve performance

* Add multi layer support (auto replace) and basic color support

* Remove test code

* Use random points instead of centroids for points layer

* Extract utils and allow selection of polygons

* Run viewport checks only for polygons

* Process annotations even if measurements request failed

* Update workflow to use yarn

* Bump actions

* Update cache dependency path

* Add lock file

* Remove node 12x

* Run linting

* Use clusters

* Extract style functions

* Add point support alongisde polygon

* Add 2d support

* Remove unused cluster func

* Unify geometry functions

* Fix 2d and 3d annotation toggling

* Add ellipse and rectangle

* Fix ellispe rotation

* Address array errors

* Properly dispose layers to avoid memory leaks

* Dispose overview map on cleanup function

* Update open layers

* Revert "Update open layers"

This reverts commit a1829de.

* Update cleanup function

* Update condition for source clear

* Improve error logging

* Fix annotation group algorithm logic check

* Add warnings for annotation group sequence index

* Fix changing color of annotation disposing source issue and top left bottom right inverted

* Fallback to p10 to retrieve coordinate and graphic index / render clusters with one feature

* Change default color and width of polygons

* Add support for polyline

* Use right geometry for polyline

* Calculate affine for right pyramid level

* Render clusters if numberOfAnnotations is greater than 1000

* Refactor styles update for layers

* Revert "fix: Setup the dynamic import so it is separate from other packages (#113)"

This reverts commit 2834944.

* Refactor cluster styles and fix shadowed clusters issue

* feat: add reference series sequence tag (#126)

* feat: add reference series sequence tag

* fix: change to referencedSeriesInstanceUID

* feat: add pointer move event (#128)

* Update lock

* Lint

* Update tests

---------

Co-authored-by: Pedro H. Köhler <[email protected]>
  • Loading branch information
igoroctaviano and pedrokohler authored Jul 12, 2024
1 parent 7961af1 commit dea2a23
Show file tree
Hide file tree
Showing 15 changed files with 9,103 additions and 14,361 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ typings/
node_modules/
build/
dist/
yarn.lock
.vscode/
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ Note that the *dicom-microscopy-viewer* package is **not** a viewer application,
Below is an example for the most basic usage: a web page that displays a collection of DICOM VL Whole Slide Microscopy Image instances of a digital slide.
For more advanced usage, take a look at the [Slim](https://github.com/imagingdatacommons/slim) viewer.

## Packaging

The library is packaged as two different builds, one using dynamic import, and the other bundling into one
larger library. The dynamic import version uses a public path of `/dicom-microscopy-viewer/` so that they can be used by simply adding an alias to the appropriate version, and then deploying that version. In a straight web application, this can be loaded as:

```javascript
const DICOMMicroscopyViewer = (await('/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js')).default
```

The point of using the sub-directory here is to isolate the dependencies that unique to `dicom-microscopy-viewer`.

### Basic usage

The viewer can be embedded in any website, one only needs to
Expand Down
12 changes: 4 additions & 8 deletions config/webpack/webpack-dynamic-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const merge = require('./merge')
const rootPath = process.cwd()
const baseConfig = require('./webpack-base')
const TerserPlugin = require('terser-webpack-plugin')
const outputPath = path.join(rootPath, 'dist', 'dynamic-import', 'dicom-microscopy-viewer')
const outputPath = path.join(rootPath, 'dist', 'dynamic-import')

const prodConfig = {
mode: 'production',
Expand All @@ -12,15 +12,11 @@ const prodConfig = {
},
output: {
path: outputPath,
library: {
name: 'dicomMicroscopyViewer',
type: 'window',
},
filename: '[name].min.js',
publicPath: '/dicom-microscopy-viewer/',
libraryTarget: 'umd',
globalObject: 'this',
filename: '[name].min.js'
},
optimization: {
// minimize: false,
minimizer: [
new TerserPlugin({
parallel: true
Expand Down
Loading

0 comments on commit dea2a23

Please sign in to comment.