Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] v3 - dicom microscopy extension and mode #3247

Merged
merged 53 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9e27d99
skeleton for dicom-microscopy extension
md-prog Mar 17, 2023
ed5455b
skeleton for microscopy mode
md-prog Mar 17, 2023
0b568ea
[feat] ported @radicalimaging/microscopy-dicom to OHIF's default exte…
md-prog Mar 17, 2023
ca66b82
[feat] ported microscopy mode from private repo
md-prog Mar 17, 2023
c3338ea
added new definitions to the package.json
md-prog Mar 17, 2023
5c7df1e
webpack configuration update for microscopy extension
md-prog Mar 17, 2023
55df9d2
register new icons for microscopy tools
md-prog Mar 17, 2023
dc3d327
fixes to the microscopy extension and mode
md-prog Mar 17, 2023
526045e
trivial error fix - typescript type import error
md-prog Mar 17, 2023
0cd64e8
link microscopy extension with default OHIF app plugin config
md-prog Mar 17, 2023
c9291aa
demo config fix
md-prog Mar 17, 2023
5dceb8f
fix logs
md-prog Mar 17, 2023
f867837
remove unsed imports
md-prog Mar 17, 2023
6d0d839
[fix] loading of microscopy
md-prog Mar 21, 2023
7c2a01d
[fix] webworker script loading, normalizing denaturalized dataset
md-prog Mar 24, 2023
17a8a9e
found the latest version of dicom-microscopy-viewer that works with c…
md-prog Mar 24, 2023
f2d1f1d
hide thumbnail pane by default, as we have issues with
md-prog Mar 24, 2023
def4fb3
comments
md-prog Mar 24, 2023
462aa27
remove unused code
md-prog Mar 24, 2023
cffdef8
[feat] microscopy - annotation selection
md-prog Mar 24, 2023
119b9bf
[feat] microscopy - edit annotation label
md-prog Mar 24, 2023
ffe10ad
wip
sedghi Mar 30, 2023
80796c6
[bugfix] dicom-microscopy tool
md-prog Apr 5, 2023
ea94c03
[bugfix] dicom microscopy annotations
md-prog Apr 5, 2023
518a83d
[fix] mixed-content blocking caused by BulkDataURI
md-prog Apr 5, 2023
9a6d5dd
[fix] microscopy measurements panel - center button
md-prog Apr 5, 2023
7ed5ac4
[fix] microscopy measurements panel - styling
md-prog Apr 5, 2023
be75c04
[fix] microscopy - controls
md-prog Apr 5, 2023
69d54a9
fix local loading of microscopy
md-prog Apr 18, 2023
f357066
fix local loading of dicom microscopy
md-prog Apr 18, 2023
3402cd0
fix typo - indexof to indexOf
md-prog Apr 18, 2023
a9a19e8
[fix] remove unused icons
md-prog Apr 18, 2023
f165970
remove commented out lines from webpack configuration
md-prog Apr 18, 2023
49070d5
platform/viewer/public/config/default.js - revert accidental changes
md-prog Apr 18, 2023
01f3688
[refactor] redirecting to microscopy mode on Local mode
md-prog Apr 18, 2023
1dc6a5f
attribution to DMV and SLIM viewer
md-prog Apr 18, 2023
7b4c436
[fix] code review feedbacks
md-prog Apr 18, 2023
1fe0e6c
fix thumbnails
sedghi Apr 19, 2023
23c7dfe
[fix] microscopy - fix old publisher.publish() to PubSubService._broa…
md-prog Apr 19, 2023
3bf9808
[fix] interactions, webpack config, roi selection
md-prog Apr 19, 2023
66892dd
[feat] microscopy - remove select tool from UI
md-prog Apr 19, 2023
2bedc7b
microscopy author
md-prog Apr 19, 2023
82a6746
[fix] saving and loading SR
md-prog Apr 20, 2023
6c279cc
[bugfix] - missing publish() function in MicroscopyService, replace w…
md-prog Apr 20, 2023
9bf4e0a
remove author section from readme
md-prog Apr 24, 2023
eeaaed8
refactor SR saving feature
md-prog Apr 27, 2023
e9f95b3
Merge branch 'v3-stable' into feat/v3-dicom-microscopy
md-prog Apr 27, 2023
22a5085
fix webpack config after merge
md-prog Apr 27, 2023
eda7edb
[bugfix] repeated import
md-prog Apr 27, 2023
c5dbe2d
Merge branch 'v3-stable' into feat/v3-dicom-microscopy
md-prog Apr 27, 2023
3e5abf7
fix e2e
sedghi Apr 27, 2023
bf9bd7a
webpack configuration
md-prog Apr 27, 2023
2693c5d
hide "Create report" button for microscopy
md-prog Apr 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .webpack/rules/transpileJavaScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function transpileJavaScript(mode) {
// These are packages that are not transpiled to our lowest supported
// JS version (currently ES5). Most of these leverage ES6+ features,
// that we need to transpile to a different syntax.
exclude,
exclude: [/(codecs)/, /(dicomicc)/, exclude],
loader: 'babel-loader',
options: {
// Find babel.config.js in monorepo root
Expand Down
10 changes: 10 additions & 0 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
},
},
module: {
noParse: [/(codec)/, /(dicomicc)/],
rules: [
transpileJavaScriptRule(mode),
loadWebWorkersRule,
Expand All @@ -89,6 +90,10 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
},
},
cssToJavaScript,
{
test: /\.wasm/,
type: 'asset/resource',
},
], //.concat(vtkRules),
},
resolve: {
Expand Down Expand Up @@ -148,6 +153,11 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
// Uncomment to generate bundle analyzer
// new BundleAnalyzerPlugin(),
],
// enable experimental features, like webAssembly
experiments: {
asyncWebAssembly: true,
syncWebAssembly: true,
},
};

