Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25e6817248 | ||
|
|
681384b742 | ||
|
|
54e07c281f | ||
|
|
9dedccc7f9 | ||
|
|
621e63b3e1 | ||
|
|
64cf3b324d | ||
|
|
b7f315ca47 | ||
|
|
caaa032c4b |
No files matched your search
@@ -3,6 +3,30 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.52.28](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.27...@ohif/extension-vtk@0.52.28) (2019-11-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.27](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.26...@ohif/extension-vtk@0.52.27) (2019-10-31)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.52.26](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.25...@ohif/extension-vtk@0.52.26) (2019-10-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.52.25](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.24...@ohif/extension-vtk@0.52.25) (2019-10-29)
|
## [0.52.25](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.24...@ohif/extension-vtk@0.52.25) (2019-10-29)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-vtk
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-vtk",
|
"name": "@ohif/extension-vtk",
|
||||||
"version": "0.52.25",
|
"version": "0.52.28",
|
||||||
"description": "OHIF extension for VTK.js",
|
"description": "OHIF extension for VTK.js",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -52,8 +52,8 @@
|
|||||||
"react-vtkjs-viewport": "^0.3.7"
|
"react-vtkjs-viewport": "^0.3.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.1",
|
||||||
"@ohif/ui": "^0.58.2",
|
"@ohif/ui": "^0.58.5",
|
||||||
"cornerstone-tools": "^4.0.9",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.6.1",
|
"dcmjs": "^0.6.1",
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/OHIF/Viewers/compare/@ohif/core@1.6.0...@ohif/core@1.6.1) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [1.6.0](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.2...@ohif/core@1.6.0) (2019-10-26)
|
# [1.6.0](https://github.com/OHIF/Viewers/compare/@ohif/core@1.5.2...@ohif/core@1.6.0) (2019-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/core",
|
"name": "@ohif/core",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Generic business logic for web-based medical imaging applications",
|
"description": "Generic business logic for web-based medical imaging applications",
|
||||||
"author": "OHIF Core Team",
|
"author": "OHIF Core Team",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
export default function getModalities(modality, modalitiesInStudy) {
|
export default function getModalities(modality, modalitiesInStudy) {
|
||||||
let modalities = {};
|
if (!modality && !modalitiesInStudy) {
|
||||||
if (modality) {
|
return {};
|
||||||
modalities = modality;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modalities = modality || {
|
||||||
|
vr: 'CS',
|
||||||
|
Value: [],
|
||||||
|
};
|
||||||
|
|
||||||
if (modalitiesInStudy) {
|
if (modalitiesInStudy) {
|
||||||
// Find vr in modalities
|
|
||||||
if (modalities.vr && modalities.vr === modalitiesInStudy.vr) {
|
if (modalities.vr && modalities.vr === modalitiesInStudy.vr) {
|
||||||
for (let i = 0; i < modalitiesInStudy.Value.length; i++) {
|
for (let i = 0; i < modalitiesInStudy.Value.length; i++) {
|
||||||
const value = modalitiesInStudy.Value[i];
|
const value = modalitiesInStudy.Value[i];
|
||||||
@@ -14,8 +17,9 @@ export default function getModalities(modality, modalitiesInStudy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
modalities = modalitiesInStudy;
|
return modalitiesInStudy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return modalities;
|
return modalities;
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ function dateToString(date) {
|
|||||||
function getQIDOQueryParams(filter, serverSupportsQIDOIncludeField) {
|
function getQIDOQueryParams(filter, serverSupportsQIDOIncludeField) {
|
||||||
const commaSeparatedFields = [
|
const commaSeparatedFields = [
|
||||||
'00081030', // Study Description
|
'00081030', // Study Description
|
||||||
'00080060', //Modality
|
'00080060', // Modality
|
||||||
// Add more fields here if you want them in the result
|
// Add more fields here if you want them in the result
|
||||||
].join(',');
|
].join(',');
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,39 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.58.5](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.4...@ohif/ui@0.58.5) (2019-11-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Minor issues measurement panel related to description ([#1142](https://github.com/OHIF/Viewers/issues/1142)) ([681384b](https://github.com/OHIF/Viewers/commit/681384b7425c83b02a0ed83371ca92d78ca7838c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.3...@ohif/ui@0.58.4) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.58.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.2...@ohif/ui@0.58.3) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Fix ghost shadow on thumb ([#1113](https://github.com/OHIF/Viewers/issues/1113)) ([caaa032](https://github.com/OHIF/Viewers/commit/caaa032c4bc24fd69fdb01a15a8feb2721c321db))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.58.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.1...@ohif/ui@0.58.2) (2019-10-29)
|
## [0.58.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.1...@ohif/ui@0.58.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/ui",
|
"name": "@ohif/ui",
|
||||||
"version": "0.58.2",
|
"version": "0.58.5",
|
||||||
"description": "A set of React components for Medical Imaging Viewers",
|
"description": "A set of React components for Medical Imaging Viewers",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -49,9 +49,9 @@
|
|||||||
"prop-types": "15.6.2",
|
"prop-types": "15.6.2",
|
||||||
"react-bootstrap-modal": "4.2.0",
|
"react-bootstrap-modal": "4.2.0",
|
||||||
"react-dates": "21.2.1",
|
"react-dates": "21.2.1",
|
||||||
"react-dnd": "9.3.4",
|
"react-dnd": "9.4.0",
|
||||||
"react-dnd-html5-backend": "^9.3.4",
|
"react-dnd-html5-backend": "^9.4.0",
|
||||||
"react-dnd-touch-backend": "^9.3.4",
|
"react-dnd-touch-backend": "^9.4.0",
|
||||||
"react-i18next": "^10.11.0",
|
"react-i18next": "^10.11.0",
|
||||||
"react-with-direction": "1.3.0"
|
"react-with-direction": "1.3.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { StudyBrowser, ThumbnailEntry } from './studyBrowser';
|
import { StudyBrowser, Thumbnail } from './studyBrowser';
|
||||||
import { LayoutButton, LayoutChooser } from './layoutButton';
|
import { LayoutButton, LayoutChooser } from './layoutButton';
|
||||||
import { MeasurementTable, MeasurementTableItem } from './measurementTable';
|
import { MeasurementTable, MeasurementTableItem } from './measurementTable';
|
||||||
import { Overlay, OverlayTrigger } from './overlayTrigger';
|
import { Overlay, OverlayTrigger } from './overlayTrigger';
|
||||||
@@ -44,9 +44,9 @@ export {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AboutModal,
|
AboutModal,
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
.measurementLocation
|
.measurementLocation
|
||||||
margin-left: 9px;
|
margin-left: 9px;
|
||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: calc(100% - 50px);
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow-wrap: normal;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
.measurementDisplayText
|
.measurementDisplayText
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
.thumbnails-wrapper
|
.thumbnails-wrapper
|
||||||
transform-origin: 0% 0%
|
transform-origin: 0% 0%
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
.series-item
|
.series-item
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
transition: transform 0.3s ease
|
transition: transform 0.3s ease
|
||||||
transform-origin: 100% 0%
|
transform-origin: 100% 0%
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
float: right
|
float: right
|
||||||
|
|
||||||
.series-details
|
.series-details
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
.thumbnails-wrapper
|
.thumbnails-wrapper
|
||||||
transform: scale(1) translateY(0)
|
transform: scale(1) translateY(0)
|
||||||
|
|
||||||
.ThumbnailEntry .series-details
|
.thumbnail .series-details
|
||||||
opacity: 1
|
opacity: 1
|
||||||
transform: translateY(0)
|
transform: translateY(0)
|
||||||
transition-delay: 0.3s
|
transition-delay: 0.3s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { ThumbnailEntry } from './../studyBrowser';
|
import { Thumbnail } from './../studyBrowser';
|
||||||
import './SeriesList.styl';
|
import './SeriesList.styl';
|
||||||
|
|
||||||
export class SeriesList extends Component {
|
export class SeriesList extends Component {
|
||||||
@@ -24,7 +24,7 @@ export class SeriesList extends Component {
|
|||||||
getSeriesItems = () => {
|
getSeriesItems = () => {
|
||||||
return this.props.seriesItems.map((seriesData, index) => {
|
return this.props.seriesItems.map((seriesData, index) => {
|
||||||
return (
|
return (
|
||||||
<ThumbnailEntry
|
<Thumbnail
|
||||||
key={seriesData.displaySetInstanceUid}
|
key={seriesData.displaySetInstanceUid}
|
||||||
id={`series_thumb_${index}`}
|
id={`series_thumb_${index}`}
|
||||||
{...seriesData}
|
{...seriesData}
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
import React, { PureComponent, memo } from 'react';
|
|
||||||
import { DragLayer } from 'react-dnd';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry';
|
|
||||||
import './DragPreview.styl';
|
|
||||||
|
|
||||||
let subscribedToOffsetChange = false;
|
|
||||||
let dragPreviewRef = null;
|
|
||||||
|
|
||||||
const collector = monitor => {
|
|
||||||
if (!subscribedToOffsetChange) {
|
|
||||||
monitor.subscribeToOffsetChange(onOffsetChange(monitor));
|
|
||||||
subscribedToOffsetChange = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dragPreviewRef) {
|
|
||||||
const offset =
|
|
||||||
monitor.getSourceClientOffset() || monitor.getInitialSourceClientOffset();
|
|
||||||
|
|
||||||
if (offset) {
|
|
||||||
const transform = `translate(${offset.x}px, ${offset.y}px)`;
|
|
||||||
dragPreviewRef.style['transform'] = transform;
|
|
||||||
dragPreviewRef.style['-webkit-transform'] = transform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const item = monitor.getItem();
|
|
||||||
let newItem = {};
|
|
||||||
if (item) {
|
|
||||||
newItem = {
|
|
||||||
active: item.active,
|
|
||||||
altImageText: item.altImageText,
|
|
||||||
id: item.id,
|
|
||||||
imageSrc: item.imageSrc,
|
|
||||||
imageId: item.imageId,
|
|
||||||
instanceNumber: item.instanceNumber,
|
|
||||||
error: item.error,
|
|
||||||
numImageFrames: item.numImageFrames,
|
|
||||||
seriesDescription: item.seriesDescription,
|
|
||||||
seriesNumber: item.seriesNumber,
|
|
||||||
stackPercentComplete: item.stackPercentComplete,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
...newItem,
|
|
||||||
isDragging: monitor.isDragging(),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const onOffsetChange = monitor => () => {
|
|
||||||
if (!dragPreviewRef) return;
|
|
||||||
|
|
||||||
const offset =
|
|
||||||
monitor.getSourceClientOffset() || monitor.getInitialSourceClientOffset();
|
|
||||||
if (!offset) return;
|
|
||||||
|
|
||||||
const transform = `translate(${offset.x}px, ${offset.y}px)`;
|
|
||||||
dragPreviewRef.style['transform'] = transform;
|
|
||||||
dragPreviewRef.style['-webkit-transform'] = transform;
|
|
||||||
};
|
|
||||||
|
|
||||||
const updateRef = ref => {
|
|
||||||
dragPreviewRef = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DragPreview extends PureComponent {
|
|
||||||
render() {
|
|
||||||
const { isDragging } = this.props;
|
|
||||||
if (!isDragging) return null;
|
|
||||||
return (
|
|
||||||
<div className="DragPreview">
|
|
||||||
<div className="source-preview" ref={updateRef}>
|
|
||||||
<ThumbnailEntry {...this.props} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DragPreview.propTypes = {
|
|
||||||
isDragging: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DragLayer(collector)(memo(DragPreview));
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
.DragPreview
|
|
||||||
|
|
||||||
.source-preview {
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
position: fixed;
|
|
||||||
opacity: 0.5;
|
|
||||||
z-index: 9999;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
transition: none;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
}
|
|
||||||
@@ -1,62 +1,103 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry';
|
import { Thumbnail } from './Thumbnail.js';
|
||||||
import ThumbnailEntryDragSource from './ThumbnailEntryDragSource.js';
|
|
||||||
import './StudyBrowser.styl';
|
import './StudyBrowser.styl';
|
||||||
|
|
||||||
class StudyBrowser extends Component {
|
function StudyBrowser(props) {
|
||||||
static defaultProps = {
|
const {
|
||||||
studies: [],
|
studies,
|
||||||
supportsDragAndDrop: true,
|
onThumbnailClick,
|
||||||
};
|
onThumbnailDoubleClick,
|
||||||
|
supportsDrag,
|
||||||
|
} = props;
|
||||||
|
|
||||||
static propTypes = {
|
return (
|
||||||
studies: PropTypes.array.isRequired,
|
<div className="study-browser">
|
||||||
supportsDragAndDrop: PropTypes.bool.isRequired,
|
<div className="scrollable-study-thumbnails">
|
||||||
onThumbnailClick: PropTypes.func,
|
{studies
|
||||||
onThumbnailDoubleClick: PropTypes.func,
|
.map((study, studyIndex) => {
|
||||||
};
|
const { studyInstanceUid } = study;
|
||||||
|
return study.thumbnails.map((thumb, thumbIndex) => {
|
||||||
|
// TODO: Thumb has more props than we care about?
|
||||||
|
const {
|
||||||
|
altImageText,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
imageId,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
stackPercentComplete,
|
||||||
|
} = thumb;
|
||||||
|
|
||||||
render() {
|
return (
|
||||||
const studies = this.props.studies;
|
<div
|
||||||
|
key={`container_${studyIndex}_${thumbIndex}`}
|
||||||
const thumbnails = studies.map((study, studyIndex) => {
|
className="thumbnail-container"
|
||||||
return study.thumbnails.map((thumb, thumbIndex) => {
|
data-cy="thumbnail-list"
|
||||||
if (this.props.supportsDragAndDrop) {
|
>
|
||||||
return (
|
<Thumbnail
|
||||||
<ThumbnailEntryDragSource
|
supportsDrag={supportsDrag}
|
||||||
key={thumb.displaySetInstanceUid}
|
key={`${studyIndex}_${thumbIndex}`}
|
||||||
{...study}
|
id={`${studyIndex}_${thumbIndex}`} // Unused?
|
||||||
{...thumb}
|
// Study
|
||||||
id={`${studyIndex}_${thumbIndex}`}
|
studyInstanceUid={studyInstanceUid} // used by drop
|
||||||
onClick={this.props.onThumbnailClick}
|
// Thumb
|
||||||
onDoubleClick={this.props.onThumbnailDoubleClick}
|
altImageText={altImageText}
|
||||||
/>
|
imageId={imageId}
|
||||||
);
|
instanceNumber={instanceNumber}
|
||||||
} else {
|
displaySetInstanceUid={displaySetInstanceUid} // used by drop
|
||||||
return (
|
numImageFrames={numImageFrames}
|
||||||
<div className="ThumbnailEntryContainer" data-cy="thumbnail-list">
|
seriesDescription={seriesDescription}
|
||||||
<ThumbnailEntry
|
seriesNumber={seriesNumber}
|
||||||
key={thumb.displaySetInstanceUid}
|
stackPercentComplete={stackPercentComplete}
|
||||||
{...study}
|
// Events
|
||||||
{...thumb}
|
onClick={onThumbnailClick.bind(
|
||||||
id={`${studyIndex}_${thumbIndex}`}
|
undefined,
|
||||||
onClick={this.props.onThumbnailClick}
|
displaySetInstanceUid
|
||||||
onDoubleClick={this.props.onThumbnailDoubleClick}
|
)}
|
||||||
/>
|
onDoubleClick={onThumbnailDoubleClick}
|
||||||
</div>
|
/>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
.flat()}
|
||||||
const components = thumbnails.flat();
|
|
||||||
return (
|
|
||||||
<div className="StudyBrowser">
|
|
||||||
<div className="scrollable-study-thumbnails">{components}</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const noop = () => {};
|
||||||
|
|
||||||
|
StudyBrowser.propTypes = {
|
||||||
|
studies: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
studyInstanceUid: PropTypes.string.isRequired,
|
||||||
|
thumbnails: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
altImageText: PropTypes.string,
|
||||||
|
displaySetInstanceUid: PropTypes.string.isRequired,
|
||||||
|
imageId: PropTypes.string,
|
||||||
|
instanceNumber: PropTypes.number,
|
||||||
|
numImageFrames: PropTypes.number,
|
||||||
|
seriesDescription: PropTypes.string,
|
||||||
|
seriesNumber: PropTypes.number,
|
||||||
|
stackPercentComplete: PropTypes.number,
|
||||||
|
})
|
||||||
|
),
|
||||||
|
})
|
||||||
|
).isRequired,
|
||||||
|
supportsDrag: PropTypes.bool,
|
||||||
|
onThumbnailClick: PropTypes.func,
|
||||||
|
onThumbnailDoubleClick: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
StudyBrowser.defaultProps = {
|
||||||
|
studies: [],
|
||||||
|
supportsDrag: true,
|
||||||
|
onThumbnailClick: noop,
|
||||||
|
onThumbnailDoubleClick: noop,
|
||||||
|
};
|
||||||
|
|
||||||
export { StudyBrowser };
|
export { StudyBrowser };
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.StudyBrowser
|
.study-browser
|
||||||
float: left
|
float: left
|
||||||
height: 100%
|
height: 100%
|
||||||
width: 100%
|
width: 100%
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
&::-webkit-scrollbar
|
&::-webkit-scrollbar
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
.ThumbnailEntryContainer
|
.thumbnail-container
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { useDrag } from 'react-dnd';
|
||||||
|
import ImageThumbnail from './ImageThumbnail';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import './Thumbnail.styl';
|
||||||
|
|
||||||
|
function ThumbnailFooter({
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
}) {
|
||||||
|
const infoOnly = !seriesDescription;
|
||||||
|
|
||||||
|
const getInfo = (value, icon, className = '') => {
|
||||||
|
return (
|
||||||
|
<div className={classNames('item item-series', className)}>
|
||||||
|
<div className="icon">{icon}</div>
|
||||||
|
<div className="value">{value}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const getSeriesInformation = (
|
||||||
|
seriesNumber,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames
|
||||||
|
) => {
|
||||||
|
if (!seriesNumber && !instanceNumber && !numImageFrames) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="series-information">
|
||||||
|
{getInfo(seriesNumber, 'S:')}
|
||||||
|
{getInfo(instanceNumber, 'I:')}
|
||||||
|
{getInfo(numImageFrames, '', 'image-frames')}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classNames('series-details', { 'info-only': infoOnly })}>
|
||||||
|
<div className="series-description">{seriesDescription}</div>
|
||||||
|
{getSeriesInformation(seriesNumber, instanceNumber, numImageFrames)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Thumbnail(props) {
|
||||||
|
const {
|
||||||
|
active,
|
||||||
|
altImageText,
|
||||||
|
error,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
imageId,
|
||||||
|
imageSrc,
|
||||||
|
instanceNumber,
|
||||||
|
numImageFrames,
|
||||||
|
seriesDescription,
|
||||||
|
seriesNumber,
|
||||||
|
stackPercentComplete,
|
||||||
|
studyInstanceUid,
|
||||||
|
onClick,
|
||||||
|
onDoubleClick,
|
||||||
|
onMouseDown,
|
||||||
|
supportsDrag,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const [collectedProps, drag, dragPreview] = useDrag({
|
||||||
|
// `droppedItem` in `dropTarget`
|
||||||
|
// The only data it will have access to
|
||||||
|
item: {
|
||||||
|
studyInstanceUid,
|
||||||
|
displaySetInstanceUid,
|
||||||
|
type: 'thumbnail', // Has to match `dropTarget`'s type
|
||||||
|
},
|
||||||
|
canDrag: function(monitor) {
|
||||||
|
return supportsDrag;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasImage = imageSrc || imageId;
|
||||||
|
const hasAltText = altImageText !== undefined;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref={drag}
|
||||||
|
className={classNames('thumbnail', { active: active })}
|
||||||
|
onClick={onClick}
|
||||||
|
onDoubleClick={onDoubleClick}
|
||||||
|
onMouseDown={onMouseDown}
|
||||||
|
>
|
||||||
|
{/* SHOW IMAGE */}
|
||||||
|
{hasImage && (
|
||||||
|
<ImageThumbnail
|
||||||
|
imageSrc={imageSrc}
|
||||||
|
imageId={imageId}
|
||||||
|
error={error}
|
||||||
|
stackPercentComplete={stackPercentComplete}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{/* SHOW TEXT ALTERNATIVE */}
|
||||||
|
{!hasImage && hasAltText && (
|
||||||
|
<div className={'alt-image-text p-x-1'}>
|
||||||
|
<h1>{altImageText}</h1>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{ThumbnailFooter(props)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const noop = () => {};
|
||||||
|
|
||||||
|
Thumbnail.propTypes = {
|
||||||
|
supportsDrag: PropTypes.bool,
|
||||||
|
id: PropTypes.string.isRequired,
|
||||||
|
displaySetInstanceUid: PropTypes.string.isRequired,
|
||||||
|
studyInstanceUid: PropTypes.string.isRequired,
|
||||||
|
imageSrc: PropTypes.string,
|
||||||
|
imageId: PropTypes.string,
|
||||||
|
error: PropTypes.bool,
|
||||||
|
active: PropTypes.bool,
|
||||||
|
stackPercentComplete: PropTypes.number,
|
||||||
|
/**
|
||||||
|
altImageText will be used when no imageId or imageSrc is provided.
|
||||||
|
It will be displayed inside the <div>. This is useful when it is difficult
|
||||||
|
to make a preview for a type of DICOM series (e.g. DICOM-SR)
|
||||||
|
*/
|
||||||
|
altImageText: PropTypes.string,
|
||||||
|
seriesDescription: PropTypes.string,
|
||||||
|
seriesNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
instanceNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
numImageFrames: PropTypes.number,
|
||||||
|
onDoubleClick: PropTypes.func,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
onMouseDown: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
Thumbnail.defaultProps = {
|
||||||
|
supportsDrag: false,
|
||||||
|
active: false,
|
||||||
|
error: false,
|
||||||
|
stackPercentComplete: 0,
|
||||||
|
onDoubleClick: noop,
|
||||||
|
onClick: noop,
|
||||||
|
onMouseDown: noop,
|
||||||
|
};
|
||||||
|
|
||||||
|
export { Thumbnail };
|
||||||
+31
-52
@@ -4,12 +4,12 @@
|
|||||||
--series-count-background-color: #678696;
|
--series-count-background-color: #678696;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ThumbnailEntry
|
.thumbnail
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
display: table
|
display: table
|
||||||
|
margin: 0 auto;
|
||||||
.p-x-1
|
min-width: 90%;
|
||||||
padding: 0 1rem
|
padding-bottom: 1.5rem;
|
||||||
|
|
||||||
.alt-image-text
|
.alt-image-text
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -31,6 +31,8 @@
|
|||||||
color: var(--text-primary-color);
|
color: var(--text-primary-color);
|
||||||
|
|
||||||
.series-details
|
.series-details
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column
|
||||||
color: var(--text-primary-color);
|
color: var(--text-primary-color);
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
line-height: 1.3em
|
line-height: 1.3em
|
||||||
@@ -38,64 +40,30 @@
|
|||||||
margin-left: 1rem
|
margin-left: 1rem
|
||||||
margin-right: 0.5rem
|
margin-right: 0.5rem
|
||||||
max-width: 217px
|
max-width: 217px
|
||||||
min-height: 36px
|
|
||||||
position: relative
|
position: relative
|
||||||
word-wrap: break-word
|
word-wrap: break-word
|
||||||
|
|
||||||
&.info-only
|
.series-description
|
||||||
.series-description
|
flex-grow: 1
|
||||||
display: none
|
|
||||||
|
|
||||||
.series-information
|
|
||||||
display: flex
|
|
||||||
flex-grow: 1
|
|
||||||
float: none
|
|
||||||
max-width: none
|
|
||||||
padding-right: 0
|
|
||||||
|
|
||||||
.item
|
|
||||||
flex: 1
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
.icon, .value
|
|
||||||
display: inline
|
|
||||||
float: none
|
|
||||||
line-height: 25px
|
|
||||||
|
|
||||||
|
&.info-only .series-description
|
||||||
|
display: none
|
||||||
|
|
||||||
.series-information
|
.series-information
|
||||||
display: flex
|
display: flex
|
||||||
flex-direction: row
|
flex-direction: row
|
||||||
align-items: center
|
justify-content: space-between
|
||||||
|
|
||||||
.item
|
|
||||||
flex: 1
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
.item-frames .icon
|
.item-frames .icon
|
||||||
height: 18px
|
height: 18px
|
||||||
|
|
||||||
.value
|
.item-series.image-frames .icon
|
||||||
color: var(--text-secondary-color);
|
|
||||||
display: inline
|
|
||||||
font-size: 12px
|
|
||||||
margin-left: 4px
|
|
||||||
text-overflow: ellipsis
|
|
||||||
white-space: nowrap
|
|
||||||
|
|
||||||
.icon
|
|
||||||
color: var(--active-color);
|
|
||||||
display: inline
|
|
||||||
font-size: 10px
|
|
||||||
font-weight: 900
|
|
||||||
text-align: right
|
|
||||||
|
|
||||||
div
|
|
||||||
background-color: var(--series-count-background-color);
|
background-color: var(--series-count-background-color);
|
||||||
margin-top: 6px
|
margin-top: 6px
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
|
content: ''
|
||||||
background-color: var(--active-color);
|
background-color: var(--active-color);
|
||||||
box-shadow: 1px 1px rgba(0, 0, 0, .115)
|
box-shadow: 1px 1px rgba(0, 0, 0, .115)
|
||||||
left: -4px
|
left: -4px
|
||||||
@@ -104,16 +72,27 @@
|
|||||||
|
|
||||||
&
|
&
|
||||||
&:after
|
&:after
|
||||||
border: 0px solid var(--series-count-background-color)
|
|
||||||
content: ''
|
content: ''
|
||||||
|
border: 0px solid var(--series-count-background-color)
|
||||||
display: inline-block
|
display: inline-block
|
||||||
height: 11px
|
height: 11px
|
||||||
width: 11px
|
width: 11px
|
||||||
|
|
||||||
.image-thumbnail-clone
|
.value
|
||||||
z-index: 100000
|
color: var(--text-secondary-color);
|
||||||
pointer-events: none
|
display: inline-block
|
||||||
|
font-size: 12px
|
||||||
|
margin-left: 4px
|
||||||
|
overflow: hidden
|
||||||
|
text-overflow: ellipsis
|
||||||
|
white-space: nowrap
|
||||||
|
width: calc(100% - 15px)
|
||||||
|
vertical-align: middle
|
||||||
|
|
||||||
&:hover
|
.icon
|
||||||
border-color: var(--hover-color);
|
color: var(--active-color);
|
||||||
box-shadow: none
|
display: inline-block
|
||||||
|
font-size: 10px
|
||||||
|
font-weight: 900
|
||||||
|
text-align: right
|
||||||
|
width: 11px
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import ImageThumbnail from './ImageThumbnail';
|
|
||||||
import './ThumbnailEntry.styl';
|
|
||||||
import classnames from 'classnames';
|
|
||||||
|
|
||||||
class ThumbnailEntry extends Component {
|
|
||||||
static defaultProps = {
|
|
||||||
active: false,
|
|
||||||
error: false,
|
|
||||||
stackPercentComplete: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
id: PropTypes.string.isRequired,
|
|
||||||
imageSrc: PropTypes.string,
|
|
||||||
imageId: PropTypes.string,
|
|
||||||
error: PropTypes.bool.isRequired,
|
|
||||||
active: PropTypes.bool.isRequired,
|
|
||||||
stackPercentComplete: PropTypes.number,
|
|
||||||
/**
|
|
||||||
altImageText will be used when no imageId or imageSrc is provided.
|
|
||||||
It will be displayed inside the <div>. This is useful when it is difficult
|
|
||||||
to make a preview for a type of DICOM series (e.g. DICOM-SR)
|
|
||||||
*/
|
|
||||||
altImageText: PropTypes.string,
|
|
||||||
seriesDescription: PropTypes.string,
|
|
||||||
seriesNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
||||||
instanceNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
||||||
numImageFrames: PropTypes.number,
|
|
||||||
onDoubleClick: PropTypes.func,
|
|
||||||
onClick: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const hasInstanceNumber = this.props.instanceNumber !== undefined;
|
|
||||||
|
|
||||||
let className = classnames('ThumbnailEntry noselect', {
|
|
||||||
active: this.props.active,
|
|
||||||
});
|
|
||||||
|
|
||||||
let contents = null;
|
|
||||||
if (this.props.imageSrc || this.props.imageId) {
|
|
||||||
contents = (
|
|
||||||
<div className="p-x-1">
|
|
||||||
<ImageThumbnail
|
|
||||||
imageSrc={this.props.imageSrc}
|
|
||||||
imageId={this.props.imageId}
|
|
||||||
error={this.props.error}
|
|
||||||
stackPercentComplete={this.props.stackPercentComplete}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else if (this.props.altImageText) {
|
|
||||||
contents = (
|
|
||||||
<div className="p-x-1">
|
|
||||||
<div className="alt-image-text">
|
|
||||||
<h1>{this.props.altImageText}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={className}
|
|
||||||
onClick={this.onClick}
|
|
||||||
onDoubleClick={this.onDoubleClick}
|
|
||||||
onMouseDown={this.onMouseDown}
|
|
||||||
>
|
|
||||||
{contents}
|
|
||||||
<div
|
|
||||||
className="series-details"
|
|
||||||
>
|
|
||||||
<div className="series-description">
|
|
||||||
{this.props.seriesDescription}
|
|
||||||
</div>
|
|
||||||
<div className="series-information">
|
|
||||||
<div className="item item-series">
|
|
||||||
<div className="icon">S:</div>
|
|
||||||
<div className="value">{this.props.seriesNumber}</div>
|
|
||||||
</div>
|
|
||||||
{hasInstanceNumber && (
|
|
||||||
<div className="item item-series">
|
|
||||||
<div className="icon">I:</div>
|
|
||||||
<div className="value">{this.props.instanceNumber}</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="item item-frames">
|
|
||||||
<div className="icon">
|
|
||||||
<div />
|
|
||||||
</div>
|
|
||||||
<div className="value">{this.props.numImageFrames}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
onClick = () => {
|
|
||||||
if (this.props.onClick) {
|
|
||||||
this.props.onClick(this.props.displaySetInstanceUid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onDoubleClick = () => {
|
|
||||||
if (this.props.onDoubleClick) {
|
|
||||||
this.props.onDoubleClick(this.props.displaySetInstanceUid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export { ThumbnailEntry };
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { DragSource } from 'react-dnd';
|
|
||||||
import DragPreview from './DragPreview';
|
|
||||||
import { ThumbnailEntry } from './ThumbnailEntry.js';
|
|
||||||
|
|
||||||
// Drag sources and drop targets only interact
|
|
||||||
// if they have the same string type.
|
|
||||||
const Types = {
|
|
||||||
THUMBNAIL: 'thumbnail',
|
|
||||||
};
|
|
||||||
|
|
||||||
const thumbnailSource = {
|
|
||||||
/*canDrag(props) {
|
|
||||||
return props.error === false;
|
|
||||||
},*/
|
|
||||||
|
|
||||||
beginDrag(props) {
|
|
||||||
return props;
|
|
||||||
},
|
|
||||||
|
|
||||||
endDrag(props, monitor) {
|
|
||||||
//const item = monitor.getItem();
|
|
||||||
const dropResult = monitor.getDropResult();
|
|
||||||
|
|
||||||
if (dropResult) {
|
|
||||||
//console.log(`You dropped ${item.id} into ${dropResult.id}!`);
|
|
||||||
//console.log(item);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
class ThumbnailEntryDragSource extends Component {
|
|
||||||
static propTypes = {
|
|
||||||
connectDragSource: PropTypes.func.isRequired,
|
|
||||||
isDragging: PropTypes.bool.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
isDragging: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { connectDragSource } = this.props;
|
|
||||||
const dropEffect = 'copy';
|
|
||||||
|
|
||||||
return connectDragSource(
|
|
||||||
<div className="ThumbnailEntryContainer" data-cy="thumbnail-list">
|
|
||||||
<DragPreview {...this.props} />
|
|
||||||
<ThumbnailEntry {...this.props} />
|
|
||||||
</div>,
|
|
||||||
{ dropEffect }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const collect = (connect, monitor) => ({
|
|
||||||
connectDragSource: connect.dragSource(),
|
|
||||||
isDragging: monitor.isDragging(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DragSource(Types.THUMBNAIL, thumbnailSource, collect)(
|
|
||||||
ThumbnailEntryDragSource
|
|
||||||
);
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
export { StudyBrowser } from './StudyBrowser.js';
|
export { StudyBrowser } from './StudyBrowser.js';
|
||||||
export { ThumbnailEntry } from './ThumbnailEntry.js';
|
export { Thumbnail } from './Thumbnail.js';
|
||||||
@@ -5,12 +5,9 @@ import classNames from 'classnames';
|
|||||||
import TableSearchFilter from './TableSearchFilter.js';
|
import TableSearchFilter from './TableSearchFilter.js';
|
||||||
import useMedia from '../../hooks/useMedia.js';
|
import useMedia from '../../hooks/useMedia.js';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ColorHash from './internal/color-hash.js';
|
|
||||||
import { StudyListLoadingText } from './StudyListLoadingText.js';
|
import { StudyListLoadingText } from './StudyListLoadingText.js';
|
||||||
import { withTranslation } from '../../utils/LanguageProvider';
|
import { withTranslation } from '../../utils/LanguageProvider';
|
||||||
|
|
||||||
const colorHash = new ColorHash();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -236,13 +233,15 @@ function TableRow(props) {
|
|||||||
onClick={() => handleClick(studyInstanceUid)}
|
onClick={() => handleClick(studyInstanceUid)}
|
||||||
className={classNames({ active: isHighlighted })}
|
className={classNames({ active: isHighlighted })}
|
||||||
>
|
>
|
||||||
<td className={classNames({ emptyCell: !patientName })}>
|
<td className={classNames({ 'empty-value': !patientName })}>
|
||||||
{patientName || `(${t('Empty')})`}
|
{patientName || `(${t('Empty')})`}
|
||||||
</td>
|
</td>
|
||||||
<td>{patientId}</td>
|
<td>{patientId}</td>
|
||||||
<td>{accessionNumber}</td>
|
<td>{accessionNumber}</td>
|
||||||
<td>{studyDate}</td>
|
<td>{studyDate}</td>
|
||||||
<td>{modalities}</td>
|
<td className={classNames({ 'empty-value': !modalities })}>
|
||||||
|
{modalities || `(${t('Empty')})`}
|
||||||
|
</td>
|
||||||
<td>{studyDescription}</td>
|
<td>{studyDescription}</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
@@ -252,7 +251,7 @@ function TableRow(props) {
|
|||||||
onClick={() => handleClick(studyInstanceUid)}
|
onClick={() => handleClick(studyInstanceUid)}
|
||||||
className={classNames({ active: isHighlighted })}
|
className={classNames({ active: isHighlighted })}
|
||||||
>
|
>
|
||||||
<td className={classNames({ emptyCell: !patientName })}>
|
<td className={classNames({ 'empty-value': !patientName })}>
|
||||||
{patientName || `(${t('Empty')})`}
|
{patientName || `(${t('Empty')})`}
|
||||||
<div style={{ color: '#60656f' }}>{patientId}</div>
|
<div style={{ color: '#60656f' }}>{patientId}</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -274,25 +273,19 @@ function TableRow(props) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
minWidth: '80px',
|
maxWidth: '80px',
|
||||||
maxWidth: '100px',
|
width: '80px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
className={classNames({
|
||||||
backgroundColor: colorHash.hex(modalities),
|
modalities: modalities,
|
||||||
borderRadius: '16px',
|
'empty-value': !modalities,
|
||||||
padding: '2px 8px 0px 8px',
|
})}
|
||||||
fontWeight: 500,
|
|
||||||
marginBottom: '4px',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
}}
|
|
||||||
aria-label={modalities}
|
aria-label={modalities}
|
||||||
title={modalities}
|
title={modalities}
|
||||||
>
|
>
|
||||||
{modalities}
|
{modalities || `(${t('Empty')})`}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -322,7 +315,7 @@ function TableRow(props) {
|
|||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
{/* NAME AND ID */}
|
{/* NAME AND ID */}
|
||||||
<div
|
<div
|
||||||
className={classNames({ emptyCell: !patientName })}
|
className={classNames({ 'empty-value': !patientName })}
|
||||||
style={{ width: '150px', minWidth: '150px' }}
|
style={{ width: '150px', minWidth: '150px' }}
|
||||||
>
|
>
|
||||||
<div style={{ fontWeight: 500, paddingTop: '3px' }}>
|
<div style={{ fontWeight: 500, paddingTop: '3px' }}>
|
||||||
@@ -348,19 +341,19 @@ function TableRow(props) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
minWidth: '80px',
|
maxWidth: '80px',
|
||||||
|
width: '80px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
className={classNames({
|
||||||
backgroundColor: colorHash.hex(modalities),
|
modalities: modalities,
|
||||||
borderRadius: '16px',
|
'empty-value': !modalities,
|
||||||
padding: '2px 8px 0px 8px',
|
})}
|
||||||
fontWeight: 500,
|
aria-label={modalities}
|
||||||
marginBottom: '4px',
|
title={modalities}
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{modalities}
|
{modalities || `(${t('Empty')})`}
|
||||||
</div>
|
</div>
|
||||||
<div>{studyDate}</div>
|
<div>{studyDate}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -381,7 +374,7 @@ function TableRow(props) {
|
|||||||
TableRow.propTypes = {
|
TableRow.propTypes = {
|
||||||
accessionNumber: PropTypes.string.isRequired,
|
accessionNumber: PropTypes.string.isRequired,
|
||||||
isHighlighted: PropTypes.bool,
|
isHighlighted: PropTypes.bool,
|
||||||
modalities: PropTypes.string.isRequired,
|
modalities: PropTypes.string,
|
||||||
patientId: PropTypes.string.isRequired,
|
patientId: PropTypes.string.isRequired,
|
||||||
patientName: PropTypes.string.isRequired,
|
patientName: PropTypes.string.isRequired,
|
||||||
studyDate: PropTypes.string.isRequired,
|
studyDate: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -113,11 +113,18 @@ table.table
|
|||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
color: var(--table-text-primary-color)
|
||||||
|
font-weight: 300
|
||||||
|
|
||||||
> tbody tr
|
> tbody tr
|
||||||
padding: 5px
|
padding: 5px
|
||||||
background-color: black
|
background-color: black
|
||||||
|
|
||||||
|
> tbody td
|
||||||
|
padding: $body-cell-top-bottom-padding 8px;
|
||||||
|
height: $body-cell-height
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
/* Striped Variant */
|
/* Striped Variant */
|
||||||
&.table--striped > tbody tr:nth-child(even)
|
&.table--striped > tbody tr:nth-child(even)
|
||||||
background-color: var(--ui-gray-darker)
|
background-color: var(--ui-gray-darker)
|
||||||
@@ -130,6 +137,9 @@ table.table
|
|||||||
&:hover, &:active, &.active
|
&:hover, &:active, &.active
|
||||||
background-color: var(--ui-gray-darker)
|
background-color: var(--ui-gray-darker)
|
||||||
|
|
||||||
|
.empty-value
|
||||||
|
color: var(--ui-gray-light)
|
||||||
|
|
||||||
.study-list-container > table.table > tr
|
.study-list-container > table.table > tr
|
||||||
height: 20px
|
height: 20px
|
||||||
|
|
||||||
@@ -146,18 +156,14 @@ table.table
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
|
|
||||||
.study-list-container > table.table > tbody > tr > td
|
|
||||||
padding: $body-cell-top-bottom-padding 8px;
|
|
||||||
height: $body-cell-height
|
|
||||||
color: var(--table-text-primary-color)
|
|
||||||
font-weight: 300
|
|
||||||
word-wrap: break-word;
|
|
||||||
|
|
||||||
&.emptyCell
|
|
||||||
color: var(--ui-gray-light)
|
|
||||||
|
|
||||||
.study-list-container > table.table > thead > tr > th.studyDate
|
.study-list-container > table.table > thead > tr > th.studyDate
|
||||||
min-width: 230px
|
min-width: 230px
|
||||||
|
.study-list-container > table.table .modalities
|
||||||
|
font-weight: 500;
|
||||||
|
min-height: 20px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.study-list-container
|
.study-list-container
|
||||||
.filters
|
.filters
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
/**
|
|
||||||
* BKDR Hash (modified version)
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Number}
|
|
||||||
*/
|
|
||||||
function BKDRHash(str) {
|
|
||||||
const seed = 131;
|
|
||||||
const seed2 = 137;
|
|
||||||
let hash = 0;
|
|
||||||
// make hash more sensitive for short string like 'a', 'b', 'c'
|
|
||||||
str += 'x';
|
|
||||||
// Note: Number.MAX_SAFE_INTEGER equals 9007199254740991
|
|
||||||
var MAX_SAFE_INTEGER = parseInt(9007199254740991 / seed2);
|
|
||||||
for (var i = 0; i < str.length; i++) {
|
|
||||||
if (hash > MAX_SAFE_INTEGER) {
|
|
||||||
hash = parseInt(hash / seed2);
|
|
||||||
}
|
|
||||||
hash = hash * seed + str.charCodeAt(i);
|
|
||||||
}
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BKDRHash;
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
import BKDRHash from './bkdr-hash';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert RGB Array to HEX
|
|
||||||
*
|
|
||||||
* @param {Array} RGBArray - [R, G, B]
|
|
||||||
* @returns {String} 6 digits hex starting with #
|
|
||||||
*/
|
|
||||||
function RGB2HEX(RGBArray) {
|
|
||||||
let hex = '#';
|
|
||||||
RGBArray.forEach(function(value) {
|
|
||||||
if (value < 16) {
|
|
||||||
hex += 0;
|
|
||||||
}
|
|
||||||
hex += value.toString(16);
|
|
||||||
});
|
|
||||||
return hex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert HSL to RGB
|
|
||||||
*
|
|
||||||
* @see {@link http://zh.wikipedia.org/wiki/HSL和HSV色彩空间} for further information.
|
|
||||||
* @param {Number} H Hue ∈ [0, 360)
|
|
||||||
* @param {Number} S Saturation ∈ [0, 1]
|
|
||||||
* @param {Number} L Lightness ∈ [0, 1]
|
|
||||||
* @returns {Array} R, G, B ∈ [0, 255]
|
|
||||||
*/
|
|
||||||
function HSL2RGB(H, S, L) {
|
|
||||||
H /= 360;
|
|
||||||
|
|
||||||
const q = L < 0.5 ? L * (1 + S) : L + S - L * S;
|
|
||||||
const p = 2 * L - q;
|
|
||||||
|
|
||||||
return [H + 1 / 3, H, H - 1 / 3].map(function(color) {
|
|
||||||
if (color < 0) {
|
|
||||||
color++;
|
|
||||||
}
|
|
||||||
if (color > 1) {
|
|
||||||
color--;
|
|
||||||
}
|
|
||||||
if (color < 1 / 6) {
|
|
||||||
color = p + (q - p) * 6 * color;
|
|
||||||
} else if (color < 0.5) {
|
|
||||||
color = q;
|
|
||||||
} else if (color < 2 / 3) {
|
|
||||||
color = p + (q - p) * 6 * (2 / 3 - color);
|
|
||||||
} else {
|
|
||||||
color = p;
|
|
||||||
}
|
|
||||||
return Math.round(color * 255);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function isArray(o) {
|
|
||||||
return Object.prototype.toString.call(o) === '[object Array]';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Color Hash Class
|
|
||||||
*
|
|
||||||
* @class
|
|
||||||
*/
|
|
||||||
const ColorHash = function(options = {}) {
|
|
||||||
const LS = [options.lightness, options.saturation].map(function(param) {
|
|
||||||
param = param || [0.35, 0.5, 0.65]; // note that 3 is a prime
|
|
||||||
return isArray(param) ? param.concat() : [param];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.L = LS[0];
|
|
||||||
this.S = LS[1];
|
|
||||||
|
|
||||||
if (typeof options.hue === 'number') {
|
|
||||||
options.hue = { min: options.hue, max: options.hue };
|
|
||||||
}
|
|
||||||
if (typeof options.hue === 'object' && !isArray(options.hue)) {
|
|
||||||
options.hue = [options.hue];
|
|
||||||
}
|
|
||||||
if (typeof options.hue === 'undefined') {
|
|
||||||
options.hue = [];
|
|
||||||
}
|
|
||||||
this.hueRanges = options.hue.map(function(range) {
|
|
||||||
return {
|
|
||||||
min: typeof range.min === 'undefined' ? 0 : range.min,
|
|
||||||
max: typeof range.max === 'undefined' ? 360 : range.max,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
this.hash = options.hash || BKDRHash;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in [h, s, l].
|
|
||||||
* Note that H ∈ [0, 360); S ∈ [0, 1]; L ∈ [0, 1];
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Array} [h, s, l]
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.hsl = function(str) {
|
|
||||||
var H, S, L;
|
|
||||||
var hash = this.hash(str);
|
|
||||||
|
|
||||||
if (this.hueRanges.length) {
|
|
||||||
var range = this.hueRanges[hash % this.hueRanges.length];
|
|
||||||
var hueResolution = 727; // note that 727 is a prime
|
|
||||||
H =
|
|
||||||
(((hash / this.hueRanges.length) % hueResolution) *
|
|
||||||
(range.max - range.min)) /
|
|
||||||
hueResolution +
|
|
||||||
range.min;
|
|
||||||
} else {
|
|
||||||
H = hash % 359; // note that 359 is a prime
|
|
||||||
}
|
|
||||||
hash = parseInt(hash / 360);
|
|
||||||
S = this.S[hash % this.S.length];
|
|
||||||
hash = parseInt(hash / this.S.length);
|
|
||||||
L = this.L[hash % this.L.length];
|
|
||||||
|
|
||||||
return [H, S, L];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in [r, g, b].
|
|
||||||
* Note that R, G, B ∈ [0, 255]
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {Array} [r, g, b]
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.rgb = function(str) {
|
|
||||||
var hsl = this.hsl(str);
|
|
||||||
return HSL2RGB.apply(this, hsl);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hash in hex
|
|
||||||
*
|
|
||||||
* @param {String} str string to hash
|
|
||||||
* @returns {String} hex with #
|
|
||||||
*/
|
|
||||||
ColorHash.prototype.hex = function(str) {
|
|
||||||
var rgb = this.rgb(str);
|
|
||||||
return RGB2HEX(rgb);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ColorHash;
|
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
.itemContent
|
.itemContent
|
||||||
flex: 1
|
flex: 1
|
||||||
color: var(--text-secondary-color)
|
color: var(--text-secondary-color)
|
||||||
|
width: calc(100% - 30px);
|
||||||
font-weight: 400
|
font-weight: 400
|
||||||
margin-left: 9px;
|
margin-left: 9px;
|
||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AboutModal,
|
AboutModal,
|
||||||
@@ -86,9 +86,9 @@ export {
|
|||||||
StudyList,
|
StudyList,
|
||||||
TableList,
|
TableList,
|
||||||
TableListItem,
|
TableListItem,
|
||||||
|
Thumbnail,
|
||||||
TableSearchFilter,
|
TableSearchFilter,
|
||||||
TablePagination,
|
TablePagination,
|
||||||
ThumbnailEntry,
|
|
||||||
Toolbar,
|
Toolbar,
|
||||||
ToolbarButton,
|
ToolbarButton,
|
||||||
ToolbarSection,
|
ToolbarSection,
|
||||||
|
|||||||
@@ -3,6 +3,47 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.3.7](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.6...@ohif/viewer@2.3.7) (2019-11-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Minor issues measurement panel related to description ([#1142](https://github.com/OHIF/Viewers/issues/1142)) ([681384b](https://github.com/OHIF/Viewers/commit/681384b7425c83b02a0ed83371ca92d78ca7838c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.6](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.5...@ohif/viewer@2.3.6) (2019-11-02)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.4...@ohif/viewer@2.3.5) (2019-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* application crash if patientName is an object ([#1138](https://github.com/OHIF/Viewers/issues/1138)) ([64cf3b3](https://github.com/OHIF/Viewers/commit/64cf3b324da2383a927af1df2d46db2fca5318aa))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.3...@ohif/viewer@2.3.4) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Fix ghost shadow on thumb ([#1113](https://github.com/OHIF/Viewers/issues/1113)) ([caaa032](https://github.com/OHIF/Viewers/commit/caaa032c4bc24fd69fdb01a15a8feb2721c321db))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.3.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.2...@ohif/viewer@2.3.3) (2019-10-30)
|
## [2.3.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.2...@ohif/viewer@2.3.3) (2019-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -393,6 +393,20 @@ describe('OHIF Cornerstone Toolbar', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checks if the available viewport was set to active when layout is decreased', () => {
|
||||||
|
cy.setLayout(3, 3);
|
||||||
|
|
||||||
|
// activate the ninth viewport
|
||||||
|
cy.get('[data-cy=viewport-container-8]')
|
||||||
|
.click()
|
||||||
|
.should('have.class', 'active');
|
||||||
|
|
||||||
|
cy.setLayout(1, 1);
|
||||||
|
|
||||||
|
// first viewport should be active
|
||||||
|
cy.get('[data-cy=viewport-container-0]').should('have.class', 'active');
|
||||||
|
});
|
||||||
|
|
||||||
it('checks if Clear tool will delete all measurements added in the viewport', () => {
|
it('checks if Clear tool will delete all measurements added in the viewport', () => {
|
||||||
//Add measurements in the viewport
|
//Add measurements in the viewport
|
||||||
cy.addLengthMeasurement();
|
cy.addLengthMeasurement();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ describe('ViewerRouting', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// it('thumbnails list has more than 2 items', () => {
|
// it('thumbnails list has more than 2 items', () => {
|
||||||
// cy.get('.scrollable-study-thumbnails div.ThumbnailEntryContainer')
|
// cy.get('.scrollable-study-thumbnails div.thumbnail-container')
|
||||||
// .its('length')
|
// .its('length')
|
||||||
// .should('be.gte', 2);
|
// .should('be.gte', 2);
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/viewer",
|
"name": "@ohif/viewer",
|
||||||
"version": "2.3.3",
|
"version": "2.3.7",
|
||||||
"description": "OHIF Viewer",
|
"description": "OHIF Viewer",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -45,14 +45,14 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.1",
|
||||||
"@ohif/extension-cornerstone": "^2.0.0",
|
"@ohif/extension-cornerstone": "^2.0.0",
|
||||||
"@ohif/extension-dicom-html": "^1.0.1",
|
"@ohif/extension-dicom-html": "^1.0.1",
|
||||||
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
||||||
"@ohif/extension-dicom-pdf": "^1.0.0",
|
"@ohif/extension-dicom-pdf": "^1.0.0",
|
||||||
"@ohif/extension-vtk": "^0.52.25",
|
"@ohif/extension-vtk": "^0.52.28",
|
||||||
"@ohif/i18n": "^0.51.0",
|
"@ohif/i18n": "^0.51.0",
|
||||||
"@ohif/ui": "^0.58.2",
|
"@ohif/ui": "^0.58.5",
|
||||||
"@tanem/react-nprogress": "^1.1.25",
|
"@tanem/react-nprogress": "^1.1.25",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"core-js": "^3.2.1",
|
"core-js": "^3.2.1",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function getAllTools() {
|
|||||||
function getMeasurementText(measurementData = {}) {
|
function getMeasurementText(measurementData = {}) {
|
||||||
const defaultText = '...';
|
const defaultText = '...';
|
||||||
const { location = '', description = '' } = measurementData;
|
const { location = '', description = '' } = measurementData;
|
||||||
const result = location + (description ? `(${description})` : '');
|
const result = location + (description ? ` (${description})` : '');
|
||||||
|
|
||||||
return result || defaultText;
|
return result || defaultText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ function getToolLabellingFlowCallback(store) {
|
|||||||
if (location) {
|
if (location) {
|
||||||
measurementData.location = location;
|
measurementData.location = location;
|
||||||
}
|
}
|
||||||
if (description) {
|
|
||||||
measurementData.description = description;
|
measurementData.description = description || '';
|
||||||
}
|
|
||||||
if (response) {
|
if (response) {
|
||||||
measurementData.response = response;
|
measurementData.response = response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ export default class LabellingFlow extends Component {
|
|||||||
ref={this.descriptionInput}
|
ref={this.descriptionInput}
|
||||||
defaultValue={description || ''}
|
defaultValue={description || ''}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
onKeyPress={this.handleKeyPress}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -223,6 +224,12 @@ export default class LabellingFlow extends Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleKeyPress = e => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
this.descriptionSave();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
descriptionSave = () => {
|
descriptionSave = () => {
|
||||||
const description = this.descriptionInput.current.value;
|
const description = this.descriptionInput.current.value;
|
||||||
this.props.updateLabelling({ description });
|
this.props.updateLabelling({ description });
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const ViewportGrid = function(props) {
|
|||||||
|
|
||||||
ViewportGrid.propTypes = {
|
ViewportGrid.propTypes = {
|
||||||
viewportData: PropTypes.array.isRequired,
|
viewportData: PropTypes.array.isRequired,
|
||||||
supportsDragAndDrop: PropTypes.bool.isRequired,
|
supportsDrop: PropTypes.bool.isRequired,
|
||||||
activeViewportIndex: PropTypes.number.isRequired,
|
activeViewportIndex: PropTypes.number.isRequired,
|
||||||
layout: PropTypes.object.isRequired,
|
layout: PropTypes.object.isRequired,
|
||||||
availablePlugins: PropTypes.object.isRequired,
|
availablePlugins: PropTypes.object.isRequired,
|
||||||
@@ -127,7 +127,7 @@ ViewportGrid.defaultProps = {
|
|||||||
viewports: [{}],
|
viewports: [{}],
|
||||||
},
|
},
|
||||||
activeViewportIndex: 0,
|
activeViewportIndex: 0,
|
||||||
supportsDragAndDrop: true,
|
supportsDrop: true,
|
||||||
availablePlugins: {
|
availablePlugins: {
|
||||||
DefaultViewport,
|
DefaultViewport,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const ViewportPane = function(props) {
|
|||||||
propClassName
|
propClassName
|
||||||
)}
|
)}
|
||||||
ref={drop}
|
ref={drop}
|
||||||
|
data-cy={`viewport-container-${viewportIndex}`}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,39 +77,43 @@ function StudyListRoute(props) {
|
|||||||
|
|
||||||
// Called when relevant state/props are updated
|
// Called when relevant state/props are updated
|
||||||
// Watches filters and sort, debounced
|
// Watches filters and sort, debounced
|
||||||
useEffect(() => {
|
useEffect(
|
||||||
const fetchStudies = async () => {
|
() => {
|
||||||
try {
|
const fetchStudies = async () => {
|
||||||
setSearchStatus({ error: null, isSearchingForStudies: true });
|
try {
|
||||||
|
setSearchStatus({ error: null, isSearchingForStudies: true });
|
||||||
|
|
||||||
const response = await getStudyList(
|
const response = await getStudyList(
|
||||||
server,
|
server,
|
||||||
debouncedFilters,
|
debouncedFilters,
|
||||||
debouncedSort,
|
debouncedSort,
|
||||||
rowsPerPage,
|
rowsPerPage,
|
||||||
pageNumber,
|
pageNumber,
|
||||||
displaySize
|
displaySize
|
||||||
);
|
);
|
||||||
|
|
||||||
setStudies(response);
|
setStudies(response);
|
||||||
setSearchStatus({ error: null, isSearchingForStudies: false });
|
setSearchStatus({ error: null, isSearchingForStudies: false });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
setSearchStatus({ error: true, isFetching: false });
|
setSearchStatus({ error: true, isFetching: false });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (server) {
|
||||||
|
fetchStudies();
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
// TODO: Can we update studies directly?
|
||||||
if (server) {
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
fetchStudies();
|
[
|
||||||
}
|
debouncedFilters,
|
||||||
}, [
|
debouncedSort,
|
||||||
debouncedFilters,
|
rowsPerPage,
|
||||||
debouncedSort,
|
pageNumber,
|
||||||
rowsPerPage,
|
displaySize,
|
||||||
pageNumber,
|
server,
|
||||||
displaySize,
|
]);
|
||||||
server,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// TODO: Update Server
|
// TODO: Update Server
|
||||||
// if (this.props.server !== prevProps.server) {
|
// if (this.props.server !== prevProps.server) {
|
||||||
@@ -352,6 +356,9 @@ async function getStudyList(
|
|||||||
|
|
||||||
// Only the fields we use
|
// Only the fields we use
|
||||||
const mappedStudies = studies.map(study => {
|
const mappedStudies = studies.map(study => {
|
||||||
|
const patientName =
|
||||||
|
typeof study.patientName === 'string' ? study.patientName : undefined;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accessionNumber: study.accessionNumber, // "1"
|
accessionNumber: study.accessionNumber, // "1"
|
||||||
modalities: study.modalities, // "SEG\\MR"
|
modalities: study.modalities, // "SEG\\MR"
|
||||||
@@ -359,7 +366,7 @@ async function getStudyList(
|
|||||||
// numberOfStudyRelatedSeries: "3"
|
// numberOfStudyRelatedSeries: "3"
|
||||||
// patientBirthdate: undefined
|
// patientBirthdate: undefined
|
||||||
patientId: study.patientId, // "NOID"
|
patientId: study.patientId, // "NOID"
|
||||||
patientName: study.patientName, // "NAME^NONE"
|
patientName, // "NAME^NONE"
|
||||||
// patientSex: "M"
|
// patientSex: "M"
|
||||||
// referringPhysicianName: undefined
|
// referringPhysicianName: undefined
|
||||||
studyDate: study.studyDate, // "Jun 28, 2002"
|
studyDate: study.studyDate, // "Jun 28, 2002"
|
||||||
|
|||||||
Reference in new issue
Block a user