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 }) => ( + +); + +const computedstyle = getComputedStyle(document.body); +const uiGrayDarker = computedstyle.getPropertyValue('--ui-gray-darker'); +const activeColor = computedstyle.getPropertyValue('--active-color'); +const defaultColor = computedstyle.getPropertyValue('--default-color'); +const uiGrayDark = computedstyle.getPropertyValue('--ui-gray-dark'); + +const dicomBrowserSelectStyles = { + singleValue: (base, state) => ({ + ...base, + width: '100%', + }), + control: (base, state) => ({ + ...base, + cursor: 'pointer', + background: uiGrayDarker, + borderRadius: state.isFocused ? '5px 5px 5px 5px' : 5, + borderColor: state.isFocused ? activeColor : defaultColor, + minHeight: '50px', + '&:hover': { + borderColor: activeColor, + }, + }), + menu: base => ({ + ...base, + borderRadius: 5, + background: uiGrayDarker, + }), + option: (base, state) => ({ + ...base, + cursor: 'pointer', + '&:first-of-type': { + borderTopLeftRadius: 5, + borderTopRightRadius: 5, + }, + '&:last-of-type': { + borderBottomLeftRadius: 5, + borderBottomRightRadius: 5, + }, + background: state.isSelected ? uiGrayDark : uiGrayDarker, + '&:hover': { + background: uiGrayDark, + }, + }), +}; + +export default DicomBrowserSelect; diff --git a/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.css b/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.css new file mode 100644 index 000000000..bc65eee35 --- /dev/null +++ b/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.css @@ -0,0 +1,25 @@ +.dcmseg-segmentation-item { + display: flex; + justify-content: start; + margin: 0; +} + +.dcmseg-segmentation-item .segmentation-meta { + display: flex; + flex-direction: column; + flex-grow: 1; + overflow: hidden; +} + +.dcmseg-segmentation-item .segmentation-meta-title { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: white; + max-width: calc(100% - 30px); +} + +.dcmseg-segmentation-item .segmentation-meta-description { + font-size: 12px; + color: var(--text-secondary-color); +} diff --git a/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.js b/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.js new file mode 100644 index 000000000..428ed6413 --- /dev/null +++ b/extensions/dicom-tag-browser/src/components/DicomBrowserSelectItem.js @@ -0,0 +1,27 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +import './DicomBrowserSelectItem.css'; + +const DicomBrowserSelectItem = ({ onClick, title, description }) => { + return ( +
| Tag | +Value Representation | +Keyword | +Value | +
|---|---|---|---|
| {row[0]} | +{row[1]} | +{row[2]} | +{row[3]} | +