Skip to content

Commit

Permalink
reduce the diff
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Oct 10, 2023
1 parent b2601ba commit ec9bacc
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 172 deletions.
4 changes: 3 additions & 1 deletion .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
},
},
cssToJavaScript,
stylusToJavaScript,
// Note: Only uncomment the following if you are using the old style of stylus in v2
// Also you need to uncomment this platform/app/.webpack/rules/extractStyleChunks.js
// stylusToJavaScript,
{
test: /\.wasm/,
type: 'asset/resource',
Expand Down
1 change: 0 additions & 1 deletion extensions/cornerstone-dicom-seg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"react-router-dom": "^6.8.1"
},
"dependencies": {
"@cornerstonejs/tools": "^1.16.0",
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.20.3",
"@cornerstonejs/tools": "^1.20.3",
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions extensions/cornerstone/src/commandsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,10 @@ function commandsModule({
cornerstoneViewportService,
uiNotificationService,
measurementService,
hangingProtocolService,
segmentationService,
} = servicesManager.services as CornerstoneServices;

const { measurementServiceSource } = this;

function _getMatchedViewportsToolGroupIds() {
const { viewportMatchDetails } = hangingProtocolService.getMatchDetails();
const toolGroupIds = [];

viewportMatchDetails.forEach((matchDetails, viewportIndex) => {
const { toolGroupId } = matchDetails.viewportOptions;
if (toolGroupIds.indexOf(toolGroupId) === -1) {
toolGroupIds.push(toolGroupId);
}
});

return toolGroupIds;
}

function _getActiveViewportEnabledElement() {
return getActiveViewportEnabledElement(viewportGridService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ class SegmentationService extends PubSubService {

return segments[activeSegmentIndex];
}

/**
* Get specific segmentation by its id.
*
Expand Down Expand Up @@ -1333,6 +1334,8 @@ class SegmentationService extends PubSubService {
}
}

this._setDisplaySetIsHydrated(segmentationId, false);

this._broadcastEvent(this.EVENTS.SEGMENTATION_REMOVED, {
segmentationId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
const overlayDisplaySet = displaySetInstanceUIDs
.map(displaySetService.getDisplaySetByUID)
.find(displaySet => displaySet?.isOverlayDisplaySet);

if (overlayDisplaySet) {
this.addOverlayRepresentationForDisplaySet(overlayDisplaySet, viewport);
} else {
Expand Down
7 changes: 5 additions & 2 deletions modes/segmentation/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"trailingComma": "es5",
"printWidth": 80,
"printWidth": 100,
"proseWrap": "always",
"tabWidth": 2,
"semi": true,
"singleQuote": true
"singleQuote": true,
"arrowParens": "avoid",
"singleAttributePerLine": true,
"endOfLine": "auto"
}
9 changes: 3 additions & 6 deletions modes/segmentation/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ const cornerstone = {

const segmentation = {
panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',
panelTool:
'@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools',
sopClassHandler:
'@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
panelTool: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools',
sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',
};

Expand Down Expand Up @@ -52,8 +50,7 @@ function modeFactory({ modeConfiguration }) {
* Services and other resources.
*/
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
const { measurementService, toolbarService, toolGroupService } =
servicesManager.services;
const { measurementService, toolbarService, toolGroupService } = servicesManager.services;

measurementService.clearMeasurements();

Expand Down
31 changes: 6 additions & 25 deletions modes/segmentation/src/initToolGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,13 @@ function createTools(utilityModule) {
const { toolNames, Enums } = utilityModule.exports;
return {
active: [
{
toolName: toolNames.WindowLevel,
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
},
{
toolName: toolNames.Pan,
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
},
{
toolName: toolNames.Zoom,
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
},
{ toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },
{ toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },
{ toolName: toolNames.Zoom, bindings: [{ mouseButton: Enums.MouseBindings.Secondary }] },
{ toolName: toolNames.StackScrollMouseWheel, bindings: [] },
],
passive: Object.keys(brushInstanceNames)
.map((brushName) => ({
.map(brushName => ({
toolName: brushName,
parentTool: 'Brush',
configuration: {
Expand All @@ -54,12 +45,7 @@ function createTools(utilityModule) {
};
}

function initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
toolGroupId
) {
function initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
);
Expand Down Expand Up @@ -89,12 +75,7 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
}

function initToolGroups(extensionManager, toolGroupService, commandsManager) {
initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
'default'
);
initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');
initMPRToolGroup(extensionManager, toolGroupService, commandsManager);
}

Expand Down
2 changes: 1 addition & 1 deletion modes/segmentation/src/toolbarButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const toolGroupIds = ['default', 'mpr', 'SRToolGroup'];
* @returns {Array} an array of 'setToolActive' commands
*/
function _createSetToolActiveCommands(toolName) {
const temp = toolGroupIds.map((toolGroupId) => ({
const temp = toolGroupIds.map(toolGroupId => ({
commandName: 'setToolActive',
commandOptions: {
toolGroupId,
Expand Down
27 changes: 14 additions & 13 deletions platform/app/.webpack/rules/extractStyleChunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');

function extractStyleChunks(isProdBuild) {
return [
{
test: /\.styl$/,
use: [
{
loader: ExtractCssChunksPlugin.loader,
options: {
hot: !isProdBuild,
},
},
{ loader: 'css-loader' },
{ loader: 'stylus-loader' },
],
},
// If you are using the old stylus, you should uncomment this
// {
// test: /\.styl$/,
// use: [
// {
// loader: ExtractCssChunksPlugin.loader,
// options: {
// hot: !isProdBuild,
// },
// },
// { loader: 'css-loader' },
// { loader: 'stylus-loader' },
// ],
// },
{
test: /\.(sa|sc|c)ss$/,
use: [
Expand Down
1 change: 1 addition & 0 deletions platform/app/src/components/ViewportGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ function _getViewportComponent(displaySets, viewportComponents, uiNotificationSe
}
}

console.log("Can't show displaySet", SOPClassHandlerId, displaySets[0]);
uiNotificationService.show({
title: 'Viewport Not Supported Yet',
message: `Cannot display SOPClassUID of ${displaySets[0].SOPClassUID} yet`,
Expand Down
2 changes: 0 additions & 2 deletions platform/app/src/routes/WorkList/WorkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { useAppConfig } from '@state';
import { useDebounce, useSearchParams } from '@hooks';
import { utils, hotkeys, ServicesManager } from '@ohif/core';

// New

import {
Icon,
StudyListExpandedRow,
Expand Down
21 changes: 7 additions & 14 deletions platform/cli/templates/mode/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ const ohif = {
sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',
hangingProtocol: '@ohif/extension-default.hangingProtocolModule.default',
thumbnailList: '@ohif/extension-default.panelModule.seriesList',
thumbnailListTracking:
'@ohif/extension-measurement-tracking.panelModule.seriesList',
viewport:
'@ohif/extension-measurement-tracking.viewportModule.cornerstone-tracked',
measurements:
'@ohif/extension-measurement-tracking.panelModule.trackedMeasurements',
thumbnailListTracking: '@ohif/extension-measurement-tracking.panelModule.seriesList',
viewport: '@ohif/extension-measurement-tracking.viewportModule.cornerstone-tracked',
measurements: '@ohif/extension-measurement-tracking.panelModule.trackedMeasurements',
measurementNoTracking: '@ohif/extension-default.panelModule.measure',
};

const dicomsr = {
sopClassHandler:
'@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr',
sopClassHandler: '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr',
viewport: '@ohif/extension-cornerstone-dicom-sr.viewportModule.dicom-sr',
};

const dicomvideo = {
sopClassHandler:
'@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
};

Expand All @@ -34,16 +29,14 @@ const dicompdf = {
};

const dicomSeg = {
sopClassHandler:
'@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',
panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',
};

const dicomRT = {
viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',
sopClassHandler:
'@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',
sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',
};

const extensionDependencies = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ export default class HangingProtocolService extends PubSubService {
const matchingScores = [];
let highestSeriesMatchingScore = 0;

// console.log('ProtocolEngine::matchImages', studyMatchingRules, seriesMatchingRules);
console.log('ProtocolEngine::matchImages', studyMatchingRules, seriesMatchingRules);
const matchActiveOnly = this.protocol.numberOfPriorsReferenced === -1;
this.studies.forEach((study, studyInstanceUIDsIndex) => {
// Skip non-active if active only
Expand Down
1 change: 0 additions & 1 deletion platform/ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export {
Select,
SegmentationTable,
SegmentationGroupTable,
SegmentationGroup,
SidePanel,
SplitButton,
StudyBrowser,
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "3.7.0-beta.106",
"commit": "a9a6ad50eae67b43b8b34efc07182d788cacdcfe"
}
}

0 comments on commit ec9bacc

Please sign in to comment.