Finish render tool other than rotated ellipse and clean up.
This commit is contained in:
parent
f4470c9625
commit
83497795ca
@ -6,6 +6,11 @@ const { ImageSet } = classes;
|
|||||||
|
|
||||||
const sopClassHandlerName = 'dicom-sr';
|
const sopClassHandlerName = 'dicom-sr';
|
||||||
|
|
||||||
|
// TODO ->
|
||||||
|
// Add SR thumbnail
|
||||||
|
// Make viewport
|
||||||
|
// Get stacks from referenced displayInstanceUID and load into wrapped CornerStone viewport.
|
||||||
|
|
||||||
const sopClassUids = [
|
const sopClassUids = [
|
||||||
'1.2.840.10008.5.1.4.1.1.88.11', //BASIC_TEXT_SR:
|
'1.2.840.10008.5.1.4.1.1.88.11', //BASIC_TEXT_SR:
|
||||||
'1.2.840.10008.5.1.4.1.1.88.22', //ENHANCED_SR:
|
'1.2.840.10008.5.1.4.1.1.88.22', //ENHANCED_SR:
|
||||||
@ -327,6 +332,10 @@ function _processTID1410Measurement(mergedContentSequence) {
|
|||||||
group => group.ValueType === 'SCOORD'
|
group => group.ValueType === 'SCOORD'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const UIDREFContentItem = mergedContentSequence.find(
|
||||||
|
group => group.ValueType === 'UIDREF'
|
||||||
|
);
|
||||||
|
|
||||||
if (!graphicItem) {
|
if (!graphicItem) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`graphic ValueType ${graphicItem.ValueType} not currently supported, skipping annotation.`
|
`graphic ValueType ${graphicItem.ValueType} not currently supported, skipping annotation.`
|
||||||
@ -342,6 +351,7 @@ function _processTID1410Measurement(mergedContentSequence) {
|
|||||||
loaded: false,
|
loaded: false,
|
||||||
labels: [],
|
labels: [],
|
||||||
coords: [_getCoordsFromSCOORDOrSCOORD3D(graphicItem)],
|
coords: [_getCoordsFromSCOORDOrSCOORD3D(graphicItem)],
|
||||||
|
TrackingUniqueIdentifier: UIDREFContentItem.UID,
|
||||||
};
|
};
|
||||||
|
|
||||||
NUMContentItems.forEach(item => {
|
NUMContentItems.forEach(item => {
|
||||||
@ -365,12 +375,19 @@ function _processNonGeometricallyDefinedMeasurement(mergedContentSequence) {
|
|||||||
group => group.ValueType === 'NUM'
|
group => group.ValueType === 'NUM'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const UIDREFContentItem = mergedContentSequence.find(
|
||||||
|
group => group.ValueType === 'UIDREF'
|
||||||
|
);
|
||||||
|
|
||||||
const measurement = {
|
const measurement = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
labels: [],
|
labels: [],
|
||||||
coords: [],
|
coords: [],
|
||||||
|
TrackingUniqueIdentifier: UIDREFContentItem.UID,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
debugger;
|
||||||
|
|
||||||
NUMContentItems.forEach(item => {
|
NUMContentItems.forEach(item => {
|
||||||
const {
|
const {
|
||||||
ConceptNameCodeSequence,
|
ConceptNameCodeSequence,
|
||||||
|
|||||||
@ -45,23 +45,28 @@ export default class DICOMSRDisplayTool extends BaseTool {
|
|||||||
|
|
||||||
for (let i = 0; i < toolState.data.length; i++) {
|
for (let i = 0; i < toolState.data.length; i++) {
|
||||||
const data = toolState.data[i];
|
const data = toolState.data[i];
|
||||||
|
const { renderableData } = data;
|
||||||
|
|
||||||
Object.keys(data).forEach(GraphicType => {
|
Object.keys(renderableData).forEach(GraphicType => {
|
||||||
const renderableData = data[GraphicType];
|
const renderableDataForGraphicType = renderableData[GraphicType];
|
||||||
|
|
||||||
switch (GraphicType) {
|
switch (GraphicType) {
|
||||||
case SCOORD_TYPES.POINT:
|
case SCOORD_TYPES.POINT:
|
||||||
case SCOORD_TYPES.MULTIPOINT:
|
case SCOORD_TYPES.MULTIPOINT:
|
||||||
renderPointOrMultipoint(renderableData, eventData, options);
|
renderPointOrMultipoint(
|
||||||
|
renderableDataForGraphicType,
|
||||||
|
eventData,
|
||||||
|
options
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case SCOORD_TYPES.POLYLINE:
|
case SCOORD_TYPES.POLYLINE:
|
||||||
renderPolyLine(renderableData, eventData, options);
|
renderPolyLine(renderableDataForGraphicType, eventData, options);
|
||||||
break;
|
break;
|
||||||
case SCOORD_TYPES.CIRCLE:
|
case SCOORD_TYPES.CIRCLE:
|
||||||
renderCircle(renderableData, eventData, options);
|
renderCircle(renderableDataForGraphicType, eventData, options);
|
||||||
break;
|
break;
|
||||||
case SCOORD_TYPES.ELLIPSE:
|
case SCOORD_TYPES.ELLIPSE:
|
||||||
renderEllipse(renderableData, eventData, options);
|
renderEllipse(renderableDataForGraphicType, eventData, options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,25 +16,27 @@ export default function addMeasurement(
|
|||||||
console.log(imageId);
|
console.log(imageId);
|
||||||
console.log('============================');
|
console.log('============================');
|
||||||
|
|
||||||
// TODO -> GET TRACKING UID AND ADD IT TO TOOL DATA AND ALSO THE MEASUREMENT ENTRY.
|
|
||||||
// TODO -> Render rotated ellipse .
|
// TODO -> Render rotated ellipse .
|
||||||
|
|
||||||
debugger;
|
debugger;
|
||||||
|
|
||||||
const toolName = TOOL_NAMES.DICOM_SR_DISPLAY_TOOL;
|
const toolName = TOOL_NAMES.DICOM_SR_DISPLAY_TOOL;
|
||||||
|
|
||||||
const measurementData = {};
|
const measurementData = {
|
||||||
|
TrackingUniqueIdentifier: measurement.TrackingUniqueIdentifier,
|
||||||
|
renderableData: {},
|
||||||
|
};
|
||||||
|
|
||||||
measurement.coords.forEach(coord => {
|
measurement.coords.forEach(coord => {
|
||||||
const { GraphicType, GraphicData } = coord;
|
const { GraphicType, GraphicData } = coord;
|
||||||
|
|
||||||
if (measurementData[GraphicType] === undefined) {
|
if (measurementData.renderableData[GraphicType] === undefined) {
|
||||||
measurementData[GraphicType] = [];
|
measurementData.renderableData[GraphicType] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderableData = _getRenderableData(GraphicType, GraphicData);
|
measurementData.renderableData[GraphicType].push(
|
||||||
|
_getRenderableData(GraphicType, GraphicData)
|
||||||
measurementData[GraphicType].push(renderableData);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const toolState = globalImageIdSpecificToolStateManager.saveToolState();
|
const toolState = globalImageIdSpecificToolStateManager.saveToolState();
|
||||||
@ -59,6 +61,8 @@ export default function addMeasurement(
|
|||||||
measurement.loaded = true;
|
measurement.loaded = true;
|
||||||
measurement.imageId = imageId;
|
measurement.imageId = imageId;
|
||||||
measurement.displaySetInstanceUID = displaySetInstanceUID;
|
measurement.displaySetInstanceUID = displaySetInstanceUID;
|
||||||
|
delete measurement.coords;
|
||||||
|
|
||||||
debugger;
|
debugger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user