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

+10 -24
View File
@@ -24,12 +24,9 @@ const DEFAULT_MEATADATA = {
*/
export default function PanelPetSUV({ servicesManager, commandsManager }) {
const { t } = useTranslation('PanelSUV');
const {
displaySetService,
toolGroupService,
toolbarService,
hangingProtocolService,
} = (servicesManager as ServicesManager).services;
const { displaySetService, toolGroupService, toolbarService, hangingProtocolService } = (
servicesManager as ServicesManager
).services;
const [metadata, setMetadata] = useState(DEFAULT_MEATADATA);
const [ptDisplaySet, setPtDisplaySet] = useState(null);
@@ -127,9 +124,7 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
});
toolbarService.state.toggles['Crosshairs'] = false;
toolbarService._broadcastEvent(
toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED
);
toolbarService._broadcastEvent(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED);
// metadata should be dcmjs naturalized
DicomMetadataStore.updateMetadataForSeries(
@@ -139,15 +134,13 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
);
// update the displaySets
displaySetService.setDisplaySetMetadataInvalidated(
ptDisplaySet.displaySetInstanceUID
);
displaySetService.setDisplaySetMetadataInvalidated(ptDisplaySet.displaySetInstanceUID);
}
return (
<div className="overflow-x-hidden overflow-y-auto invisible-scrollbar">
<div className="invisible-scrollbar overflow-y-auto overflow-x-hidden">
{
<div className="flex flex-col">
<div className="flex flex-col p-4 space-y-4 bg-primary-dark">
<div className="bg-primary-dark flex flex-col space-y-4 p-4">
<Input
label={t('Patient Sex')}
labelClassName="text-white mb-2"
@@ -174,10 +167,7 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
label={t('Total Dose (bq)')}
labelClassName="text-white mb-2"
className="mt-1"
value={
metadata.RadiopharmaceuticalInformationSequence
.RadionuclideTotalDose || ''
}
value={metadata.RadiopharmaceuticalInformationSequence.RadionuclideTotalDose || ''}
onChange={e => {
handleMetadataChange({
RadiopharmaceuticalInformationSequence: {
@@ -190,10 +180,7 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
label={t('Half Life (s)')}
labelClassName="text-white mb-2"
className="mt-1"
value={
metadata.RadiopharmaceuticalInformationSequence
.RadionuclideHalfLife || ''
}
value={metadata.RadiopharmaceuticalInformationSequence.RadionuclideHalfLife || ''}
onChange={e => {
handleMetadataChange({
RadiopharmaceuticalInformationSequence: {
@@ -207,8 +194,7 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
labelClassName="text-white mb-2"
className="mt-1"
value={
metadata.RadiopharmaceuticalInformationSequence
.RadiopharmaceuticalStartTime || ''
metadata.RadiopharmaceuticalInformationSequence.RadiopharmaceuticalStartTime || ''
}
onChange={e => {
handleMetadataChange({
@@ -8,9 +8,12 @@ function ExportReports({ segmentations, tmtvValue, config, commandsManager }) {
return (
<>
{segmentations?.length ? (
<div className="flex justify-center mt-4 space-x-2">
<div className="mt-4 flex justify-center space-x-2">
{/* TODO Revisit design of ButtonGroup later - for now use LegacyButton for its children.*/}
<ButtonGroup color="black" size="inherit">
<ButtonGroup
color="black"
size="inherit"
>
<LegacyButton
className="px-2 py-2 text-base"
disabled={tmtvValue === null}
@@ -25,7 +28,10 @@ function ExportReports({ segmentations, tmtvValue, config, commandsManager }) {
{t('Export CSV')}
</LegacyButton>
</ButtonGroup>
<ButtonGroup color="black" size="inherit">
<ButtonGroup
color="black"
size="inherit"
>
<LegacyButton
className="px-2 py-2 text-base"
onClick={() => {
@@ -5,9 +5,7 @@ import { SegmentationTable, Button, Icon } from '@ohif/ui';
import { useTranslation } from 'react-i18next';
import segmentationEditHandler from './segmentationEditHandler';
import ExportReports from './ExportReports';
import ROIThresholdConfiguration, {
ROI_STAT,
} from './ROIThresholdConfiguration';
import ROIThresholdConfiguration, { ROI_STAT } from './ROIThresholdConfiguration';
const LOWER_CT_THRESHOLD_DEFAULT = -1024;
const UPPER_CT_THRESHOLD_DEFAULT = 1024;
@@ -44,19 +42,14 @@ function reducer(state, action) {
}
}
export default function PanelRoiThresholdSegmentation({
servicesManager,
commandsManager,
}) {
export default function PanelRoiThresholdSegmentation({ servicesManager, commandsManager }) {
const { segmentationService } = servicesManager.services;
const { t } = useTranslation('PanelSUV');
const [showConfig, setShowConfig] = useState(false);
const [labelmapLoading, setLabelmapLoading] = useState(false);
const [selectedSegmentationId, setSelectedSegmentationId] = useState(null);
const [segmentations, setSegmentations] = useState(() =>
segmentationService.getSegmentations()
);
const [segmentations, setSegmentations] = useState(() => segmentationService.getSegmentations());
const [config, dispatch] = useReducer(reducer, {
strategy: DEFAULT_STRATEGY,
@@ -95,9 +88,7 @@ export default function PanelRoiThresholdSegmentation({
const lesionGlyoclysisStats = lesionStats.volume * lesionStats.meanValue;
// update segDetails with the suv peak for the active segmentation
const segmentation = segmentationService.getSegmentation(
selectedSegmentationId
);
const segmentation = segmentationService.getSegmentation(selectedSegmentationId);
const cachedStats = {
lesionStats,
@@ -178,8 +169,8 @@ export default function PanelRoiThresholdSegmentation({
return (
<>
<div className="flex flex-col">
<div className="overflow-x-hidden overflow-y-auto invisible-scrollbar">
<div className="flex mx-4 my-4 mb-4 space-x-4">
<div className="invisible-scrollbar overflow-y-auto overflow-x-hidden">
<div className="mx-4 my-4 mb-4 flex space-x-4">
<Button
onClick={() => {
setLabelmapLoading(true);
@@ -196,14 +187,12 @@ export default function PanelRoiThresholdSegmentation({
<Button onClick={handleROIThresholding}>Run</Button>
</div>
<div
className="flex items-center justify-around h-8 mb-2 border-t outline-none cursor-pointer select-none bg-secondary-dark first:border-0 border-secondary-light"
className="bg-secondary-dark border-secondary-light mb-2 flex h-8 cursor-pointer select-none items-center justify-around border-t outline-none first:border-0"
onClick={() => {
setShowConfig(!showConfig);
}}
>
<div className="px-4 text-base text-white">
{t('ROI Threshold Configuration')}
</div>
<div className="px-4 text-base text-white">{t('ROI Threshold Configuration')}</div>
</div>
{showConfig && (
<ROIThresholdConfiguration
@@ -246,8 +235,8 @@ export default function PanelRoiThresholdSegmentation({
) : null}
</div>
{tmtvValue !== null ? (
<div className="flex items-baseline justify-between px-2 py-1 mt-4 bg-secondary-dark">
<span className="text-base font-bold tracking-widest text-white uppercase">
<div className="bg-secondary-dark mt-4 flex items-baseline justify-between px-2 py-1">
<span className="text-base font-bold uppercase tracking-widest text-white">
{'TMTV:'}
</span>
<div className="text-white">{`${tmtvValue} mL`}</div>
@@ -262,13 +251,10 @@ export default function PanelRoiThresholdSegmentation({
</div>
</div>
<div
className="opacity-50 hover:opacity-80 flex items-center justify-center text-blue-400 mt-auto cursor-pointer mb-4"
className="mt-auto mb-4 flex cursor-pointer items-center justify-center text-blue-400 opacity-50 hover:opacity-80"
onClick={() => {
// navigate to a url in a new tab
window.open(
'https://github.com/OHIF/Viewers/blob/master/modes/tmtv/README.md',
'_blank'
);
window.open('https://github.com/OHIF/Viewers/blob/master/modes/tmtv/README.md', '_blank');
}}
>
<Icon
@@ -14,18 +14,15 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
const { t } = useTranslation('ROIThresholdConfiguration');
return (
<div className="flex flex-col px-4 space-y-4 bg-primary-dark py-2">
<div className="bg-primary-dark flex flex-col space-y-4 px-4 py-2">
<div className="flex items-end space-x-2">
<div className="flex flex-col w-1/2">
<div className="flex w-1/2 flex-col">
<Select
label={t('Strategy')}
closeMenuOnSelect={true}
className="mr-2 bg-black border-primary-main text-white "
className="border-primary-main mr-2 bg-black text-white "
options={options}
placeholder={
options.find(option => option.value === config.strategy)
.placeHolder
}
placeholder={options.find(option => option.value === config.strategy).placeHolder}
value={config.strategy}
onChange={({ value }) => {
dispatch({
@@ -66,7 +63,7 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
<Input
label={t('Percentage of Max SUV')}
labelClassName="text-white"
className="mt-2 bg-black border-primary-main"
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={config.weight}
@@ -81,11 +78,14 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
/>
)}
{config.strategy !== ROI_STAT && (
<div className="text-sm mr-2">
<div className="mr-2 text-sm">
<table>
<tbody>
<tr className="mt-2">
<td className="pr-4 pt-2" colSpan="3">
<td
className="pr-4 pt-2"
colSpan="3"
>
<Label
className="text-white"
text="Lower & Upper Ranges"
@@ -93,15 +93,18 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
</td>
</tr>
<tr className="mt-2">
<td className="text-center pr-4 pt-2">
<Label className="text-white" text="CT"></Label>
<td className="pr-4 pt-2 text-center">
<Label
className="text-white"
text="CT"
></Label>
</td>
<td>
<div className="flex justify-between">
<Input
label={t('')}
labelClassName="text-white"
className="mt-2 bg-black border-primary-main"
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={config.ctLower}
@@ -117,7 +120,7 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
<Input
label={t('')}
labelClassName="text-white"
className="mt-2 bg-black border-primary-main"
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={config.ctUpper}
@@ -134,15 +137,18 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
</td>
</tr>
<tr>
<td className="text-center pr-4 pt-2">
<Label className="text-white" text="PT"></Label>
<td className="pr-4 pt-2 text-center">
<Label
className="text-white"
text="PT"
></Label>
</td>
<td>
<div className="flex justify-between">
<Input
label={t('')}
labelClassName="text-white"
className="mt-2 bg-black border-primary-main"
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={config.ptLower}
@@ -158,7 +164,7 @@ function ROIThresholdConfiguration({ config, dispatch, runCommand }) {
<Input
label={t('')}
labelClassName="text-white"
className="mt-2 bg-black border-primary-main"
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={config.ptUpper}
@@ -46,7 +46,7 @@ function segmentationItemEditHandler({ id, servicesManager }) {
return (
<Input
autoFocus
className="bg-black border-primary-main"
className="border-primary-main bg-black"
type="text"
containerClassName="mr-2"
value={value.label}