diff --git a/extensions/dicom-html/src/OHIFDicomHtmlSopClassHandler.js b/extensions/dicom-html/src/OHIFDicomHtmlSopClassHandler.js index f94ea055c..c1bc4fc3a 100644 --- a/extensions/dicom-html/src/OHIFDicomHtmlSopClassHandler.js +++ b/extensions/dicom-html/src/OHIFDicomHtmlSopClassHandler.js @@ -22,11 +22,13 @@ const OHIFDicomHtmlSopClassHandler = { getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) { const instance = series.getFirstInstance(); + const metadata = instance.getData().metadata; const { + SeriesDescription, + SeriesNumber, SeriesDate, SeriesTime, - SeriesNumber, - } = instance._instance.metadata; + } = metadata; return { plugin: 'html', @@ -37,6 +39,8 @@ const OHIFDicomHtmlSopClassHandler = { SOPInstanceUID: instance.getSOPInstanceUID(), SeriesInstanceUID: series.getSeriesInstanceUID(), StudyInstanceUID: study.getStudyInstanceUID(), + SeriesDescription, + metadata, SeriesDate, SeriesTime, SeriesNumber, diff --git a/extensions/dicom-microscopy/src/DicomMicroscopySopClassHandler.js b/extensions/dicom-microscopy/src/DicomMicroscopySopClassHandler.js index 909e39bf2..a876b6122 100644 --- a/extensions/dicom-microscopy/src/DicomMicroscopySopClassHandler.js +++ b/extensions/dicom-microscopy/src/DicomMicroscopySopClassHandler.js @@ -12,11 +12,13 @@ const DicomMicroscopySopClassHandler = { getDisplaySetFromSeries(series, study, dicomWebClient) { const instance = series.getFirstInstance(); + const metadata = instance.getData().metadata; const { + SeriesDescription, + SeriesNumber, ContentDate, ContentTime, - SeriesNumber, - } = instance._instance.metadata; + } = metadata; // Note: We are passing the dicomweb client into each viewport! @@ -28,9 +30,11 @@ const DicomMicroscopySopClassHandler = { SOPInstanceUID: instance.getSOPInstanceUID(), SeriesInstanceUID: series.getSeriesInstanceUID(), StudyInstanceUID: study.getStudyInstanceUID(), + SeriesDescription, SeriesDate: ContentDate, // Map ContentDate/Time to SeriesTime for series list sorting. SeriesTime: ContentTime, SeriesNumber, + metadata, }; }, }; diff --git a/extensions/dicom-pdf/src/OHIFDicomPDFSopClassHandler.js b/extensions/dicom-pdf/src/OHIFDicomPDFSopClassHandler.js index 9550ed80f..452b843bd 100644 --- a/extensions/dicom-pdf/src/OHIFDicomPDFSopClassHandler.js +++ b/extensions/dicom-pdf/src/OHIFDicomPDFSopClassHandler.js @@ -12,11 +12,13 @@ const OHIFDicomPDFSopClassHandler = { getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) { const instance = series.getFirstInstance(); + const metadata = instance.getData().metadata; const { ContentDate, ContentTime, + SeriesDescription, SeriesNumber, - } = instance._instance.metadata; + } = metadata; return { plugin: 'pdf', @@ -27,9 +29,11 @@ const OHIFDicomPDFSopClassHandler = { SOPInstanceUID: instance.getSOPInstanceUID(), SeriesInstanceUID: series.getSeriesInstanceUID(), StudyInstanceUID: study.getStudyInstanceUID(), + SeriesDescription, SeriesDate: ContentDate, // Map ContentDate/Time to SeriesTime for series list sorting. SeriesTime: ContentTime, SeriesNumber, + metadata, authorizationHeaders: authorizationHeaders, }; }, diff --git a/extensions/dicom-rt/src/OHIFDicomRTStructSopClassHandler.js b/extensions/dicom-rt/src/OHIFDicomRTStructSopClassHandler.js index 0aae17761..4f624cfa6 100644 --- a/extensions/dicom-rt/src/OHIFDicomRTStructSopClassHandler.js +++ b/extensions/dicom-rt/src/OHIFDicomRTStructSopClassHandler.js @@ -56,6 +56,7 @@ const OHIFDicomRTStructSopClassHandler = { SeriesTime, SeriesNumber, SeriesDescription, + metadata, }; if (!metadata.ReferencedSeriesSequence) { diff --git a/extensions/dicom-segmentation/src/getOHIFDicomSegSopClassHandler.js b/extensions/dicom-segmentation/src/getOHIFDicomSegSopClassHandler.js index 83f84ed42..2a3c5ad30 100644 --- a/extensions/dicom-segmentation/src/getOHIFDicomSegSopClassHandler.js +++ b/extensions/dicom-segmentation/src/getOHIFDicomSegSopClassHandler.js @@ -28,12 +28,12 @@ export default function getSopClassHandlerModule({ servicesManager }) { const { SeriesDate, SeriesTime, - SeriesNumber, SeriesDescription, FrameOfReferenceUID, SOPInstanceUID, SeriesInstanceUID, StudyInstanceUID, + SeriesNumber, } = metadata; const segDisplaySet = { @@ -55,6 +55,7 @@ export default function getSopClassHandlerModule({ servicesManager }) { SeriesTime, SeriesNumber, SeriesDescription, + metadata, }; segDisplaySet.getSourceDisplaySet = function(studies) { diff --git a/extensions/dicom-tag-browser/.webpack/webpack.dev.js b/extensions/dicom-tag-browser/.webpack/webpack.dev.js new file mode 100644 index 000000000..1ae308448 --- /dev/null +++ b/extensions/dicom-tag-browser/.webpack/webpack.dev.js @@ -0,0 +1,8 @@ +const path = require('path'); +const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +const SRC_DIR = path.join(__dirname, '../src'); +const DIST_DIR = path.join(__dirname, '../dist'); + +module.exports = (env, argv) => { + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); +}; diff --git a/extensions/dicom-tag-browser/.webpack/webpack.prod.js b/extensions/dicom-tag-browser/.webpack/webpack.prod.js new file mode 100644 index 000000000..31dff1ae7 --- /dev/null +++ b/extensions/dicom-tag-browser/.webpack/webpack.prod.js @@ -0,0 +1,38 @@ +const merge = require('webpack-merge'); +const path = require('path'); +const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +const pkg = require('./../package.json'); + +const ROOT_DIR = path.join(__dirname, './..'); +const SRC_DIR = path.join(__dirname, '../src'); +const DIST_DIR = path.join(__dirname, '../dist'); + +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + + return merge(commonConfig, { + devtool: 'source-map', + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: true, + }, + output: { + path: ROOT_DIR, + library: 'OHIFExtDicomP10Downloader', + libraryTarget: 'umd', + libraryExport: 'default', + filename: pkg.main, + }, + }); +}; diff --git a/extensions/dicom-tag-browser/LICENSE b/extensions/dicom-tag-browser/LICENSE new file mode 100644 index 000000000..19e20dd35 --- /dev/null +++ b/extensions/dicom-tag-browser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Open Health Imaging Foundation + +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. diff --git a/extensions/dicom-tag-browser/README.md b/extensions/dicom-tag-browser/README.md new file mode 100644 index 000000000..f666b3ef9 --- /dev/null +++ b/extensions/dicom-tag-browser/README.md @@ -0,0 +1 @@ +# @ohif/extension-dicom-tag-browser diff --git a/extensions/dicom-tag-browser/package.json b/extensions/dicom-tag-browser/package.json new file mode 100644 index 000000000..279662729 --- /dev/null +++ b/extensions/dicom-tag-browser/package.json @@ -0,0 +1,40 @@ +{ + "name": "@ohif/extension-dicom-tag-browser", + "version": "0.0.1", + "description": "OHIF extension for checking DICOM headers.", + "author": "OHIF", + "license": "MIT", + "repository": "OHIF/Viewers", + "main": "dist/index.umd.js", + "module": "src/index.js", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=10", + "npm": ">=6", + "yarn": ">=1.16.0" + }, + "files": [ + "dist", + "README.md" + ], + "scripts": { + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", + "build:package": "yarn run build", + "prepublishOnly": "yarn run build", + "start": "yarn run dev" + }, + "peerDependencies": { + "@ohif/core": "^2.6.0", + "react": "^16.8.6", + "dcmjs": "0.16.0" + }, + "dependencies": { + "@babel/runtime": "^7.5.5", + "dicomweb-client": "^0.6.0", + "react-select": "^3.0.8", + "moment": "2.24.0" + } +} diff --git a/extensions/dicom-tag-browser/src/components/DicomBrowserSelect.js b/extensions/dicom-tag-browser/src/components/DicomBrowserSelect.js new file mode 100644 index 000000000..f8d62f878 --- /dev/null +++ b/extensions/dicom-tag-browser/src/components/DicomBrowserSelect.js @@ -0,0 +1,58 @@ +import React from 'react'; +import Select from 'react-select'; + +const DicomBrowserSelect = ({ value, formatOptionLabel, options }) => ( +