if (isProdBuild) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/cornerstone/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { registerColormap } from './utils/colormap/transferFunctionHelpers';
import { id } from './id';
import * as csWADOImageLoader from './initWADOImageLoader.js';
import { measurementMappingUtils } from './utils/measurementServiceMappings';
import { PublicViewportOptions } from './services/ViewportService/Viewport';
import type { PublicViewportOptions } from './services/ViewportService/Viewport';

const Component = React.lazy(() => {
return import(
Expand Down
104 changes: 104 additions & 0 deletions extensions/dicom-microscopy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
8 changes: 8 additions & 0 deletions extensions/dicom-microscopy/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"printWidth": 80,
"proseWrap": "always",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
63 changes: 63 additions & 0 deletions extensions/dicom-microscopy/.webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
const path = require('path');
const pkg = require('../package.json');

const outputFile = 'index.umd.js';
const rootDir = path.resolve(__dirname, '../');
const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`);

// Todo: add ESM build for the extension in addition to umd build

const config = {
mode: 'production',
entry: rootDir + '/' + pkg.module,
devtool: 'source-map',
output: {
path: outputFolder,
filename: outputFile,
library: pkg.name,
libraryTarget: 'umd',
chunkFilename: '[name].chunk.js',
umdNamedDefine: true,
globalObject: "typeof self !== 'undefined' ? self : this",
},
externals: [
{
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'@ohif/core': {
commonjs2: '@ohif/core',
commonjs: '@ohif/core',
amd: '@ohif/core',
root: '@ohif/core',
},
'@ohif/ui': {
commonjs2: '@ohif/ui',
commonjs: '@ohif/ui',
amd: '@ohif/ui',
root: '@ohif/ui',
},
},
],
module: {
rules: [
{
test: /(\.jsx|\.js|\.tsx|\.ts)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/,
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
],
},
resolve: {
modules: [path.resolve('./node_modules'), path.resolve('./src')],
extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'],
},
};

module.exports = config;
9 changes: 9 additions & 0 deletions extensions/dicom-microscopy/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023 dicom-microscopy ([email protected])

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.
10 changes: 10 additions & 0 deletions extensions/dicom-microscopy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dicom-microscopy

## Description
OHIF extension for DICOM microscopy

## Author
Bill Wallace, md-prog, Radical Imaging

## License
MIT
44 changes: 44 additions & 0 deletions extensions/dicom-microscopy/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
plugins: ['inline-react-svg', '@babel/plugin-proposal-class-properties'],
env: {
test: {
presets: [
[
// TODO: https://babeljs.io/blog/2019/03/19/7.4.0#migration-from-core-js-2
'@babel/preset-env',
{
modules: 'commonjs',
debug: false,
},
"@babel/preset-typescript",
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator',
'@babel/plugin-transform-runtime',
],
},
production: {
presets: [
// WebPack handles ES6 --> Target Syntax
['@babel/preset-env', { modules: false }],
'@babel/preset-react',
"@babel/preset-typescript",
],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
development: {
presets: [
// WebPack handles ES6 --> Target Syntax
['@babel/preset-env', { modules: false }],
'@babel/preset-react',
"@babel/preset-typescript",
],
plugins: ['react-hot-loader/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
};
79 changes: 79 additions & 0 deletions extensions/dicom-microscopy/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@ohif/extension-dicom-microscopy",
"version": "3.0.0",
"description": "OHIF extension for DICOM microscopy",
"author": "Bill Wallace, md-prog, Radical Imaging",
"license": "MIT",
"main": "dist/umd/@ohif/extension-dicom-microscopy/index.umd.js",
"files": [
"dist/**",
"public/**",
"README.md"
],
"repository": "OHIF/Viewers",
"keywords": [
"ohif-extension"
],
"module": "src/index.tsx",
"engines": {
"node": ">=14",
"npm": ">=6",
"yarn": ">=1.18.0"
},
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo",
"dev:dicom-pdf": "yarn run dev",
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
"build:package": "yarn run build",
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "^3.0.0",
"@ohif/extension-default": "^3.0.0",
"@ohif/i18n": "^1.0.0",
"@ohif/ui": "^2.0.0",
"prop-types": "^15.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^10.11.0",
"react-router": "^6.8.1",
"react-router-dom": "^6.8.1",
"webpack": "^5.50.0",
"webpack-merge": "^5.7.3"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/codec-charls": "^0.1.1",
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^0.0.7",
"@cornerstonejs/codec-openjpeg": "^0.1.1",
"colormap": "^2.3",
"dicom-microscopy-viewer": "^0.44.0",
"dicomicc": "^0.1"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-arrow-functions": "^7.16.7",
"@babel/plugin-transform-regenerator": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/plugin-transform-typescript": "^7.13.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.13.0",
"babel-eslint": "^8.0.3",
"babel-loader": "^8.0.0-beta.4",
"babel-plugin-inline-react-svg": "^2.0.1",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^10.2.0",
"cross-env": "^7.0.3",
"dotenv": "^14.1.0",
"eslint": "^5.0.1",
"eslint-loader": "^2.0.0",
"webpack": "^5.50.0",
"webpack-cli": "^4.7.2",
"webpack-merge": "^5.7.3"
}
}
Loading