longitudinal mode to use "tracked" thumbnails
This commit is contained in:
parent
d557acbb40
commit
38e60e297b
@ -212,7 +212,7 @@ function _mapDisplaySets(displaySets, thumbnailImageSrcMap) {
|
|||||||
date: ds.SeriesDate,
|
date: ds.SeriesDate,
|
||||||
numInstances: ds.numImageFrames,
|
numInstances: ds.numImageFrames,
|
||||||
StudyInstanceUID: ds.StudyInstanceUID,
|
StudyInstanceUID: ds.StudyInstanceUID,
|
||||||
componentType: 'thumbnail', // 'thumbnailNoImage' || 'thumbnailTracked' // TODO: PUT THIS SOMEWHERE ELSE
|
componentType: 'thumbnailTracked', // 'thumbnailNoImage' || 'thumbnail' // TODO: PUT THIS SOMEWHERE ELSE
|
||||||
imageSrc,
|
imageSrc,
|
||||||
dragData: {
|
dragData: {
|
||||||
type: 'displayset',
|
type: 'displayset',
|
||||||
@ -223,7 +223,6 @@ function _mapDisplaySets(displaySets, thumbnailImageSrcMap) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string[]} primaryStudyInstanceUIDs
|
* @param {string[]} primaryStudyInstanceUIDs
|
||||||
|
|||||||
@ -155,29 +155,12 @@ class OHIFCornerstoneViewport extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const debouncedNewImageHandler = debounce(
|
|
||||||
({ currentImageIdIndex, sopInstanceUid }) => {
|
|
||||||
const { displaySet } = this.props;
|
|
||||||
const { StudyInstanceUID } = displaySet;
|
|
||||||
if (currentImageIdIndex > 0) {
|
|
||||||
this.props.onNewImage({
|
|
||||||
StudyInstanceUID,
|
|
||||||
SOPInstanceUID: sopInstanceUid,
|
|
||||||
frameIndex: currentImageIdIndex,
|
|
||||||
activeViewportIndex: viewportIndex,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
700
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CornerstoneViewport
|
<CornerstoneViewport
|
||||||
viewportIndex={viewportIndex}
|
viewportIndex={viewportIndex}
|
||||||
imageIds={imageIds}
|
imageIds={imageIds}
|
||||||
imageIdIndex={currentImageIdIndex}
|
imageIdIndex={currentImageIdIndex}
|
||||||
onNewImage={debouncedNewImageHandler}
|
|
||||||
// TODO: ViewportGrid Context?
|
// TODO: ViewportGrid Context?
|
||||||
isActive={true} // todo
|
isActive={true} // todo
|
||||||
isStackPrefetchEnabled={true} // todo
|
isStackPrefetchEnabled={true} // todo
|
||||||
|
|||||||
@ -13,19 +13,7 @@ const OHIFCornerstoneViewport = props => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function getViewportModule({ commandsManager }) {
|
function getViewportModule({ commandsManager }) {
|
||||||
const ExtendedOHIFCornerstoneViewport = props => {
|
return [{ name: 'cornerstone-tracked', component: OHIFCornerstoneViewport }];
|
||||||
const onNewImageHandler = jumpData => {
|
}
|
||||||
alert('here we are!')
|
|
||||||
commandsManager.runCommand('jumpToImage', jumpData);
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<OHIFCornerstoneViewport {...props} onNewImage={onNewImageHandler} />
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return [
|
|
||||||
{ name: 'cornerstone-tracked', component: ExtendedOHIFCornerstoneViewport },
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getViewportModule;
|
export default getViewportModule;
|
||||||
|
|||||||
@ -74,12 +74,15 @@ export default function mode({ modeConfiguration }) {
|
|||||||
id: 'org.ohif.default.layoutTemplateModule.viewerLayout',
|
id: 'org.ohif.default.layoutTemplateModule.viewerLayout',
|
||||||
props: {
|
props: {
|
||||||
// named slots
|
// named slots
|
||||||
leftPanels: ['org.ohif.default.panelModule.seriesList'],
|
leftPanels: [
|
||||||
|
'org.ohif.measurement-tracking.panelModule.seriesList',
|
||||||
|
],
|
||||||
// TODO: Should be optional, or required to pass empty array for slots?
|
// TODO: Should be optional, or required to pass empty array for slots?
|
||||||
rightPanels: [], // // ['org.ohif.default.panelModule.measure'],
|
rightPanels: [], // // ['org.ohif.default.panelModule.measure'],
|
||||||
viewports: [
|
viewports: [
|
||||||
{
|
{
|
||||||
namespace: 'org.ohif.measurement-tracking.viewportModule.cornerstone-tracked',
|
namespace:
|
||||||
|
'org.ohif.measurement-tracking.viewportModule.cornerstone-tracked',
|
||||||
displaySetsToDisplay: [
|
displaySetsToDisplay: [
|
||||||
'org.ohif.default.sopClassHandlerModule.stack',
|
'org.ohif.default.sopClassHandlerModule.stack',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -43,17 +43,6 @@ const ThumbnailList = ({
|
|||||||
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case 'thumbnailNoImage':
|
|
||||||
return (
|
|
||||||
<ThumbnailNoImage
|
|
||||||
key={displaySetInstanceUID}
|
|
||||||
dragData={dragData}
|
|
||||||
modality={modality}
|
|
||||||
seriesDate={seriesDate}
|
|
||||||
description={description}
|
|
||||||
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'thumbnailTracked':
|
case 'thumbnailTracked':
|
||||||
return (
|
return (
|
||||||
<ThumbnailTracked
|
<ThumbnailTracked
|
||||||
@ -70,6 +59,17 @@ const ThumbnailList = ({
|
|||||||
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
case 'thumbnailNoImage':
|
||||||
|
return (
|
||||||
|
<ThumbnailNoImage
|
||||||
|
key={displaySetInstanceUID}
|
||||||
|
dragData={dragData}
|
||||||
|
modality={modality}
|
||||||
|
seriesDate={seriesDate}
|
||||||
|
description={description}
|
||||||
|
onClick={() => onThumbnailClick(displaySetInstanceUID)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ const ThumbnailTracked = ({
|
|||||||
description,
|
description,
|
||||||
seriesNumber,
|
seriesNumber,
|
||||||
numInstances,
|
numInstances,
|
||||||
|
dragData,
|
||||||
onClick,
|
onClick,
|
||||||
viewportIdentificator,
|
viewportIdentificator,
|
||||||
isTracked,
|
isTracked,
|
||||||
@ -25,7 +26,7 @@ const ThumbnailTracked = ({
|
|||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col flex-2 items-center">
|
<div className="flex flex-col items-center flex-2">
|
||||||
<div
|
<div
|
||||||
className={classnames(
|
className={classnames(
|
||||||
'flex flex-col items-center justify-start p-2 mb-2 relative cursor-pointer',
|
'flex flex-col items-center justify-start p-2 mb-2 relative cursor-pointer',
|
||||||
@ -49,14 +50,14 @@ const ThumbnailTracked = ({
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-2 items-center justify-center">
|
<div className="flex items-center justify-center flex-2">
|
||||||
<Icon name="info-link" className="text-primary-active" />
|
<Icon name="info-link" className="text-primary-active" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Icon name={trackedIcon} className="text-primary-light mb-2 w-4" />
|
<Icon name={trackedIcon} className="w-4 mb-2 text-primary-light" />
|
||||||
<div className="text-white text-xl leading-tight h-5">
|
<div className="h-5 text-xl leading-tight text-white">
|
||||||
{viewportIdentificator}
|
{viewportIdentificator}
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -64,13 +65,14 @@ const ThumbnailTracked = ({
|
|||||||
{isTracked && (
|
{isTracked && (
|
||||||
<Icon
|
<Icon
|
||||||
name="cancel"
|
name="cancel"
|
||||||
className="text-primary-active excludeButton w-4"
|
className="w-4 text-primary-active excludeButton"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Thumbnail
|
<Thumbnail
|
||||||
imageSrc={imageSrc}
|
imageSrc={imageSrc}
|
||||||
imageAltText={imageAltText}
|
imageAltText={imageAltText}
|
||||||
|
dragData={dragData}
|
||||||
description={description}
|
description={description}
|
||||||
seriesNumber={seriesNumber}
|
seriesNumber={seriesNumber}
|
||||||
numInstances={numInstances}
|
numInstances={numInstances}
|
||||||
@ -82,6 +84,17 @@ const ThumbnailTracked = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
ThumbnailTracked.propTypes = {
|
ThumbnailTracked.propTypes = {
|
||||||
|
/**
|
||||||
|
* Data the thumbnail should expose to a receiving drop target. Use a matching
|
||||||
|
* `dragData.type` to identify which targets can receive this draggable item.
|
||||||
|
* If this is not set, drag-n-drop will be disabled for this thumbnail.
|
||||||
|
*
|
||||||
|
* Ref: https://react-dnd.github.io/react-dnd/docs/api/use-drag#specification-object-members
|
||||||
|
*/
|
||||||
|
dragData: PropTypes.shape({
|
||||||
|
/** Must match the "type" a dropTarget expects */
|
||||||
|
type: PropTypes.string.isRequired,
|
||||||
|
}),
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
imageSrc: PropTypes.string,
|
imageSrc: PropTypes.string,
|
||||||
imageAltText: PropTypes.string,
|
imageAltText: PropTypes.string,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user