chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
@@ -14,11 +14,7 @@ const metadataProvider = classes.MetadataProvider;
|
||||
const RECTANGLE_ROI_THRESHOLD_MANUAL = 'RectangleROIStartEndThreshold';
|
||||
const LABELMAP = csTools.Enums.SegmentationRepresentations.Labelmap;
|
||||
|
||||
const commandsModule = ({
|
||||
servicesManager,
|
||||
commandsManager,
|
||||
extensionManager,
|
||||
}) => {
|
||||
const commandsModule = ({ servicesManager, commandsManager, extensionManager }) => {
|
||||
const {
|
||||
viewportGridService,
|
||||
uiNotificationService,
|
||||
@@ -74,9 +70,7 @@ const commandsModule = ({
|
||||
continue;
|
||||
}
|
||||
|
||||
ptDisplaySet = displaySets.find(
|
||||
displaySet => displaySet.Modality === 'PT'
|
||||
);
|
||||
ptDisplaySet = displaySets.find(displaySet => displaySet.Modality === 'PT');
|
||||
|
||||
if (ptDisplaySet) {
|
||||
break;
|
||||
@@ -102,17 +96,13 @@ const commandsModule = ({
|
||||
PatientWeight: instance.PatientWeight,
|
||||
RadiopharmaceuticalInformationSequence: {
|
||||
RadionuclideTotalDose:
|
||||
instance.RadiopharmaceuticalInformationSequence[0]
|
||||
.RadionuclideTotalDose,
|
||||
instance.RadiopharmaceuticalInformationSequence[0].RadionuclideTotalDose,
|
||||
RadionuclideHalfLife:
|
||||
instance.RadiopharmaceuticalInformationSequence[0]
|
||||
.RadionuclideHalfLife,
|
||||
instance.RadiopharmaceuticalInformationSequence[0].RadionuclideHalfLife,
|
||||
RadiopharmaceuticalStartTime:
|
||||
instance.RadiopharmaceuticalInformationSequence[0]
|
||||
.RadiopharmaceuticalStartTime,
|
||||
instance.RadiopharmaceuticalInformationSequence[0].RadiopharmaceuticalStartTime,
|
||||
RadiopharmaceuticalStartDateTime:
|
||||
instance.RadiopharmaceuticalInformationSequence[0]
|
||||
.RadiopharmaceuticalStartDateTime,
|
||||
instance.RadiopharmaceuticalInformationSequence[0].RadiopharmaceuticalStartDateTime,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -148,10 +138,7 @@ const commandsModule = ({
|
||||
representationType
|
||||
);
|
||||
|
||||
segmentationService.setActiveSegmentationForToolGroup(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
segmentationService.setActiveSegmentationForToolGroup(segmentationId, toolGroupId);
|
||||
}
|
||||
|
||||
return segmentationId;
|
||||
@@ -160,21 +147,14 @@ const commandsModule = ({
|
||||
const toolGroupIds = _getMatchedViewportsToolGroupIds();
|
||||
|
||||
toolGroupIds.forEach(toolGroupId => {
|
||||
segmentationService.setActiveSegmentationForToolGroup(
|
||||
segmentationId,
|
||||
toolGroupId
|
||||
);
|
||||
segmentationService.setActiveSegmentationForToolGroup(segmentationId, toolGroupId);
|
||||
});
|
||||
},
|
||||
thresholdSegmentationByRectangleROITool: ({ segmentationId, config }) => {
|
||||
const segmentation = csTools.segmentation.state.getSegmentation(
|
||||
segmentationId
|
||||
);
|
||||
const segmentation = csTools.segmentation.state.getSegmentation(segmentationId);
|
||||
|
||||
const { representationData } = segmentation;
|
||||
const {
|
||||
displaySetMatchDetails: matchDetails,
|
||||
} = hangingProtocolService.getMatchDetails();
|
||||
const { displaySetMatchDetails: matchDetails } = hangingProtocolService.getMatchDetails();
|
||||
const volumeLoaderScheme = 'cornerstoneStreamingImageVolume'; // Loader id which defines which volume loader to use
|
||||
|
||||
const ctDisplaySet = matchDetails.get('ctDisplaySet');
|
||||
@@ -248,9 +228,7 @@ const commandsModule = ({
|
||||
getLesionStats: ({ labelmap, segmentIndex = 1 }) => {
|
||||
const { scalarData, spacing } = labelmap;
|
||||
|
||||
const { scalarData: referencedScalarData } = cs.cache.getVolume(
|
||||
labelmap.referencedVolumeId
|
||||
);
|
||||
const { scalarData: referencedScalarData } = cs.cache.getVolume(labelmap.referencedVolumeId);
|
||||
|
||||
let segmentationMax = -Infinity;
|
||||
let segmentationMin = Infinity;
|
||||
@@ -292,9 +270,7 @@ const commandsModule = ({
|
||||
};
|
||||
},
|
||||
calculateTMTV: ({ segmentations }) => {
|
||||
const labelmaps = segmentations.map(s =>
|
||||
segmentationService.getLabelmapVolume(s.id)
|
||||
);
|
||||
const labelmaps = segmentations.map(s => segmentationService.getLabelmapVolume(s.id));
|
||||
|
||||
if (!labelmaps.length) {
|
||||
return;
|
||||
@@ -317,17 +293,14 @@ const commandsModule = ({
|
||||
createAndDownloadTMTVReport(segReport, additionalReportRows);
|
||||
},
|
||||
getTotalLesionGlycolysis: ({ segmentations }) => {
|
||||
const labelmapVolumes = segmentations.map(s =>
|
||||
segmentationService.getLabelmapVolume(s.id)
|
||||
);
|
||||
const labelmapVolumes = segmentations.map(s => segmentationService.getLabelmapVolume(s.id));
|
||||
|
||||
let mergedLabelmap;
|
||||
// merge labelmap will through an error if labels maps are not the same size
|
||||
// or same direction or ....
|
||||
try {
|
||||
mergedLabelmap = csTools.utilities.segmentation.createMergedLabelmapForIndex(
|
||||
labelmapVolumes
|
||||
);
|
||||
mergedLabelmap =
|
||||
csTools.utilities.segmentation.createMergedLabelmapForIndex(labelmapVolumes);
|
||||
} catch (e) {
|
||||
console.error('commandsModule::getTotalLesionGlycolysis', e);
|
||||
return;
|
||||
@@ -337,9 +310,7 @@ const commandsModule = ({
|
||||
const { referencedVolumeId, spacing } = labelmapVolumes[0];
|
||||
|
||||
if (!referencedVolumeId) {
|
||||
console.error(
|
||||
'commandsModule::getTotalLesionGlycolysis:No referencedVolumeId found'
|
||||
);
|
||||
console.error('commandsModule::getTotalLesionGlycolysis:No referencedVolumeId found');
|
||||
}
|
||||
|
||||
const ptVolume = cs.cache.getVolume(referencedVolumeId);
|
||||
@@ -365,14 +336,7 @@ const commandsModule = ({
|
||||
const averageSuv = suv / totalLesionVoxelCount;
|
||||
|
||||
// total Lesion Glycolysis [suv * ml]
|
||||
return (
|
||||
averageSuv *
|
||||
totalLesionVoxelCount *
|
||||
spacing[0] *
|
||||
spacing[1] *
|
||||
spacing[2] *
|
||||
1e-3
|
||||
);
|
||||
return averageSuv * totalLesionVoxelCount * spacing[0] * spacing[1] * spacing[2] * 1e-3;
|
||||
},
|
||||
setStartSliceForROIThresholdTool: () => {
|
||||
const { viewport } = _getActiveViewportsEnabledElement();
|
||||
@@ -488,9 +452,7 @@ const commandsModule = ({
|
||||
const referencedVolumeId = labelmapVolume.referencedVolumeId;
|
||||
segReport.referencedVolumeId = referencedVolumeId;
|
||||
|
||||
const referencedVolume = segmentationService.getLabelmapVolume(
|
||||
referencedVolumeId
|
||||
);
|
||||
const referencedVolume = segmentationService.getLabelmapVolume(referencedVolumeId);
|
||||
|
||||
if (!referencedVolume) {
|
||||
report[id] = segReport;
|
||||
@@ -503,10 +465,7 @@ const commandsModule = ({
|
||||
}
|
||||
|
||||
const firstImageId = referencedVolume.imageIds[0];
|
||||
const instance = OHIF.classes.MetadataProvider.get(
|
||||
'instance',
|
||||
firstImageId
|
||||
);
|
||||
const instance = OHIF.classes.MetadataProvider.get('instance', firstImageId);
|
||||
|
||||
if (!instance) {
|
||||
report[id] = segReport;
|
||||
@@ -559,9 +518,7 @@ const commandsModule = ({
|
||||
},
|
||||
});
|
||||
|
||||
viewports.push(
|
||||
cornerstoneViewportService.getCornerstoneViewport(viewportId)
|
||||
);
|
||||
viewports.push(cornerstoneViewportService.getCornerstoneViewport(viewportId));
|
||||
});
|
||||
|
||||
viewports.forEach(viewport => {
|
||||
|
||||
Reference in new issue
Block a user