larvitar 1.5.13 → 2.0.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/.vscode/settings.json +4 -0
- package/README.md +78 -48
- package/bundler/webpack.common.js +27 -0
- package/bundler/webpack.dev.js +23 -0
- package/bundler/webpack.prod.js +19 -0
- package/decs.d.ts +12 -0
- package/dist/imaging/MetaDataReadable.d.ts +39 -0
- package/dist/imaging/MetaDataTypes.d.ts +3488 -0
- package/dist/imaging/imageAnonymization.d.ts +12 -0
- package/dist/imaging/imageColormaps.d.ts +47 -0
- package/dist/imaging/imageContours.d.ts +18 -0
- package/dist/imaging/imageIo.d.ts +42 -0
- package/dist/imaging/imageLayers.d.ts +56 -0
- package/dist/imaging/imageLoading.d.ts +65 -0
- package/dist/imaging/imageParsing.d.ts +46 -0
- package/dist/imaging/imagePresets.d.ts +43 -0
- package/dist/imaging/imageRendering.d.ts +238 -0
- package/dist/imaging/imageReslice.d.ts +14 -0
- package/dist/imaging/imageStore.d.ts +121 -0
- package/dist/imaging/imageTags.d.ts +22 -0
- package/dist/imaging/imageTools.d.ts +20 -0
- package/dist/imaging/imageUtils.d.ts +165 -0
- package/dist/imaging/loaders/commonLoader.d.ts +103 -0
- package/dist/imaging/loaders/dicomLoader.d.ts +29 -0
- package/dist/imaging/loaders/fileLoader.d.ts +33 -0
- package/dist/imaging/loaders/multiframeLoader.d.ts +37 -0
- package/dist/imaging/loaders/nrrdLoader.d.ts +112 -0
- package/dist/imaging/loaders/resliceLoader.d.ts +15 -0
- package/dist/imaging/monitors/memory.d.ts +41 -0
- package/dist/imaging/monitors/performance.d.ts +23 -0
- package/dist/imaging/parsers/ecg.d.ts +15 -0
- package/dist/imaging/parsers/nrrd.d.ts +3 -0
- package/dist/imaging/tools/custom/4dSliceScrollTool.d.ts +12 -0
- package/dist/imaging/tools/custom/contourTool.d.ts +409 -0
- package/dist/imaging/tools/custom/diameterTool.d.ts +18 -0
- package/dist/imaging/tools/custom/editMaskTool.d.ts +22 -0
- package/dist/imaging/tools/custom/ellipticalRoiOverlayTool.d.ts +45 -0
- package/dist/imaging/tools/custom/polygonSegmentationMixin.d.ts +54 -0
- package/dist/imaging/tools/custom/polylineScissorsTool.d.ts +11 -0
- package/dist/imaging/tools/custom/rectangleRoiOverlayTool.d.ts +45 -0
- package/dist/imaging/tools/custom/seedTool.d.ts +0 -0
- package/dist/imaging/tools/custom/setLabelMap3D.d.ts +39 -0
- package/dist/imaging/tools/custom/thresholdsBrushTool.d.ts +19 -0
- package/dist/imaging/tools/default.d.ts +53 -0
- package/dist/imaging/tools/interaction.d.ts +30 -0
- package/dist/imaging/tools/io.d.ts +38 -0
- package/dist/imaging/tools/main.d.ts +81 -0
- package/dist/imaging/tools/segmentation.d.ts +125 -0
- package/dist/imaging/tools/state.d.ts +17 -0
- package/dist/imaging/tools/strategies/eraseFreehand.d.ts +16 -0
- package/dist/imaging/tools/strategies/fillFreehand.d.ts +16 -0
- package/dist/imaging/tools/strategies/index.d.ts +2 -0
- package/dist/index.d.ts +34 -0
- package/dist/larvitar.js +89801 -0
- package/dist/larvitar.js.map +1 -0
- package/imaging/MetaDataReadable.ts +40 -0
- package/imaging/MetaDataTypes.ts +3490 -0
- package/imaging/dataDictionary.json +5328 -5328
- package/imaging/{imageAnonymization.js → imageAnonymization.ts} +41 -13
- package/imaging/{imageColormaps.js → imageColormaps.ts} +48 -30
- package/imaging/{imageContours.js → imageContours.ts} +24 -22
- package/imaging/{imageIo.js → imageIo.ts} +89 -52
- package/imaging/{imageLayers.js → imageLayers.ts} +31 -14
- package/imaging/{imageLoading.js → imageLoading.ts} +108 -45
- package/imaging/{imageParsing.js → imageParsing.ts} +158 -80
- package/imaging/{imagePresets.js → imagePresets.ts} +44 -11
- package/imaging/imageRendering.ts +1091 -0
- package/imaging/{imageReslice.js → imageReslice.ts} +18 -9
- package/imaging/imageStore.ts +487 -0
- package/imaging/imageTags.ts +609 -0
- package/imaging/imageTools.js +2 -1
- package/imaging/{imageUtils.js → imageUtils.ts} +211 -701
- package/imaging/loaders/{commonLoader.js → commonLoader.ts} +73 -24
- package/imaging/loaders/{dicomLoader.js → dicomLoader.ts} +25 -5
- package/imaging/loaders/{fileLoader.js → fileLoader.ts} +5 -5
- package/imaging/loaders/{multiframeLoader.js → multiframeLoader.ts} +145 -90
- package/imaging/loaders/{nrrdLoader.js → nrrdLoader.ts} +230 -64
- package/imaging/loaders/{resliceLoader.js → resliceLoader.ts} +51 -20
- package/imaging/monitors/{memory.js → memory.ts} +54 -8
- package/imaging/monitors/performance.ts +34 -0
- package/imaging/parsers/ecg.ts +51 -0
- package/imaging/tools/README.md +27 -0
- package/imaging/tools/custom/4dSliceScrollTool.js +47 -46
- package/imaging/tools/custom/ellipticalRoiOverlayTool.js +534 -0
- package/imaging/tools/custom/polylineScissorsTool.js +1 -1
- package/imaging/tools/custom/rectangleRoiOverlayTool.js +564 -0
- package/imaging/tools/{setLabelMap3D.js → custom/setLabelMap3D.ts} +19 -25
- package/imaging/tools/{default.js → default.ts} +114 -30
- package/imaging/tools/{interaction.js → interaction.ts} +42 -23
- package/imaging/tools/{io.js → io.ts} +47 -31
- package/imaging/tools/{main.js → main.ts} +105 -40
- package/imaging/tools/{segmentation.js → segmentation.ts} +95 -68
- package/imaging/tools/{state.js → state.ts} +7 -12
- package/imaging/tools/types.d.ts +243 -0
- package/imaging/types.d.ts +197 -0
- package/{index.js → index.ts} +43 -14
- package/jsdoc.json +1 -1
- package/package.json +32 -14
- package/tsconfig.json +102 -0
- package/imaging/imageRendering.js +0 -860
- package/imaging/imageStore.js +0 -322
- package/modules/vuex/larvitar.js +0 -187
- /package/imaging/tools/{polygonSegmentationMixin.js → custom/polygonSegmentationMixin.js} +0 -0
package/README.md
CHANGED
|
@@ -4,13 +4,72 @@
|
|
|
4
4
|
|
|
5
5
|
# Larvitar
|
|
6
6
|
|
|
7
|
+
[](https://github.com/dvisionlab/Larvitar)
|
|
8
|
+
|
|
7
9
|
## Dicom Image Toolkit for CornerstoneJS
|
|
8
10
|
|
|
9
|
-
### Current version:
|
|
10
|
-
### Latest Published Release:
|
|
11
|
+
### Current version: 2.0.0
|
|
12
|
+
### Latest Published Release: 2.0.0
|
|
11
13
|
|
|
12
14
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
## Features:
|
|
17
|
+
|
|
18
|
+
- Orthogonal multiplanar reformat with contours generations
|
|
19
|
+
- Custom loader/exporter for nrrd files
|
|
20
|
+
- Segmentation masks support
|
|
21
|
+
- Memory management
|
|
22
|
+
- Support all dicom modalities
|
|
23
|
+
- 4D Cine support
|
|
24
|
+
- Anonymization functionalities
|
|
25
|
+
- Cine tools and ECG Parsing
|
|
26
|
+
- Masks management
|
|
27
|
+
|
|
28
|
+
Full documentation and examples are available at http://www.dvisionlab.com/Larvitar/.
|
|
29
|
+
|
|
30
|
+
# Typescript
|
|
31
|
+
|
|
32
|
+
_Types_ can be imported from `larvitar/imaging/types` or `larvitar/imaging/tools/types`.
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import { Series } from "larvitar/imaging/types";
|
|
36
|
+
|
|
37
|
+
let newSerie: Series;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<br>
|
|
41
|
+
|
|
42
|
+
# Dependencies
|
|
43
|
+
|
|
44
|
+
- `cornerstone`
|
|
45
|
+
- `cornerstone-tools`
|
|
46
|
+
- `dicomParser`
|
|
47
|
+
- `DICOMImageLoader`
|
|
48
|
+
- `webImageLoader`
|
|
49
|
+
- `fileImageLoader`
|
|
50
|
+
- `lodash`
|
|
51
|
+
- `pako`
|
|
52
|
+
- `papaparse`
|
|
53
|
+
|
|
54
|
+
# Installation
|
|
55
|
+
|
|
56
|
+
`yarn add larvitar`
|
|
57
|
+
|
|
58
|
+
# Build package
|
|
59
|
+
|
|
60
|
+
`yarn build`
|
|
61
|
+
|
|
62
|
+
# Coverage
|
|
63
|
+
|
|
64
|
+
Use `yarn coverage` to generate type coverage report.
|
|
65
|
+
|
|
66
|
+
# Development
|
|
67
|
+
|
|
68
|
+
Use `yarn dev` to have `webpack` hot-reload (live recompiling the library).
|
|
69
|
+
In order to test functionalities you can serve the .html file with VSCode extension [LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) or other similar tools.
|
|
70
|
+
Once you are done, upgrade the version (README and package.json) and build the library. Docs will be compiled by the Github action.
|
|
71
|
+
|
|
72
|
+
### Repository structure
|
|
14
73
|
|
|
15
74
|
- `index` main file
|
|
16
75
|
- `dataDictionary` json file for dicom tags
|
|
@@ -25,73 +84,44 @@ Orthogonal multiplanar reformat is included as well as custom loader/exporter fo
|
|
|
25
84
|
- `imageRendering` provides rendering functionalities
|
|
26
85
|
- `imageReslice` provides reslice functionalities
|
|
27
86
|
- `imageStore` provides data storage functionalities, vuex support is integrated
|
|
87
|
+
- `imageTags` using to handle dicom tags and metadata
|
|
28
88
|
- `imageTools` using to handle standard and custom cornerstone tools
|
|
29
89
|
- `imageUtils` utility functions on pixels and metadata tags
|
|
30
90
|
- `loaders/commonLoader` common functionalities for custom loaders
|
|
31
91
|
- `loaders/dicomLoader` custom loader for DICOM files with support for multiplanar reformat (axial, sagittal and coronal planes)
|
|
32
92
|
- `loaders/fileLoader` custom loader for png/jpg files
|
|
93
|
+
- `loaders/multiFrameLoader` custom loader for multiFrame data
|
|
33
94
|
- `loaders/nrrdLoader`custom loader for nrrd files with support for multiplanar reformat (axial, sagittal and coronal planes)
|
|
34
95
|
- `loaders/resliceLoader` custom loader for resliced data
|
|
35
|
-
- `
|
|
96
|
+
- `parsers/ecg` custom parser for ecg data
|
|
36
97
|
- `parsers/nrrd` custom parser for nrrd data
|
|
98
|
+
- `tools/custom/4DSliceScrollTool` is a custom cornerstone tool for handling navigation of slices in a 4D DICOM series
|
|
37
99
|
- `tools/custom/contourTool` is a custom cornerstone tool for 2D visualization of segmented images
|
|
38
100
|
- `tools/custom/diameterTool` is a custom cornerstone tool for 2D visualization of diameter widgets
|
|
39
101
|
- `tools/custom/editMaskTool` is a custom cornerstone tool for 2D visualization of segmentation masks with brush functionalities
|
|
102
|
+
- `tools/custom/EllipticalRoiOverlayTool` is a custom cornerstone tool for 2D visualization of elliptical widgets
|
|
103
|
+
- `tools/custom/polygonSegmentationMixin` is a custom cornerstone tool for 2D visualization of polygonal widgets
|
|
104
|
+
- `tools/custom/polylineScissorTool` is a custom cornerstone tool for 2D visualization of polyline widgets
|
|
105
|
+
- `tools/custom/rectangleRoiOverlayTool` is a custom cornerstone tool for 2D visualization of rectangular widgets
|
|
40
106
|
- `tools/custom/seedTool` is a custom cornerstone tool for 2D interactive seeding with custom colors and labels
|
|
107
|
+
- `tools/custom/setLabelMap3D`
|
|
41
108
|
- `tools/custom/thresholdsBrushTool` is a custom cornerstone tool for handling thresholds in a brush tool
|
|
42
|
-
- `tools/custom/Slice4DScrollMouseWheel` is a custom cornerstone tool for handling navigation of slices in a 4D DICOM series
|
|
43
109
|
- `tools/default` default tools map and configuration
|
|
110
|
+
- `tools/interaction` cornerstone interaction tools
|
|
44
111
|
- `tools/io` import and export functionalities for tools
|
|
45
112
|
- `tools/main` tools main functionalities
|
|
46
113
|
- `tools/state` tools state management
|
|
47
114
|
- `tools/segmentation` segmentation masks management
|
|
48
|
-
- `
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
**Larvitar** can be used with or without `vuex` bindings:
|
|
53
|
-
|
|
54
|
-
```javascript
|
|
55
|
-
import { initLarvitarStore } from "larvitar";
|
|
56
|
-
import store from "@/store/index";
|
|
57
|
-
|
|
58
|
-
initLarvitarStore(store); // Calling this without parameters makes Larvitar use its internal store.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Full documentation and examples are available at http://www.dvisionlab.com/Larvitar/.
|
|
62
|
-
|
|
63
|
-
<br>
|
|
115
|
+
- `tools/strategies/eraseFreeHand` strategy for erasing freehand masks
|
|
116
|
+
- `tools/strategies/fillFreeHand` strategy for filling freehand masks
|
|
117
|
+
- `tools/strategies/index` strategies index
|
|
64
118
|
|
|
65
119
|
# Contributors
|
|
66
120
|
|
|
67
121
|
- Simone Manini, D/Vision Lab
|
|
68
122
|
- Mattia Ronzoni, D/Vision Lab
|
|
69
123
|
- Sara Zanchi, D/Vision Lab
|
|
124
|
+
- Alessandro Re, D/Vision Lab
|
|
125
|
+
- Laura Borghesi, D/Vision Lab
|
|
70
126
|
|
|
71
|
-
.
|
|
96
|
-
In order to test functionalities you can modify the library import path in an example (see the `docs/examples` folder) to use the recompiled bundle in `dist/`, then serve the .html file with VSCode extension [LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) or other similar tools.
|
|
97
|
-
Once you are done, upgrade the version, build the library and copy it to the `docs/examples` folder. This file must be included into the commit, while docs will be compiled by the Github action.
|
|
127
|
+

|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
devtool: "source-map", // or inline-source-map ?
|
|
3
|
+
module: {
|
|
4
|
+
rules: [
|
|
5
|
+
// HTML
|
|
6
|
+
{
|
|
7
|
+
test: /\.(html)$/,
|
|
8
|
+
use: ["html-loader"]
|
|
9
|
+
},
|
|
10
|
+
// JS
|
|
11
|
+
{
|
|
12
|
+
test: /\.js$/,
|
|
13
|
+
exclude: /node_modules/,
|
|
14
|
+
use: ["babel-loader"]
|
|
15
|
+
},
|
|
16
|
+
// typescript support
|
|
17
|
+
{
|
|
18
|
+
test: /\.tsx?$/,
|
|
19
|
+
use: "ts-loader",
|
|
20
|
+
exclude: /node_modules/
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
resolve: {
|
|
25
|
+
extensions: [".tsx", ".ts", ".js", ".d.ts"]
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const { merge } = require("webpack-merge");
|
|
3
|
+
const commonConfiguration = require("./webpack.common.js");
|
|
4
|
+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
+
|
|
6
|
+
module.exports = merge(commonConfiguration, {
|
|
7
|
+
entry: path.resolve(__dirname, "../index.ts"),
|
|
8
|
+
output: {
|
|
9
|
+
path: path.resolve(__dirname, "../dist"),
|
|
10
|
+
filename: "larvitar.js",
|
|
11
|
+
library: "larvitar",
|
|
12
|
+
libraryTarget: "umd"
|
|
13
|
+
},
|
|
14
|
+
mode: "development",
|
|
15
|
+
plugins: [new CleanWebpackPlugin()],
|
|
16
|
+
watch: true,
|
|
17
|
+
watchOptions: {
|
|
18
|
+
ignored: /node_modules/
|
|
19
|
+
},
|
|
20
|
+
optimization: {
|
|
21
|
+
minimize: false
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const { merge } = require("webpack-merge");
|
|
3
|
+
const commonConfiguration = require("./webpack.common.js");
|
|
4
|
+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
+
|
|
6
|
+
module.exports = merge(commonConfiguration, {
|
|
7
|
+
entry: path.resolve(__dirname, "../index.ts"),
|
|
8
|
+
output: {
|
|
9
|
+
path: path.resolve(__dirname, "../dist"),
|
|
10
|
+
filename: "larvitar.js",
|
|
11
|
+
library: "larvitar",
|
|
12
|
+
libraryTarget: "umd"
|
|
13
|
+
},
|
|
14
|
+
mode: "production",
|
|
15
|
+
plugins: [new CleanWebpackPlugin()],
|
|
16
|
+
optimization: {
|
|
17
|
+
minimize: false
|
|
18
|
+
}
|
|
19
|
+
});
|
package/decs.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "cornerstone-math";
|
|
2
|
+
declare module "cornerstone-tools";
|
|
3
|
+
declare module "cornerstone-wado-image-loader";
|
|
4
|
+
declare module "cornerstone-web-image-loader";
|
|
5
|
+
declare module "cornerstone-file-image-loader";
|
|
6
|
+
declare module "dicom-character-set";
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
interface Document {
|
|
10
|
+
documentMode?: any;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type MetaDataReadable = {
|
|
2
|
+
anonymized?: boolean;
|
|
3
|
+
larvitarSeriesInstanceUID?: string;
|
|
4
|
+
seriesUID?: string;
|
|
5
|
+
instanceUID?: string;
|
|
6
|
+
studyUID?: string;
|
|
7
|
+
accessionNumber?: string;
|
|
8
|
+
studyDescription?: string;
|
|
9
|
+
patientName?: string;
|
|
10
|
+
patientBirthdate?: string;
|
|
11
|
+
seriesDescription?: string;
|
|
12
|
+
seriesDate?: string;
|
|
13
|
+
seriesModality?: string;
|
|
14
|
+
intercept?: number | number[];
|
|
15
|
+
slope?: number | number[];
|
|
16
|
+
pixelSpacing?: [number, number];
|
|
17
|
+
sliceThickness?: number | number[];
|
|
18
|
+
imageOrientation?: [number, number, number, number, number, number];
|
|
19
|
+
imagePosition?: [number, number] | [number, number, number] | number[];
|
|
20
|
+
rows?: number;
|
|
21
|
+
cols?: number;
|
|
22
|
+
numberOfSlices?: number;
|
|
23
|
+
numberOfFrames?: number;
|
|
24
|
+
frameTime?: number;
|
|
25
|
+
frameDelay?: number;
|
|
26
|
+
rWaveTimeVector?: number[];
|
|
27
|
+
isMultiframe?: boolean;
|
|
28
|
+
temporalPositionIdentifier?: number;
|
|
29
|
+
numberOfTemporalPositions?: number;
|
|
30
|
+
contentTime?: number;
|
|
31
|
+
is4D?: boolean;
|
|
32
|
+
windowCenter?: number | number[];
|
|
33
|
+
windowWidth?: number | number[];
|
|
34
|
+
minPixelValue?: number;
|
|
35
|
+
maxPixelValue?: number;
|
|
36
|
+
length?: number;
|
|
37
|
+
repr?: string | null;
|
|
38
|
+
mimeType?: string;
|
|
39
|
+
};
|