feat: Implemented CSV support for Arrow annotation. (#4623)
Co-authored-by: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com>
This commit is contained in:
parent
e11ceb9d20
commit
55fe185c72
@ -57,6 +57,7 @@ const Length = {
|
||||
const mappedAnnotations = getMappedAnnotations(annotation, displaySetService);
|
||||
|
||||
const displayText = getDisplayText(mappedAnnotations, displaySet);
|
||||
const getReport = () => _getReport(mappedAnnotations, points, FrameOfReferenceUID);
|
||||
|
||||
return {
|
||||
uid: annotationUID,
|
||||
@ -77,9 +78,7 @@ const Length = {
|
||||
displayText: displayText,
|
||||
data: data.cachedStats,
|
||||
type: getValueTypeFromToolType(toolName),
|
||||
getReport: () => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
getReport,
|
||||
};
|
||||
},
|
||||
};
|
||||
@ -145,4 +144,32 @@ function getDisplayText(mappedAnnotations, displaySet) {
|
||||
return displayText;
|
||||
}
|
||||
|
||||
function _getReport(mappedAnnotations, points, FrameOfReferenceUID) {
|
||||
const columns = [];
|
||||
const values = [];
|
||||
|
||||
columns.push('AnnotationType');
|
||||
values.push('Cornerstone:ArrowAnnote');
|
||||
|
||||
mappedAnnotations.forEach(annotation => {
|
||||
const { text } = annotation;
|
||||
columns.push(`Text`);
|
||||
values.push(text);
|
||||
});
|
||||
|
||||
if (FrameOfReferenceUID) {
|
||||
columns.push('FrameOfReferenceUID');
|
||||
values.push(FrameOfReferenceUID);
|
||||
}
|
||||
|
||||
if (points) {
|
||||
columns.push('points');
|
||||
values.push(points.map(p => p.join(' ')).join(';'));
|
||||
}
|
||||
|
||||
return {
|
||||
columns,
|
||||
values,
|
||||
};
|
||||
}
|
||||
export default Length;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user