-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from cornerstonejs/import/lerna-import-dcmjs-3
feat(adapters): Import the adapters for cornerstone 3D to DICOM SR for annotations
- Loading branch information
Showing
54 changed files
with
8,352 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": [ | ||
["@babel/preset-env", { | ||
"targets": { | ||
"browsers": ["ie 11"] | ||
} | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"jest": true | ||
}, | ||
|
||
"extends": [ | ||
"eslint:recommended", | ||
"prettier" | ||
], | ||
|
||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
*.sw* | ||
*~ | ||
|
||
node_modules | ||
.idea | ||
yarn-error.log | ||
yarn.lock | ||
.DS_Store | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.dcm | ||
.jshintrc | ||
examples/ | ||
src/ | ||
config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"tabWidth": 4, | ||
"trailingComma": "none", | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Steve Pieper | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div align="center"> | ||
<h1>Adapters for VTK, Cornerstone and Cornerstone3D</h1> | ||
<p>Conversion to/from the internal model and DICOM SR for annotations and other | ||
types of objects.</p> | ||
</div> | ||
|
||
<hr /> | ||
|
||
# History | ||
|
||
- 2014 | ||
- [DCMTK](dcmtk.org) cross compiled to javascript at [CTK Hackfest](http://www.commontk.org/index.php/CTK-Hackfest-May-2014). While this was useful and powerful, it was heavyweight for typical web usage. | ||
- 2016 | ||
- A [Medical Imaging Web Appliction meeting at Stanford](http://qiicr.org/web/outreach/Medical-Imaging-Web-Apps/) and [follow-on hackfest in Boston](http://qiicr.org/web/outreach/MIWS-hackfest/) helped elaborate the needs for manipulating DICOM in pure Javascript. | ||
- Based on [DICOM Part 10 read/write code](https://github.com/OHIF/dicom-dimse) initiated by Weiwei Wu of [OHIF](http://ohif.org), Steve Pieper [developed further features](https://github.com/pieper/sites/tree/gh-pages/dcmio) and [examples of creating multiframe and segmentation objects](https://github.com/pieper/sites/tree/gh-pages/DICOMzero) discussed with the community at RSNA | ||
- 2017 | ||
- At [NA-MIC Project Week 25](https://na-mic.org/wiki/Project_Week_25) Erik Ziegler and Steve Pieper [worked](https://na-mic.org/wiki/Project_Week_25/DICOM_Segmentation_Support_for_Cornerstone_and_OHIF_Viewer) | ||
with the community to define some example use cases to mix the pure JavaScript DICOM code with Cornerstone and [CornerstoneTools](https://github.com/chafey/cornerstoneTools). | ||
- 2018-2022 | ||
- Work continues to develop SR and SEG support to [OHIFViewer](http://ohif.org) allow interoperability with [DICOM4QI](https://legacy.gitbook.com/book/qiicr/dicom4qi/details) | ||
- 2023 | ||
- Moved the adapters into cornerstone3D from dcmjsj | ||
|
||
# Support | ||
|
||
The developers gratefully acknowledge their research support: | ||
|
||
- Open Health Imaging Foundation ([OHIF](http://ohif.org)) | ||
- Quantitative Image Informatics for Cancer Research ([QIICR](http://qiicr.org)) | ||
- [Radiomics](http://radiomics.io) | ||
- The [Neuroimage Analysis Center](http://nac.spl.harvard.edu) | ||
- The [National Center for Image Guided Therapy](http://ncigt.org) | ||
- The [NCI Imaging Data Commons](https://imagingdatacommons.github.io/) NCI Imaging Data Commons: contract number 19X037Q from Leidos Biomedical Research under Task Order HHSN26100071 from NCI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## Moved to @cornerstonejs/adapters | ||
|
||
Removed all but the adapters code, based on dcmjs 0.29.4 | ||
|
||
## [0.2.1] - 2018-10-17 | ||
|
||
### Added | ||
|
||
- Added Adapters and Utilities to support translation between common imaging toolkits (Cornerstone, VTK.js) and DICOM Structured Reports. Utilities are tied to the DICOM Standard and help build compliant files. Adapters are specific to the toolkits in question and help make it easier for developers to use the Utilities. | ||
|
||
Note: These are generally still a work in progress. We are currently only confident in the Cornerstone Length adapter, and the Utilities (TID1500, TID1501, TID300, Length) which back it. | ||
|
||
## [0.2.0] - 2018-10-02 | ||
|
||
### Added | ||
|
||
- Example using [VTK.js with DICOM Segmentation](https://dcmjs-org.github.io/dcmjs/examples/vtkDisplay/index.html) | ||
|
||
### Changed | ||
|
||
- BitArray class provides static methods | ||
to pack and unpack bit and bytes to support | ||
dicom SEG encoding. | ||
|
||
## [0.1.5] - 2018-08-23 | ||
|
||
### Fixed | ||
|
||
- Fixed dcmjs compatibility with IE11 | ||
|
||
## [0.1.4] - 2018-08-23 | ||
|
||
### Added | ||
|
||
- Added Webpack and babel to replace Rollup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const env = process.env.ENV || 'dev'; | ||
const config = require(`./webpack-${env}`); | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const _ = require('lodash'); | ||
|
||
// Merge two objects | ||
// Instead of merging array objects index by index (n-th source | ||
// item with n-th object item) it concatenates both arrays | ||
module.exports = function(object, source) { | ||
const clone = _.cloneDeep(object); | ||
const merged = _.mergeWith(clone, source, function(objValue, srcValue, key, object, source, stack) { | ||
if(objValue && srcValue && _.isArray(objValue) && _.isArray(srcValue)) { | ||
return _.concat(objValue, srcValue); | ||
} | ||
}); | ||
|
||
return merged; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const path = require('path'); | ||
const rootPath = process.cwd(); | ||
const context = path.join(rootPath, "src"); | ||
const outputPath = path.join(rootPath, 'build'); | ||
|
||
module.exports = { | ||
context, | ||
entry: { | ||
dcmjs: './dcmjs.js' | ||
}, | ||
output: { | ||
filename: 'dcmjs.js', | ||
library: 'dcmjs', | ||
libraryTarget: 'umd', | ||
path: outputPath, | ||
umdNamedDefine: true | ||
}, | ||
devtool: 'source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /(node_modules)/, | ||
use: [{ | ||
loader: 'babel-loader' | ||
}] | ||
} | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const webpack = require('webpack'); | ||
const merge = require('./merge'); | ||
const baseConfig = require('./webpack-base'); | ||
|
||
const devConfig = { | ||
mode: "development", | ||
devServer: { | ||
hot: true, | ||
publicPath: '/build/' | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin({}) | ||
] | ||
}; | ||
|
||
module.exports = merge(baseConfig, devConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const merge = require('./merge'); | ||
const baseConfig = require('./webpack-base'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
|
||
const prodConfig = { | ||
mode: "production", | ||
optimization: { | ||
minimizer: [ | ||
new UglifyJSPlugin({ | ||
sourceMap: true | ||
}) | ||
] | ||
}, | ||
}; | ||
|
||
module.exports = merge(baseConfig, prodConfig); |
Oops, something went wrong.