chore: Tag everything currently unused as legacy.
This commit is contained in:
1 parent
8392c1f97e
commit
414ebc6850
161 files changed
+128
-14712
No files matched your search
@@ -2,13 +2,12 @@ import cornerstone from 'cornerstone-core';
|
||||
import cornerstoneTools from 'cornerstone-tools';
|
||||
import OHIF from '@ohif/core';
|
||||
|
||||
import setCornerstoneLayout from './utils/setCornerstoneLayout.js';
|
||||
//import setCornerstoneLayout from './utils/setCornerstoneLayout.js';
|
||||
import { getEnabledElement } from './state';
|
||||
import CornerstoneViewportDownloadForm from './CornerstoneViewportDownloadForm';
|
||||
const scroll = cornerstoneTools.import('util/scroll');
|
||||
|
||||
const { studyMetadataManager } = OHIF.utils;
|
||||
const { setViewportSpecificData } = OHIF.redux.actions;
|
||||
|
||||
const commandsModule = ({ servicesManager, commandsManager }) => {
|
||||
const { ViewportGridService } = servicesManager.services;
|
||||
@@ -299,9 +298,9 @@ const commandsModule = ({ servicesManager, commandsManager }) => {
|
||||
cornerstoneTools.removeToolState(element, toolType, tool);
|
||||
cornerstone.updateImage(element);
|
||||
},
|
||||
setCornerstoneLayout: () => {
|
||||
setCornerstoneLayout();
|
||||
},
|
||||
// setCornerstoneLayout: () => {
|
||||
// setCornerstoneLayout();
|
||||
// },
|
||||
setWindowLevel: ({ window, level }) => {
|
||||
const enabledElement = _getActiveViewportsEnabledElement();
|
||||
|
||||
@@ -430,12 +429,12 @@ const commandsModule = ({ servicesManager, commandsManager }) => {
|
||||
storeContexts: [],
|
||||
options: { toolName: 'Zoom' },
|
||||
},
|
||||
setCornerstoneLayout: {
|
||||
commandFn: actions.setCornerstoneLayout,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
context: 'VIEWER',
|
||||
},
|
||||
// setCornerstoneLayout: {
|
||||
// commandFn: actions.setCornerstoneLayout,
|
||||
// storeContexts: [],
|
||||
// options: {},
|
||||
// context: 'VIEWER',
|
||||
// },
|
||||
setWindowLevel: {
|
||||
commandFn: actions.setWindowLevel,
|
||||
storeContexts: [],
|
||||
|
||||
@@ -271,7 +271,7 @@ export default function init({
|
||||
}
|
||||
|
||||
const { csToolsConfig } = configuration;
|
||||
const metadataProvider = OHIF.cornerstone.metadataProvider;
|
||||
const metadataProvider = OHIF.classes.MetadataProvider;
|
||||
|
||||
cs.metaData.addProvider(metadataProvider.get.bind(metadataProvider), 9999);
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const LOW_PRIORITY_MODALITIES = Object.freeze(['SEG', 'KO', 'PR', 'SR', 'RTSTRUCT']);
|
||||
|
||||
export default function isLowPriorityModality(Modality) {
|
||||
return LOW_PRIORITY_MODALITIES.includes(Modality);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import isLowPriorityModality from './isLowPriorityModality';
|
||||
|
||||
/**
|
||||
* Series sorting criteria: series considered low priority are moved to the end
|
||||
* of the list and series number is used to break ties
|
||||
* @param {Object} firstSeries
|
||||
* @param {Object} secondSeries
|
||||
*/
|
||||
function seriesInfoSortingCriteria(firstSeries, secondSeries) {
|
||||
const aLowPriority = isLowPriorityModality(firstSeries.Modality);
|
||||
const bLowPriority = isLowPriorityModality(secondSeries.Modality);
|
||||
if (!aLowPriority && bLowPriority) {
|
||||
return -1;
|
||||
}
|
||||
if (aLowPriority && !bLowPriority) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return firstSeries.SeriesNumber - secondSeries.SeriesNumber;
|
||||
}
|
||||
|
||||
const seriesSortCriteria = {
|
||||
default: (a, b) => a.SeriesNumber - b.SeriesNumber,
|
||||
seriesInfoSortingCriteria,
|
||||
};
|
||||
|
||||
const instancesSortCriteria = {
|
||||
default: (a, b) => a.InstanceNumber - b.InstanceNumber,
|
||||
};
|
||||
|
||||
const sortingCriteria = {
|
||||
seriesSortCriteria,
|
||||
instancesSortCriteria,
|
||||
};
|
||||
|
||||
/**
|
||||
* Sorts given series (given param is modified)
|
||||
* The default criteria is based on series number in ascending order.
|
||||
*
|
||||
* @param {Array} series List of series
|
||||
* @param {function} seriesSortingCriteria method for sorting
|
||||
* @returns {Array} sorted series object
|
||||
*/
|
||||
const sortStudySeries = (
|
||||
series,
|
||||
seriesSortingCriteria = seriesSortCriteria.default
|
||||
) => {
|
||||
return series.sort(seriesSortingCriteria);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sorts given instancesList (given param is modified)
|
||||
* The default criteria is based on instance number in ascending order.
|
||||
*
|
||||
* @param {Array} instancesList List of series
|
||||
* @param {function} instancesSortingCriteria method for sorting
|
||||
* @returns {Array} sorted instancesList object
|
||||
*/
|
||||
const sortStudyInstances = (
|
||||
instancesList,
|
||||
instancesSortingCriteria = instancesSortCriteria.default
|
||||
) => {
|
||||
return instancesList.sort(instancesSortingCriteria);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sorts the series and instances (by default) inside a study instance based on sortingCriteria (given param is modified)
|
||||
* The default criteria is based on series and instance numbers in ascending order.
|
||||
*
|
||||
* @param {Object} study The study instance
|
||||
* @param {boolean} [deepSort = true] to sort instance also
|
||||
* @param {function} [seriesSortingCriteria = seriesSortCriteria.default] method for sorting series
|
||||
* @param {function} [instancesSortingCriteria = instancesSortCriteria.default] method for sorting instances
|
||||
* @returns {Object} sorted study object
|
||||
*/
|
||||
export default function sortStudy(
|
||||
study,
|
||||
deepSort = true,
|
||||
seriesSortingCriteria = seriesSortCriteria.default,
|
||||
instancesSortingCriteria = instancesSortCriteria.default
|
||||
) {
|
||||
if (!study || !study.series) {
|
||||
throw new Error('Insufficient study data was provided to sortStudy');
|
||||
}
|
||||
|
||||
sortStudySeries(study.series, seriesSortingCriteria);
|
||||
|
||||
if (deepSort) {
|
||||
study.series.forEach(series => {
|
||||
sortStudyInstances(series.instances, instancesSortingCriteria);
|
||||
});
|
||||
}
|
||||
|
||||
return study;
|
||||
}
|
||||
|
||||
export { sortStudy, sortStudySeries, sortStudyInstances, sortingCriteria };
|
||||
@@ -1,10 +1,7 @@
|
||||
import dcmjs from 'dcmjs';
|
||||
import { studies } from '@ohif/core';
|
||||
import { sortStudySeries, sortingCriteria } from '../utils/sortStudy';
|
||||
import RetrieveMetadataLoader from './retrieveMetadataLoader';
|
||||
|
||||
const { sortStudySeries, sortingCriteria } = studies;
|
||||
|
||||
|
||||
/**
|
||||
* Creates an immutable series loader object which loads each series sequentially using the iterator interface
|
||||
* @param {DICOMWebClient} dicomWebClient The DICOMWebClient instance to be used for series load
|
||||
|
||||
Reference in new issue
Block a user