-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Tag everything currently unused as legacy.
- Loading branch information
1 parent
8392c1f
commit 414ebc6
Showing
161 changed files
with
128 additions
and
14,712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
extensions/default/src/DicomWebDataSource/utils/isLowPriorityModality.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
97 changes: 97 additions & 0 deletions
97
extensions/default/src/DicomWebDataSource/utils/sortStudy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }; |
5 changes: 1 addition & 4 deletions
5
extensions/default/src/DicomWebDataSource/wado/retrieveMetadataLoaderAsync.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
100 changes: 0 additions & 100 deletions
100
platform/core/src/DICOMSR/parseDicomStructuredReport.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.