fix: A couple of changes to enable cs3d integration build (#5944)
* fix: A couple of changes to enable cs3d integration build * Bun update * fix: Crosshairs tests due to order changes * Fix a race in DicomTagBrowser.spec.ts and update the comparison for the screenshot for seg hydration. * Fix sorting issues by using consistent sort * fix: Inconsistency in scoord loader. Will need an update to screenshot * Fix crosshairs stability issues and random order issues in Scoord * Update the comparison image * Update navigate image * fix: Axios issue * Update to current CS3D
This commit is contained in:
1 parent
66c8e0c195
commit
f6bbd5c779
29 files changed
+565
-295
No files matched your search
@@ -37,10 +37,10 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/core": "4.20.0",
|
||||
"@cornerstonejs/dicom-image-loader": "4.20.0",
|
||||
"@cornerstonejs/core": "4.21.2",
|
||||
"@cornerstonejs/dicom-image-loader": "4.21.2",
|
||||
"@ohif/ui": "3.13.0-beta.55",
|
||||
"cornerstone-math": "0.1.9",
|
||||
"cornerstone-math": "0.1.10",
|
||||
"dicom-parser": "1.8.21"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -145,5 +145,6 @@ export {
|
||||
export { OHIF };
|
||||
|
||||
export type { Types };
|
||||
export type { SortDisplaySetsCopyOptions } from './utils/sortStudy';
|
||||
|
||||
export default OHIF;
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useSystem } from '../contextProviders/SystemProvider';
|
||||
import i18n from 'i18next';
|
||||
import { seriesSortCriteria } from './sortStudy';
|
||||
|
||||
|
||||
/**
|
||||
* Tab properties that drive which tab group is used for thumbnail display.
|
||||
@@ -41,7 +39,6 @@ export function createStudyBrowserTabs(
|
||||
const { servicesManager } = useSystem();
|
||||
const { displaySetService, customizationService } = servicesManager.services;
|
||||
|
||||
const shouldSortBySeriesUID = process.env.TEST_ENV === 'true';
|
||||
const primaryStudies = [];
|
||||
const allStudies = [];
|
||||
|
||||
@@ -50,10 +47,10 @@ export function createStudyBrowserTabs(
|
||||
ds => ds.StudyInstanceUID === study.studyInstanceUid
|
||||
);
|
||||
|
||||
// sort them by seriesInstanceUID
|
||||
const sortCriteria = shouldSortBySeriesUID
|
||||
? seriesSortCriteria.compareSeriesUID
|
||||
: (customizationService.getCustomization('sortingCriteria') as (a, b) => number);
|
||||
const sortCriteria = customizationService.getCustomization('sortingCriteria') as (
|
||||
a,
|
||||
b
|
||||
) => number;
|
||||
const sortedDisplaySets = displaySetsForStudy.sort((a, b) => {
|
||||
const displaySetA = displaySetService.getDisplaySetByUID(a.displaySetInstanceUID);
|
||||
const displaySetB = displaySetService.getDisplaySetByUID(b.displaySetInstanceUID);
|
||||
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
sortStudy,
|
||||
sortStudySeries,
|
||||
sortStudyInstances,
|
||||
sortDisplaySetsCopy,
|
||||
sortingCriteria,
|
||||
seriesSortCriteria,
|
||||
instancesSortCriteria,
|
||||
@@ -63,6 +64,7 @@ const utils = {
|
||||
sortStudy,
|
||||
sortStudySeries,
|
||||
sortStudyInstances,
|
||||
sortDisplaySetsCopy,
|
||||
sortingCriteria,
|
||||
seriesSortCriteria,
|
||||
instancesSortCriteria,
|
||||
|
||||
@@ -132,6 +132,48 @@ export const sortingCriteria = {
|
||||
instancesSortCriteria,
|
||||
};
|
||||
|
||||
export type SortDisplaySetsCopyOptions = {
|
||||
/**
|
||||
* Display sets for this study are sorted by series criteria and listed first;
|
||||
* all other display sets follow in their original relative order.
|
||||
*/
|
||||
studyInstanceUIDFirst?: string;
|
||||
/** Defaults to {@link seriesSortCriteria.default} (not app customization). */
|
||||
seriesSortingCriteria?: (a, b) => number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a new array of display sets sorted by default series order
|
||||
* ({@link seriesSortCriteria.default} / {@link seriesInfoSortingCriteria}), not
|
||||
* the app customization. Does not mutate the input.
|
||||
*
|
||||
* With `studyInstanceUIDFirst`, only that study's display sets are sorted; they
|
||||
* are placed before the rest, which keeps source order (e.g. load order).
|
||||
*/
|
||||
export function sortDisplaySetsCopy(
|
||||
displaySets,
|
||||
options?: SortDisplaySetsCopyOptions | null
|
||||
) {
|
||||
const seriesSortingCriteria =
|
||||
options?.seriesSortingCriteria ?? seriesSortCriteria.default;
|
||||
const studyFirst = options?.studyInstanceUIDFirst;
|
||||
|
||||
if (!studyFirst) {
|
||||
return [...displaySets].sort(seriesSortingCriteria);
|
||||
}
|
||||
|
||||
const sameStudy = [];
|
||||
const otherStudy = [];
|
||||
for (const ds of displaySets) {
|
||||
if (ds.StudyInstanceUID === studyFirst) {
|
||||
sameStudy.push(ds);
|
||||
} else {
|
||||
otherStudy.push(ds);
|
||||
}
|
||||
}
|
||||
return [...[...sameStudy].sort(seriesSortingCriteria), ...otherStudy];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts given series or display sets
|
||||
* The default criteria is based on series number in ascending order.
|
||||
|
||||
Reference in new issue
Block a user