From ed426995bc542d1367226274851e4173174d61ae Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Fri, 30 Aug 2024 15:21:47 -0300 Subject: [PATCH 1/6] feat: add download study dialog --- platform/app/pluginConfig.json | 4 ++++ platform/app/public/config/default.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/platform/app/pluginConfig.json b/platform/app/pluginConfig.json index fefe449c93a..4bed979133e 100644 --- a/platform/app/pluginConfig.json +++ b/platform/app/pluginConfig.json @@ -65,6 +65,10 @@ { "packageName": "ohif-gcp-extension", "version": "0.0.1" + }, + { + "packageName": "ohif-idc-extension", + "version": "0.0.1" } ], "modes": [ diff --git a/platform/app/public/config/default.js b/platform/app/public/config/default.js index d9831f08a07..2777fef1afb 100644 --- a/platform/app/public/config/default.js +++ b/platform/app/public/config/default.js @@ -341,4 +341,18 @@ window.config = { keys: ['9'], }, ], + idcDownloadCommandsDialog: { + description: 'Follow the instructions below to download the study or series:', + instructions: [ + { command: 'pip install idc-index --upgrade', label: 'First, install the idc cli:' }, + { + command: `idc download {{StudyInstanceUID}}`, + label: 'Then, to download the whole study, run:', + }, + { + command: `idc download {{SeriesInstanceUID}}`, + label: "Or, to download just the active viewport's series, run:", + }, + ], + }, }; From 41db45700402239120697e5a68851c62a2a96a63 Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Mon, 9 Sep 2024 14:14:02 -0300 Subject: [PATCH 2/6] chore: add extension to package.json --- platform/app/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/app/package.json b/platform/app/package.json index a1ee4739465..df4f82ca2be 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -50,6 +50,7 @@ "dependencies": { "ohif-gcp-extension": "https://github.com/ImagingDataCommons/ohif-gcp-extension#main", "ohif-gcp-mode": "https://github.com/ImagingDataCommons/ohif-gcp-mode#main-1.0.3", + "ohif-idc-extension": "https://github.com/ImagingDataCommons/ohif-idc-extension#master", "@babel/runtime": "^7.20.13", "@cornerstonejs/codec-charls": "^1.2.3", "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", From 8e3e879ac6460f03ecd188ef46054f48137866a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20H=2E=20K=C3=B6hler?= Date: Thu, 12 Sep 2024 15:34:25 -0300 Subject: [PATCH 3/6] feat(toolbar): enable extensions to change toolbar button sections (#4367) --- .../core/src/services/ToolBarService/ToolbarService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/core/src/services/ToolBarService/ToolbarService.ts b/platform/core/src/services/ToolBarService/ToolbarService.ts index 7d80f843afe..3f8c0e85fae 100644 --- a/platform/core/src/services/ToolBarService/ToolbarService.ts +++ b/platform/core/src/services/ToolBarService/ToolbarService.ts @@ -374,8 +374,11 @@ export default class ToolbarService extends PubSubService { * @param {Array} buttons - The buttons to be added to the section. */ createButtonSection(key, buttons) { - // make sure all buttons have at least an empty props - this.state.buttonSections[key] = buttons; + if (this.state.buttonSections[key]) { + this.state.buttonSections[key].push(...buttons); + } else { + this.state.buttonSections[key] = buttons; + } this._broadcastEvent(this.EVENTS.TOOL_BAR_MODIFIED, { ...this.state }); } From 36fc2e027cb6bea82be61971a966e474a60b74b9 Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Mon, 16 Sep 2024 10:17:23 -0300 Subject: [PATCH 4/6] feat: make idc extension local --- extensions/ohif-idc-extension/.gitignore | 104 ++++++++++++++++ extensions/ohif-idc-extension/.prettierrc | 11 ++ .../.webpack/webpack.prod.js | 96 +++++++++++++++ extensions/ohif-idc-extension/LICENSE | 9 ++ extensions/ohif-idc-extension/README.md | 7 ++ .../assets/icons/download.svg | 1 + extensions/ohif-idc-extension/babel.config.js | 50 ++++++++ extensions/ohif-idc-extension/package.json | 75 ++++++++++++ .../src/DownloadStudySeriesDialog.tsx | 114 ++++++++++++++++++ extensions/ohif-idc-extension/src/id.js | 5 + extensions/ohif-idc-extension/src/index.tsx | 57 +++++++++ platform/app/.webpack/webpack.pwa.js | 1 + platform/app/package.json | 1 - 13 files changed, 530 insertions(+), 1 deletion(-) create mode 100644 extensions/ohif-idc-extension/.gitignore create mode 100644 extensions/ohif-idc-extension/.prettierrc create mode 100644 extensions/ohif-idc-extension/.webpack/webpack.prod.js create mode 100644 extensions/ohif-idc-extension/LICENSE create mode 100644 extensions/ohif-idc-extension/README.md create mode 100644 extensions/ohif-idc-extension/assets/icons/download.svg create mode 100644 extensions/ohif-idc-extension/babel.config.js create mode 100644 extensions/ohif-idc-extension/package.json create mode 100644 extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx create mode 100644 extensions/ohif-idc-extension/src/id.js create mode 100644 extensions/ohif-idc-extension/src/index.tsx diff --git a/extensions/ohif-idc-extension/.gitignore b/extensions/ohif-idc-extension/.gitignore new file mode 100644 index 00000000000..67045665db2 --- /dev/null +++ b/extensions/ohif-idc-extension/.gitignore @@ -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 diff --git a/extensions/ohif-idc-extension/.prettierrc b/extensions/ohif-idc-extension/.prettierrc new file mode 100644 index 00000000000..ef83baaef93 --- /dev/null +++ b/extensions/ohif-idc-extension/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": ["prettier-plugin-tailwindcss"], + "trailingComma": "es5", + "printWidth": 100, + "proseWrap": "always", + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "arrowParens": "avoid", + "endOfLine": "auto" +} diff --git a/extensions/ohif-idc-extension/.webpack/webpack.prod.js b/extensions/ohif-idc-extension/.webpack/webpack.prod.js new file mode 100644 index 00000000000..3a78c481305 --- /dev/null +++ b/extensions/ohif-idc-extension/.webpack/webpack.prod.js @@ -0,0 +1,96 @@ +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: /\.svg?$/, + oneOf: [ + { + use: [ + { + loader: '@svgr/webpack', + options: { + svgoConfig: { + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + removeViewBox: false + }, + }, + }, + ] + }, + prettier: false, + svgo: true, + titleProp: true, + }, + }, + ], + issuer: { + and: [/\.(ts|tsx|js|jsx|md|mdx)$/], + }, + }, + ], + }, + { + 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; diff --git a/extensions/ohif-idc-extension/LICENSE b/extensions/ohif-idc-extension/LICENSE new file mode 100644 index 00000000000..c2a3b378f61 --- /dev/null +++ b/extensions/ohif-idc-extension/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2024 ohif-idc-extension (pedro.kohler@radicalimaging.com) + +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. \ No newline at end of file diff --git a/extensions/ohif-idc-extension/README.md b/extensions/ohif-idc-extension/README.md new file mode 100644 index 00000000000..3b5b788767f --- /dev/null +++ b/extensions/ohif-idc-extension/README.md @@ -0,0 +1,7 @@ +# ohif-idc-extension +## Description +OHIF Extension for IDC +## Author +Pedro Kohler +## License +MIT \ No newline at end of file diff --git a/extensions/ohif-idc-extension/assets/icons/download.svg b/extensions/ohif-idc-extension/assets/icons/download.svg new file mode 100644 index 00000000000..aa4227a168d --- /dev/null +++ b/extensions/ohif-idc-extension/assets/icons/download.svg @@ -0,0 +1 @@ + diff --git a/extensions/ohif-idc-extension/babel.config.js b/extensions/ohif-idc-extension/babel.config.js new file mode 100644 index 00000000000..4772105a8c1 --- /dev/null +++ b/extensions/ohif-idc-extension/babel.config.js @@ -0,0 +1,50 @@ +module.exports = { + plugins: [ + ['@babel/plugin-proposal-class-properties', { loose: true }], + '@babel/plugin-transform-typescript', + ['@babel/plugin-proposal-private-property-in-object', { loose: true }], + ['@babel/plugin-proposal-private-methods', { loose: true }], + ], + 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-react', + '@babel/preset-typescript', + ], + plugins: [ + '@babel/plugin-proposal-object-rest-spread', + '@babel/plugin-syntax-dynamic-import', + '@babel/plugin-transform-regenerator', + '@babel/plugin-transform-runtime', + '@babel/plugin-transform-typescript', + ], + }, + 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-refresh/babel'], + ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'], + }, + }, +}; diff --git a/extensions/ohif-idc-extension/package.json b/extensions/ohif-idc-extension/package.json new file mode 100644 index 00000000000..e48613824fb --- /dev/null +++ b/extensions/ohif-idc-extension/package.json @@ -0,0 +1,75 @@ +{ + "name": "ohif-idc-extension", + "version": "0.0.1", + "description": "OHIF Extension for IDC", + "author": "Pedro Kohler", + "license": "MIT", + "main": "dist/umd/ohif-idc-extension/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 --output-pathinfo", + "dev:my-extension": "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.9.0-beta.74", + "@ohif/extension-default": "^3.9.0-beta.74", + "@ohif/extension-cornerstone": "^3.9.0-beta.74", + "@ohif/i18n": "^1.0.0", + "prop-types": "^15.6.2", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-i18next": "^12.2.2", + "react-router": "^6.8.1", + "react-router-dom": "^6.8.1", + "webpack": "5.89.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "@babel/runtime": "^7.20.13" + }, + "devDependencies": { + "@babel/core": "7.24.7", + "@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.24.7", + "@babel/plugin-transform-typescript": "^7.13.0", + "@babel/preset-env": "7.24.7", + "@babel/preset-react": "^7.16.7", + "@babel/preset-typescript": "^7.13.0", + "@babel/plugin-proposal-private-property-in-object": "7.21.11", + "babel-eslint": "9.x", + "babel-loader": "^8.2.4", + "@svgr/webpack": "^8.1.0", + "babel-plugin-module-resolver": "^5.0.0", + "clean-webpack-plugin": "^4.0.0", + "copy-webpack-plugin": "^10.2.0", + "cross-env": "^7.0.3", + "dotenv": "^14.1.0", + "eslint": "^8.39.0", + "eslint-loader": "^2.0.0", + "webpack": "5.89.0", + "webpack-merge": "^5.7.3", + "webpack-cli": "^5.0.2" + } +} \ No newline at end of file diff --git a/extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx b/extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx new file mode 100644 index 00000000000..5a196797e17 --- /dev/null +++ b/extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx @@ -0,0 +1,114 @@ +import { Icon } from '@ohif/ui'; +import React, { useCallback, useState } from 'react'; +import { useAppConfig } from '@state'; + +const getConfig = appConfig => { + const defaultConfig = { + description: 'Follow the instructions below to download the study or series:', + instructions: [ + { command: 'pip install idc-index --upgrade', label: 'First, install the idc cli:' }, + { + command: `idc download {{StudyInstanceUID}}`, + label: 'Then, to download the whole study, run:', + }, + { + command: `idc download {{SeriesInstanceUID}}`, + label: "Or, to download just the active viewport's series, run:", + }, + ], + }; + + const config = appConfig?.idcDownloadCommandsDialog; + + if (!config) { + return defaultConfig; + } + + return { + description: config.description ?? defaultConfig.description, + instructions: + config.instructions?.length > 0 ? config.instructions : defaultConfig.instructions, + }; +}; + +const DialogInstruction = ({ + instruction, +}: { + instruction: { command: string; label: string }; +}) => { + const [message, setMessage] = useState(''); + const { command, label } = instruction; + + const copyToClipboard = useCallback(async () => { + try { + await navigator.clipboard.writeText(command); + setMessage('Copied'); + } catch (err) { + console.error('Failed to copy: ', err); + setMessage('Failed'); + } finally { + setTimeout(() => { + resetState(); + }, 500); + } + }, [command]); + + const resetState = () => { + setMessage(null); + }; + + return ( +
+ {label ?
{label}
: <>} +
+ {command} +
+ {message || ( + <> +
+ +
+ + )} +
+
+
+ ); +}; + +const DownloadStudySeriesDialog = ({ + StudyInstanceUID, + SeriesInstanceUID, +}: { + StudyInstanceUID: string; + SeriesInstanceUID: string; +}) => { + const [appConfig] = useAppConfig(); + const config = getConfig(appConfig); + + const replaceVariables = useCallback( + text => + text + .replace(/\{\{StudyInstanceUID\}\}/g, StudyInstanceUID) + .replace(/\{\{SeriesInstanceUID\}\}/g, SeriesInstanceUID), + [StudyInstanceUID, SeriesInstanceUID] + ); + + const instructions = config.instructions.map(instruction => { + const { command, label } = instruction; + return { command: replaceVariables(command), label: replaceVariables(label) }; + }); + + return ( +
+

{config.description}

+
+ {instructions.map(instruction => ( + + ))} +
+
+ ); +}; + +export default DownloadStudySeriesDialog; diff --git a/extensions/ohif-idc-extension/src/id.js b/extensions/ohif-idc-extension/src/id.js new file mode 100644 index 00000000000..ebe5acd98ae --- /dev/null +++ b/extensions/ohif-idc-extension/src/id.js @@ -0,0 +1,5 @@ +import packageJson from '../package.json'; + +const id = packageJson.name; + +export { id }; diff --git a/extensions/ohif-idc-extension/src/index.tsx b/extensions/ohif-idc-extension/src/index.tsx new file mode 100644 index 00000000000..c7ecae7650e --- /dev/null +++ b/extensions/ohif-idc-extension/src/index.tsx @@ -0,0 +1,57 @@ +import { addIcon } from '@ohif/ui'; +import DownloadStudySeriesDialog from './DownloadStudySeriesDialog'; +import { ReactComponent as downloadIcon } from '../assets/icons/download.svg'; + +import { id } from './id'; + +const extension = { + id, + preRegistration: () => { + addIcon('download', downloadIcon); + }, + onModeEnter: ({ servicesManager }) => { + const { toolbarService, UIModalService, viewportGridService, displaySetService } = + servicesManager.services; + + const moreTools = [ + { + id: 'downloadStudySeries', + uiType: 'ohif.radioGroup', + props: { + icon: 'download', + label: 'Download Study/Series', + commands: () => { + const { activeViewportId, viewports } = viewportGridService.getState(); + const activeViewportSpecificData = viewports.get(activeViewportId); + const displaySets = displaySetService.activeDisplaySets; + + const activeDisplaySetUID = activeViewportSpecificData.displaySetInstanceUIDs[0]; + const activeDisplaySet = displaySets.find(ds => ds.uid === activeDisplaySetUID); + + if (!activeDisplaySet) { + console.error('No display set found.'); + return; + } + + const { StudyInstanceUID, SeriesInstanceUID } = activeDisplaySet; + + UIModalService.show({ + content: DownloadStudySeriesDialog, + contentProps: { + StudyInstanceUID, + SeriesInstanceUID, + }, + containerDimensions: 'w-[70%] max-w-[700px]', + title: 'Download Study/Series', + }); + }, + }, + }, + ]; + + toolbarService.addButtons([...moreTools]); + toolbarService.createButtonSection('primary', ['downloadStudySeries']); + }, +}; + +export default extension; diff --git a/platform/app/.webpack/webpack.pwa.js b/platform/app/.webpack/webpack.pwa.js index 69cc1e26064..963c02403c5 100644 --- a/platform/app/.webpack/webpack.pwa.js +++ b/platform/app/.webpack/webpack.pwa.js @@ -70,6 +70,7 @@ module.exports = (env, argv) => { // Hoisted Yarn Workspace Modules path.resolve(__dirname, '../../../node_modules'), SRC_DIR, + path.resolve(__dirname, 'extensions/ohif-idc-extension/node_modules'), ], }, plugins: [ diff --git a/platform/app/package.json b/platform/app/package.json index df4f82ca2be..a1ee4739465 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -50,7 +50,6 @@ "dependencies": { "ohif-gcp-extension": "https://github.com/ImagingDataCommons/ohif-gcp-extension#main", "ohif-gcp-mode": "https://github.com/ImagingDataCommons/ohif-gcp-mode#main-1.0.3", - "ohif-idc-extension": "https://github.com/ImagingDataCommons/ohif-idc-extension#master", "@babel/runtime": "^7.20.13", "@cornerstonejs/codec-charls": "^1.2.3", "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", From 8598efcb5852d83a2766c1b6c84c0b76adececdd Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Mon, 16 Sep 2024 10:38:31 -0300 Subject: [PATCH 5/6] fix: package name --- extensions/{ohif-idc-extension => idc}/.gitignore | 0 extensions/{ohif-idc-extension => idc}/.prettierrc | 0 .../{ohif-idc-extension => idc}/.webpack/webpack.prod.js | 0 extensions/{ohif-idc-extension => idc}/LICENSE | 0 extensions/{ohif-idc-extension => idc}/README.md | 0 .../{ohif-idc-extension => idc}/assets/icons/download.svg | 0 extensions/{ohif-idc-extension => idc}/babel.config.js | 0 extensions/{ohif-idc-extension => idc}/package.json | 4 ++-- .../src/DownloadStudySeriesDialog.tsx | 0 extensions/{ohif-idc-extension => idc}/src/id.js | 0 extensions/{ohif-idc-extension => idc}/src/index.tsx | 0 platform/app/.webpack/webpack.pwa.js | 1 - platform/app/package.json | 1 + platform/app/pluginConfig.json | 2 +- 14 files changed, 4 insertions(+), 4 deletions(-) rename extensions/{ohif-idc-extension => idc}/.gitignore (100%) rename extensions/{ohif-idc-extension => idc}/.prettierrc (100%) rename extensions/{ohif-idc-extension => idc}/.webpack/webpack.prod.js (100%) rename extensions/{ohif-idc-extension => idc}/LICENSE (100%) rename extensions/{ohif-idc-extension => idc}/README.md (100%) rename extensions/{ohif-idc-extension => idc}/assets/icons/download.svg (100%) rename extensions/{ohif-idc-extension => idc}/babel.config.js (100%) rename extensions/{ohif-idc-extension => idc}/package.json (98%) rename extensions/{ohif-idc-extension => idc}/src/DownloadStudySeriesDialog.tsx (100%) rename extensions/{ohif-idc-extension => idc}/src/id.js (100%) rename extensions/{ohif-idc-extension => idc}/src/index.tsx (100%) diff --git a/extensions/ohif-idc-extension/.gitignore b/extensions/idc/.gitignore similarity index 100% rename from extensions/ohif-idc-extension/.gitignore rename to extensions/idc/.gitignore diff --git a/extensions/ohif-idc-extension/.prettierrc b/extensions/idc/.prettierrc similarity index 100% rename from extensions/ohif-idc-extension/.prettierrc rename to extensions/idc/.prettierrc diff --git a/extensions/ohif-idc-extension/.webpack/webpack.prod.js b/extensions/idc/.webpack/webpack.prod.js similarity index 100% rename from extensions/ohif-idc-extension/.webpack/webpack.prod.js rename to extensions/idc/.webpack/webpack.prod.js diff --git a/extensions/ohif-idc-extension/LICENSE b/extensions/idc/LICENSE similarity index 100% rename from extensions/ohif-idc-extension/LICENSE rename to extensions/idc/LICENSE diff --git a/extensions/ohif-idc-extension/README.md b/extensions/idc/README.md similarity index 100% rename from extensions/ohif-idc-extension/README.md rename to extensions/idc/README.md diff --git a/extensions/ohif-idc-extension/assets/icons/download.svg b/extensions/idc/assets/icons/download.svg similarity index 100% rename from extensions/ohif-idc-extension/assets/icons/download.svg rename to extensions/idc/assets/icons/download.svg diff --git a/extensions/ohif-idc-extension/babel.config.js b/extensions/idc/babel.config.js similarity index 100% rename from extensions/ohif-idc-extension/babel.config.js rename to extensions/idc/babel.config.js diff --git a/extensions/ohif-idc-extension/package.json b/extensions/idc/package.json similarity index 98% rename from extensions/ohif-idc-extension/package.json rename to extensions/idc/package.json index e48613824fb..ddef4260dd0 100644 --- a/extensions/ohif-idc-extension/package.json +++ b/extensions/idc/package.json @@ -1,5 +1,5 @@ { - "name": "ohif-idc-extension", + "name": "@ohif/extension-idc", "version": "0.0.1", "description": "OHIF Extension for IDC", "author": "Pedro Kohler", @@ -72,4 +72,4 @@ "webpack-merge": "^5.7.3", "webpack-cli": "^5.0.2" } -} \ No newline at end of file +} diff --git a/extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx b/extensions/idc/src/DownloadStudySeriesDialog.tsx similarity index 100% rename from extensions/ohif-idc-extension/src/DownloadStudySeriesDialog.tsx rename to extensions/idc/src/DownloadStudySeriesDialog.tsx diff --git a/extensions/ohif-idc-extension/src/id.js b/extensions/idc/src/id.js similarity index 100% rename from extensions/ohif-idc-extension/src/id.js rename to extensions/idc/src/id.js diff --git a/extensions/ohif-idc-extension/src/index.tsx b/extensions/idc/src/index.tsx similarity index 100% rename from extensions/ohif-idc-extension/src/index.tsx rename to extensions/idc/src/index.tsx diff --git a/platform/app/.webpack/webpack.pwa.js b/platform/app/.webpack/webpack.pwa.js index 963c02403c5..69cc1e26064 100644 --- a/platform/app/.webpack/webpack.pwa.js +++ b/platform/app/.webpack/webpack.pwa.js @@ -70,7 +70,6 @@ module.exports = (env, argv) => { // Hoisted Yarn Workspace Modules path.resolve(__dirname, '../../../node_modules'), SRC_DIR, - path.resolve(__dirname, 'extensions/ohif-idc-extension/node_modules'), ], }, plugins: [ diff --git a/platform/app/package.json b/platform/app/package.json index a1ee4739465..1e24ac7c276 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -67,6 +67,7 @@ "@ohif/extension-dicom-pdf": "3.9.0-beta.74", "@ohif/extension-dicom-video": "3.9.0-beta.74", "@ohif/extension-test": "3.9.0-beta.74", + "@ohif/extension-idc": "0.0.1", "@ohif/i18n": "3.9.0-beta.74", "@ohif/mode-basic-dev-mode": "3.9.0-beta.74", "@ohif/mode-longitudinal": "3.9.0-beta.74", diff --git a/platform/app/pluginConfig.json b/platform/app/pluginConfig.json index 4bed979133e..f1767e299cd 100644 --- a/platform/app/pluginConfig.json +++ b/platform/app/pluginConfig.json @@ -67,7 +67,7 @@ "version": "0.0.1" }, { - "packageName": "ohif-idc-extension", + "packageName": "@ohif/extension-idc", "version": "0.0.1" } ], From 55e1c0fb8faf970c701438e12fb83004f3dea1be Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Wed, 25 Sep 2024 11:51:17 -0300 Subject: [PATCH 6/6] chore: change text --- extensions/idc/src/DownloadStudySeriesDialog.tsx | 5 ++++- platform/app/public/config/default.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/idc/src/DownloadStudySeriesDialog.tsx b/extensions/idc/src/DownloadStudySeriesDialog.tsx index 5a196797e17..25c28feec78 100644 --- a/extensions/idc/src/DownloadStudySeriesDialog.tsx +++ b/extensions/idc/src/DownloadStudySeriesDialog.tsx @@ -6,7 +6,10 @@ const getConfig = appConfig => { const defaultConfig = { description: 'Follow the instructions below to download the study or series:', instructions: [ - { command: 'pip install idc-index --upgrade', label: 'First, install the idc cli:' }, + { + command: 'pip install idc-index --upgrade', + label: 'First, install the idc-index python package:', + }, { command: `idc download {{StudyInstanceUID}}`, label: 'Then, to download the whole study, run:', diff --git a/platform/app/public/config/default.js b/platform/app/public/config/default.js index 2777fef1afb..7a8cfc5335a 100644 --- a/platform/app/public/config/default.js +++ b/platform/app/public/config/default.js @@ -344,7 +344,10 @@ window.config = { idcDownloadCommandsDialog: { description: 'Follow the instructions below to download the study or series:', instructions: [ - { command: 'pip install idc-index --upgrade', label: 'First, install the idc cli:' }, + { + command: 'pip install idc-index --upgrade', + label: 'First, install the idc-index python package:', + }, { command: `idc download {{StudyInstanceUID}}`, label: 'Then, to download the whole study, run:',