Merge branch 'master' into fix/hotkeys
This commit is contained in:
17 files changed
+433
-5825
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ import {
|
||||
import ConnectedToolContextMenu from './connectedComponents/ConnectedToolContextMenu';
|
||||
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
|
||||
import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension';
|
||||
import OHIFDicomMicroscopyExtension from 'ohif-dicom-microscopy-extension';
|
||||
import OHIFDicomMicroscopyExtension from '@ohif/extension-dicom-microscopy';
|
||||
import OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
|
||||
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
|
||||
import OHIFVTKExtension from '@ohif/extension-vtk';
|
||||
|
||||
@@ -69,32 +69,40 @@ class StudyListWithData extends Component {
|
||||
}
|
||||
|
||||
const { field, order } = searchData.sortData;
|
||||
const sortedStudies = studies
|
||||
.sort(function(a, b) {
|
||||
if (order === 'desc') {
|
||||
if (a[field] < b[field]) {
|
||||
return -1;
|
||||
}
|
||||
if (a[field] > b[field]) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if (a[field] > b[field]) {
|
||||
return -1;
|
||||
}
|
||||
if (a[field] < b[field]) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
.map(study => {
|
||||
let sortedStudies = studies.map(study => {
|
||||
if (!moment(study.studyDate, 'MMM DD, YYYY', true).isValid()) {
|
||||
study.studyDate = moment(study.studyDate, 'YYYYMMDD').format(
|
||||
'MMM DD, YYYY'
|
||||
);
|
||||
return study;
|
||||
});
|
||||
}
|
||||
return study;
|
||||
});
|
||||
|
||||
sortedStudies.sort(function(a, b) {
|
||||
let fieldA = a[field];
|
||||
let fieldB = b[field];
|
||||
if (field === 'studyDate') {
|
||||
fieldA = moment(fieldA).toISOString();
|
||||
fieldB = moment(fieldB).toISOString();
|
||||
}
|
||||
if (order === 'desc') {
|
||||
if (fieldA < fieldB) {
|
||||
return -1;
|
||||
}
|
||||
if (fieldA > fieldB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if (fieldA > fieldB) {
|
||||
return -1;
|
||||
}
|
||||
if (fieldA < fieldB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
this.setState({
|
||||
studies: sortedStudies,
|
||||
|
||||
@@ -49,48 +49,6 @@ export default function() {
|
||||
icon: 'angle-left',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'Bidirectional',
|
||||
type: 'tool',
|
||||
text: 'Bidirectional',
|
||||
icon: 'measure-target',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'Brush',
|
||||
type: 'tool',
|
||||
text: 'Brush',
|
||||
icon: 'circle',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'FreehandMouse',
|
||||
type: 'tool',
|
||||
text: 'Freehand',
|
||||
icon: 'star',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'EllipticalRoi',
|
||||
type: 'tool',
|
||||
text: 'EllipticalRoi',
|
||||
icon: 'oval',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'CircleRoi',
|
||||
type: 'tool',
|
||||
text: 'CircleRoi',
|
||||
icon: 'dot-circle',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'RectangleRoi',
|
||||
type: 'tool',
|
||||
text: 'RectangleRoi',
|
||||
icon: 'square-o',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
command: 'reset',
|
||||
type: 'command',
|
||||
|
||||
@@ -5,19 +5,28 @@ import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
* @param {String} baseDirectory
|
||||
* @param {String} webWorkScriptsPath
|
||||
*/
|
||||
export default function(baseDirectory, webWorkScriptsPath) {
|
||||
const scriptsPath = `${window.location.protocol}//${
|
||||
export default function initWebWorkers(
|
||||
baseDirectory = '/',
|
||||
webWorkScriptsPath = ''
|
||||
) {
|
||||
let scriptsPath = `${window.location.protocol}//${
|
||||
window.location.host
|
||||
}${baseDirectory}/${webWorkScriptsPath}`;
|
||||
}${baseDirectory}${webWorkScriptsPath}`;
|
||||
|
||||
// Ensure the last character is a slash
|
||||
if (scriptsPath[scriptsPath.length - 1] !== '/') {
|
||||
scriptsPath += '/';
|
||||
}
|
||||
|
||||
const config = {
|
||||
maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1),
|
||||
startWebWorkersOnDemand: true,
|
||||
webWorkerPath: `${scriptsPath}/cornerstoneWADOImageLoaderWebWorker.min.js`,
|
||||
webWorkerPath: `${scriptsPath}cornerstoneWADOImageLoaderWebWorker.min.js`,
|
||||
taskConfiguration: {
|
||||
decodeTask: {
|
||||
loadCodecsOnStartup: true,
|
||||
initializeCodecsOnStartup: false,
|
||||
codecsPath: `${scriptsPath}/cornerstoneWADOImageLoaderCodecs.min.js`,
|
||||
codecsPath: `${scriptsPath}cornerstoneWADOImageLoaderCodecs.min.js`,
|
||||
usePDFJS: false,
|
||||
strict: false,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user