chore(prettier): full repo linting and code reformatting once and for all (#3627)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-01 16:19:39 -04:00
1 parent 01500a2d4c
commit 9045ddaedc
656 files changed
+21737 -20628

No files matched your search

+8 -23
View File
@@ -43,12 +43,8 @@ function modeFactory({ modeConfiguration }) {
* Lifecycle hooks
*/
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
const {
toolbarService,
toolGroupService,
hangingProtocolService,
displaySetService,
} = servicesManager.services;
const { toolbarService, toolGroupService, hangingProtocolService, displaySetService } =
servicesManager.services;
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
@@ -99,9 +95,7 @@ function modeFactory({ modeConfiguration }) {
// For fusion toolGroup we need to add the volumeIds for the crosshairs
// since in the fusion viewport we don't want both PT and CT to render MIP
// when slabThickness is modified
const {
displaySetMatchDetails,
} = hangingProtocolService.getMatchDetails();
const { displaySetMatchDetails } = hangingProtocolService.getMatchDetails();
setCrosshairsConfiguration(
displaySetMatchDetails,
@@ -143,22 +137,16 @@ function modeFactory({ modeConfiguration }) {
'getPTVOIRange',
'get PT VOI based on corrected or not',
props => {
const ptDisplaySet = props.find(
imageSet => imageSet.Modality === 'PT'
);
const ptDisplaySet = props.find(imageSet => imageSet.Modality === 'PT');
if (!ptDisplaySet) {
return;
}
const { imageId } = ptDisplaySet.images[0];
const imageIdScalingFactor = MetadataProvider.get(
'scalingModule',
imageId
);
const imageIdScalingFactor = MetadataProvider.get('scalingModule', imageId);
const isSUVAvailable =
imageIdScalingFactor && imageIdScalingFactor.suvbw;
const isSUVAvailable = imageIdScalingFactor && imageIdScalingFactor.suvbw;
if (isSUVAvailable) {
return {
@@ -196,16 +184,13 @@ function modeFactory({ modeConfiguration }) {
const isValid =
modalities_list.includes('CT') &&
modalities_list.includes('PT') &&
!invalidModalities.some(modality =>
modalities_list.includes(modality)
) &&
!invalidModalities.some(modality => modalities_list.includes(modality)) &&
// This is study is a 4D study with PT and CT and not a 3D study for the tmtv
// mode, until we have a better way to identify 4D studies we will use the
// StudyInstanceUID to identify the study
// Todo: when we add the 4D mode which comes with a mechanism to identify
// 4D studies we can use that
study.studyInstanceUid !==
'1.3.6.1.4.1.12842.1.1.14.3.20220915.105557.468.2963630849';
study.studyInstanceUid !== '1.3.6.1.4.1.12842.1.1.14.3.20220915.105557.468.2963630849';
// there should be both CT and PT modalities and the modality should not be SM
return isValid;
+5 -24
View File
@@ -66,34 +66,19 @@ function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
},
};
toolGroupService.createToolGroupAndAddTools(
toolGroupIds.CT,
tools,
toolsConfig
);
toolGroupService.createToolGroupAndAddTools(toolGroupIds.CT, tools, toolsConfig);
toolGroupService.createToolGroupAndAddTools(
toolGroupIds.PT,
{
active: tools.active,
passive: [
...tools.passive,
{ toolName: 'RectangleROIStartEndThreshold' },
],
passive: [...tools.passive, { toolName: 'RectangleROIStartEndThreshold' }],
enabled: tools.enabled,
disabled: tools.disabled,
},
toolsConfig
);
toolGroupService.createToolGroupAndAddTools(
toolGroupIds.Fusion,
tools,
toolsConfig
);
toolGroupService.createToolGroupAndAddTools(
toolGroupIds.default,
tools,
toolsConfig
);
toolGroupService.createToolGroupAndAddTools(toolGroupIds.Fusion, tools, toolsConfig);
toolGroupService.createToolGroupAndAddTools(toolGroupIds.default, tools, toolsConfig);
const mipTools = {
active: [
@@ -117,11 +102,7 @@ function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
},
};
toolGroupService.createToolGroupAndAddTools(
toolGroupIds.MIP,
mipTools,
mipToolsConfig
);
toolGroupService.createToolGroupAndAddTools(toolGroupIds.MIP, mipTools, mipToolsConfig);
}
function initMPRToolGroup(toolNames, Enums, toolGroupService, commandsManager) {
+2 -5
View File
@@ -298,15 +298,12 @@ const toolbarButtons = [
icon: 'tool-create-threshold',
label: 'Rectangle ROI Threshold',
commands: [
..._createCommands('setToolActive', 'RectangleROIStartEndThreshold', [
toolGroupIds.PT,
]),
..._createCommands('setToolActive', 'RectangleROIStartEndThreshold', [toolGroupIds.PT]),
{
commandName: 'displayNotification',
commandOptions: {
title: 'RectangleROI Threshold Tip',
text:
'RectangleROI Threshold tool should be used on PT Axial Viewport',
text: 'RectangleROI Threshold tool should be used on PT Axial Viewport',
type: 'info',
},
},
@@ -13,9 +13,7 @@ export default function setCrosshairsConfiguration(
}
const { SeriesInstanceUID } = matchDetails;
const displaySets = displaySetService.getDisplaySetsForSeries(
SeriesInstanceUID
);
const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
const toolConfig = toolGroupService.getToolConfiguration(
toolGroupIds.Fusion,
@@ -14,9 +14,7 @@ export default function setFusionActiveVolume(
const { SeriesInstanceUID } = matchDetails;
const displaySets = displaySetService.getDisplaySetsForSeries(
SeriesInstanceUID
);
const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
if (!displaySets || displaySets.length === 0) {
return;