[OHIF-192] - Viewport letter only if using multiple viewport layout. (#1822)
* Viewport letter only in multi-viewport layout. * If SliceThickness not available print N/A
This commit is contained in:
parent
050b260a58
commit
d266b944c2
@ -250,12 +250,19 @@ function OHIFCornerstoneSRViewport({
|
|||||||
seriesDescription: SeriesDescription,
|
seriesDescription: SeriesDescription,
|
||||||
modality: Modality,
|
modality: Modality,
|
||||||
patientInformation: {
|
patientInformation: {
|
||||||
patientName: PatientName ? OHIF.utils.formatPN(PatientName.Alphabetic) : '',
|
patientName: PatientName
|
||||||
|
? OHIF.utils.formatPN(PatientName.Alphabetic)
|
||||||
|
: '',
|
||||||
patientSex: PatientSex || '',
|
patientSex: PatientSex || '',
|
||||||
patientAge: PatientAge || '',
|
patientAge: PatientAge || '',
|
||||||
MRN: PatientID || '',
|
MRN: PatientID || '',
|
||||||
thickness: `${SliceThickness}mm`,
|
thickness: SliceThickness ? `${SliceThickness.toFixed(2)}mm` : '',
|
||||||
spacing: PixelSpacing && PixelSpacing.length ? `${PixelSpacing[0].toFixed(2)}mm x ${PixelSpacing[1].toFixed(2)}mm` : '',
|
spacing:
|
||||||
|
PixelSpacing && PixelSpacing.length
|
||||||
|
? `${PixelSpacing[0].toFixed(2)}mm x ${PixelSpacing[1].toFixed(
|
||||||
|
2
|
||||||
|
)}mm`
|
||||||
|
: '',
|
||||||
scanner: ManufacturerModelName || '',
|
scanner: ManufacturerModelName || '',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -291,8 +291,11 @@ function _mapDisplaySets(
|
|||||||
const firstViewportIndexWithMatchingDisplaySetUid = viewports.findIndex(
|
const firstViewportIndexWithMatchingDisplaySetUid = viewports.findIndex(
|
||||||
vp => vp.displaySetInstanceUID === ds.displaySetInstanceUID
|
vp => vp.displaySetInstanceUID === ds.displaySetInstanceUID
|
||||||
);
|
);
|
||||||
|
|
||||||
const viewportIdentificator =
|
const viewportIdentificator =
|
||||||
_viewportLabels[firstViewportIndexWithMatchingDisplaySetUid] || '';
|
viewports.length > 1
|
||||||
|
? _viewportLabels[firstViewportIndexWithMatchingDisplaySetUid]
|
||||||
|
: '';
|
||||||
|
|
||||||
const array =
|
const array =
|
||||||
componentType === 'thumbnailTracked'
|
componentType === 'thumbnailTracked'
|
||||||
|
|||||||
@ -225,20 +225,25 @@ function TrackedCornerstoneViewport({
|
|||||||
PatientAge,
|
PatientAge,
|
||||||
SliceThickness,
|
SliceThickness,
|
||||||
PixelSpacing,
|
PixelSpacing,
|
||||||
ManufacturerModelName
|
ManufacturerModelName,
|
||||||
} = displaySet.images[0];
|
} = displaySet.images[0];
|
||||||
|
|
||||||
if (trackedSeries.includes(SeriesInstanceUID) !== isTracked) {
|
if (trackedSeries.includes(SeriesInstanceUID) !== isTracked) {
|
||||||
setIsTracked(!isTracked);
|
setIsTracked(!isTracked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const label =
|
||||||
|
viewports.length > 1
|
||||||
|
? _viewportLabels[firstViewportIndexWithMatchingDisplaySetUid]
|
||||||
|
: '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewportActionBar
|
<ViewportActionBar
|
||||||
onSeriesChange={direction => alert(`Series ${direction}`)}
|
onSeriesChange={direction => alert(`Series ${direction}`)}
|
||||||
showNavArrows={viewportIndex === activeViewportIndex}
|
showNavArrows={viewportIndex === activeViewportIndex}
|
||||||
studyData={{
|
studyData={{
|
||||||
label: _viewportLabels[firstViewportIndexWithMatchingDisplaySetUid],
|
label,
|
||||||
isTracked: trackedSeries.includes(SeriesInstanceUID),
|
isTracked: trackedSeries.includes(SeriesInstanceUID),
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
studyDate: formatDate(SeriesDate), // TODO: This is series date. Is that ok?
|
studyDate: formatDate(SeriesDate), // TODO: This is series date. Is that ok?
|
||||||
@ -246,12 +251,19 @@ function TrackedCornerstoneViewport({
|
|||||||
seriesDescription: SeriesDescription,
|
seriesDescription: SeriesDescription,
|
||||||
modality: Modality,
|
modality: Modality,
|
||||||
patientInformation: {
|
patientInformation: {
|
||||||
patientName: PatientName ? OHIF.utils.formatPN(PatientName.Alphabetic) : '',
|
patientName: PatientName
|
||||||
|
? OHIF.utils.formatPN(PatientName.Alphabetic)
|
||||||
|
: '',
|
||||||
patientSex: PatientSex || '',
|
patientSex: PatientSex || '',
|
||||||
patientAge: PatientAge || '',
|
patientAge: PatientAge || '',
|
||||||
MRN: PatientID || '',
|
MRN: PatientID || '',
|
||||||
thickness: `${SliceThickness}mm`,
|
thickness: SliceThickness ? `${SliceThickness.toFixed(2)}mm` : '',
|
||||||
spacing: PixelSpacing && PixelSpacing.length ? `${PixelSpacing[0].toFixed(2)}mm x ${PixelSpacing[1].toFixed(2)}mm` : '',
|
spacing:
|
||||||
|
PixelSpacing && PixelSpacing.length
|
||||||
|
? `${PixelSpacing[0].toFixed(2)}mm x ${PixelSpacing[1].toFixed(
|
||||||
|
2
|
||||||
|
)}mm`
|
||||||
|
: '',
|
||||||
scanner: ManufacturerModelName || '',
|
scanner: ManufacturerModelName || '',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ const ViewportActionBar = ({
|
|||||||
scanner,
|
scanner,
|
||||||
} = patientInformation;
|
} = patientInformation;
|
||||||
|
|
||||||
const onPatientInfoClick = () => setShowPatientInfo(!showPatientInfo)
|
const onPatientInfoClick = () => setShowPatientInfo(!showPatientInfo);
|
||||||
|
|
||||||
const renderIconStatus = () => {
|
const renderIconStatus = () => {
|
||||||
if (modality === 'SR') {
|
if (modality === 'SR') {
|
||||||
@ -196,7 +196,8 @@ function PatientInfo({
|
|||||||
isSticky
|
isSticky
|
||||||
isDisabled={!isOpen}
|
isDisabled={!isOpen}
|
||||||
position="bottom-right"
|
position="bottom-right"
|
||||||
content={isOpen && (
|
content={
|
||||||
|
isOpen && (
|
||||||
<div className="flex py-2">
|
<div className="flex py-2">
|
||||||
<div className="flex pt-1">
|
<div className="flex pt-1">
|
||||||
<Icon name="info-link" className="w-4 text-primary-main" />
|
<Icon name="info-link" className="w-4 text-primary-main" />
|
||||||
@ -229,21 +230,30 @@ function PatientInfo({
|
|||||||
Thickness
|
Thickness
|
||||||
</span>
|
</span>
|
||||||
<span className={classnames(classes.infoText)}>
|
<span className={classnames(classes.infoText)}>
|
||||||
{thickness}
|
{thickness ? thickness : 'N/A'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={classnames(classes.row)}>
|
<div className={classnames(classes.row)}>
|
||||||
<span className={classnames(classes.infoHeader)}>Spacing</span>
|
<span className={classnames(classes.infoHeader)}>
|
||||||
<span className={classnames(classes.infoText)}>{spacing}</span>
|
Spacing
|
||||||
|
</span>
|
||||||
|
<span className={classnames(classes.infoText)}>
|
||||||
|
{spacing}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={classnames(classes.row)}>
|
<div className={classnames(classes.row)}>
|
||||||
<span className={classnames(classes.infoHeader)}>Scanner</span>
|
<span className={classnames(classes.infoHeader)}>
|
||||||
<span className={classnames(classes.infoText)}>{scanner}</span>
|
Scanner
|
||||||
|
</span>
|
||||||
|
<span className={classnames(classes.infoText)}>
|
||||||
|
{scanner}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div className="relative flex justify-end cursor-pointer">
|
<div className="relative flex justify-end cursor-pointer">
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user