feat(microscopy): add dicom microscopy extension and mode (#3247)
* skeleton for dicom-microscopy extension * skeleton for microscopy mode * [feat] ported @radicalimaging/microscopy-dicom to OHIF's default extension * [feat] ported microscopy mode from private repo * added new definitions to the package.json * webpack configuration update for microscopy extension * register new icons for microscopy tools * fixes to the microscopy extension and mode * trivial error fix - typescript type import error * link microscopy extension with default OHIF app plugin config * demo config fix * fix logs * remove unsed imports * [fix] loading of microscopy * [fix] webworker script loading, normalizing denaturalized dataset * found the latest version of dicom-microscopy-viewer that works with current OHIF extension : 0.35.2 * hide thumbnail pane by default, as we have issues with * comments * remove unused code * [feat] microscopy - annotation selection * [feat] microscopy - edit annotation label * wip * [bugfix] dicom-microscopy tool * [bugfix] dicom microscopy annotations * [fix] mixed-content blocking caused by BulkDataURI * [fix] microscopy measurements panel - center button * [fix] microscopy measurements panel - styling * [fix] microscopy - controls * fix local loading of microscopy * fix local loading of dicom microscopy * fix typo - indexof to indexOf * [fix] remove unused icons * remove commented out lines from webpack configuration * platform/viewer/public/config/default.js - revert accidental changes * [refactor] redirecting to microscopy mode on Local mode * attribution to DMV and SLIM viewer * [fix] code review feedbacks * fix thumbnails * [fix] microscopy - fix old publisher.publish() to PubSubService._broadcastEvent() * [fix] interactions, webpack config, roi selection * [feat] microscopy - remove select tool from UI * microscopy author * [fix] saving and loading SR * [bugfix] - missing publish() function in MicroscopyService, replace with _broadcastEvent * remove author section from readme * refactor SR saving feature * fix webpack config after merge * [bugfix] repeated import * fix e2e * webpack configuration * hide "Create report" button for microscopy
This commit is contained in:
76 files changed
+5868
-31
No files matched your search
@@ -10,7 +10,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const { InjectManifest } = require('workbox-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
// ~~ Directories
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
@@ -101,6 +100,21 @@ module.exports = (env, argv) => {
|
||||
from: `${PUBLIC_DIR}/${APP_CONFIG}`,
|
||||
to: `${DIST_DIR}/app-config.js`,
|
||||
},
|
||||
// Copy Dicom Microscopy Viewer build files
|
||||
{
|
||||
from:
|
||||
'../../../node_modules/dicom-microscopy-viewer/dist/dynamic-import',
|
||||
to: DIST_DIR,
|
||||
globOptions: {
|
||||
ignore: ['*.js.map'],
|
||||
},
|
||||
},
|
||||
// Copy dicom-image-loader build files
|
||||
{
|
||||
from:
|
||||
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import',
|
||||
to: DIST_DIR,
|
||||
},
|
||||
],
|
||||
}),
|
||||
// Generate "index.html" w/ correct includes/imports
|
||||
@@ -120,15 +134,6 @@ module.exports = (env, argv) => {
|
||||
// Need to exclude the theme as it is updated independently
|
||||
exclude: [/theme/],
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from:
|
||||
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import',
|
||||
to: DIST_DIR,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
// https://webpack.js.org/configuration/dev-server/
|
||||
devServer: {
|
||||
|
||||
@@ -55,11 +55,13 @@
|
||||
"@ohif/extension-default": "^3.0.0",
|
||||
"@ohif/extension-dicom-pdf": "^3.0.1",
|
||||
"@ohif/extension-dicom-video": "^3.0.1",
|
||||
"@ohif/extension-dicom-microscopy": "^3.0.0",
|
||||
"@ohif/extension-test": "0.0.1",
|
||||
"@ohif/i18n": "^1.0.0",
|
||||
"@ohif/mode-basic-dev-mode": "^3.0.0",
|
||||
"@ohif/mode-test": "^0.0.1",
|
||||
"@ohif/mode-longitudinal": "^3.0.0",
|
||||
"@ohif/mode-microscopy": "^3.0.0",
|
||||
"@ohif/ui": "^2.0.0",
|
||||
"@types/react": "^17.0.38",
|
||||
"classnames": "^2.3.2",
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
"packageName": "@ohif/extension-default",
|
||||
"version": "3.0.0"
|
||||
},
|
||||
{
|
||||
"packageName": "@ohif/extension-dicom-microscopy",
|
||||
"version": "3.0.0"
|
||||
},
|
||||
{
|
||||
"packageName": "@ohif/extension-dicom-pdf",
|
||||
"version": "3.0.1"
|
||||
@@ -42,6 +46,10 @@
|
||||
"packageName": "@ohif/mode-longitudinal",
|
||||
"version": "3.0.0"
|
||||
},
|
||||
{
|
||||
"packageName": "@ohif/mode-microscopy",
|
||||
"version": "3.0.0"
|
||||
},
|
||||
{
|
||||
"packageName": "@ohif/mode-tmtv",
|
||||
"version": "3.0.0"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
window.config = {
|
||||
routerBasename: '/',
|
||||
modes: [],
|
||||
extensions: [],
|
||||
showStudyList: true,
|
||||
// below flag is for performance reasons, but it might not work for all servers
|
||||
@@ -7,21 +8,24 @@ window.config = {
|
||||
showWarningMessageForCrossOrigin: true,
|
||||
strictZSpacingForVolumeViewport: true,
|
||||
showCPUFallbackMessage: true,
|
||||
servers: {
|
||||
dicomWeb: [
|
||||
{
|
||||
dataSources: [
|
||||
{
|
||||
friendlyName: 'DCM4CHEE Server',
|
||||
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
||||
sourceName: 'dicomweb',
|
||||
configuration: {
|
||||
name: 'DCM4CHEE',
|
||||
wadoUriRoot: 'https://domvja9iplmyu.cloudfront.net/dicomweb',
|
||||
qidoRoot: 'https://domvja9iplmyu.cloudfront.net/dicomweb',
|
||||
wadoRoot: 'https://domvja9iplmyu.cloudfront.net/dicomweb',
|
||||
qidoSupportsIncludeField: true,
|
||||
imageRendering: 'wadors',
|
||||
thumbnailRendering: 'wadors',
|
||||
enableStudyLazyLoad: true,
|
||||
useBulkDataURI: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
defaultDataSourceName: 'dicomweb',
|
||||
hotkeys: [
|
||||
{
|
||||
commandName: 'incrementActiveViewport',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { MODULE_TYPES } from '@ohif/core';
|
||||
import { DicomMetadataStore, MODULE_TYPES } from '@ohif/core';
|
||||
|
||||
import Dropzone from 'react-dropzone';
|
||||
import filesToStudies from './filesToStudies';
|
||||
@@ -60,12 +60,41 @@ function Local() {
|
||||
const firstLocalDataSource = localDataSources[0];
|
||||
const dataSource = firstLocalDataSource.createDataSource({});
|
||||
|
||||
const microscopyExtensionLoaded = extensionManager.registeredExtensionIds.includes(
|
||||
'@ohif/extension-dicom-microscopy'
|
||||
);
|
||||
|
||||
let modePath = 'viewer';
|
||||
|
||||
const onDrop = async acceptedFiles => {
|
||||
const studies = await filesToStudies(acceptedFiles, dataSource);
|
||||
// Todo: navigate to work list and let user select a mode
|
||||
|
||||
const query = new URLSearchParams();
|
||||
|
||||
if (microscopyExtensionLoaded) {
|
||||
// TODO: for microscopy, we are forcing microscopy mode, which is not ideal.
|
||||
// we should make the local drag and drop navigate to the worklist and
|
||||
// there user can select microscopy mode
|
||||
const smStudies = studies.filter(id => {
|
||||
const study = DicomMetadataStore.getStudy(id);
|
||||
return (
|
||||
study.series.findIndex(
|
||||
s => s.Modality === 'SM' || s.instances[0].Modality === 'SM'
|
||||
) >= 0
|
||||
);
|
||||
});
|
||||
|
||||
if (smStudies.length > 0) {
|
||||
smStudies.forEach(id => query.append('StudyInstanceUIDs', id));
|
||||
|
||||
modePath = 'microscopy';
|
||||
}
|
||||
}
|
||||
|
||||
// Todo: navigate to work list and let user select a mode
|
||||
studies.forEach(id => query.append('StudyInstanceUIDs', id));
|
||||
navigate(`/viewer/dicomlocal?${decodeURIComponent(query.toString())}`);
|
||||
|
||||
navigate(`/${modePath}/dicomlocal?${decodeURIComponent(query.toString())}`);
|
||||
};
|
||||
|
||||
// Set body style
|
||||
|
||||
Reference in new issue
Block a user