Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to insert new annotation from save json in react? #1557

Open
1 task
Atp-Gaster opened this issue Oct 9, 2023 · 0 comments
Open
1 task

How to insert new annotation from save json in react? #1557

Atp-Gaster opened this issue Oct 9, 2023 · 0 comments

Comments

@Atp-Gaster
Copy link

Prerequisites

  • How can I using data from cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState() to create a new annotation as load function in react?

Description

This is the example data that come from cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState();
var ExampleData =
{
"Bidirectional": {
"data": [
{
"toolName": "Bidirectional",
"toolType": "Bidirectional",
"isCreating": true,
"visible": true,
"active": false,
"invalidated": false,
"handles": {
"start": {
"x": 317.76188602709806,
"y": 234.64989562868368,
"index": 0,
"drawnIndependently": false,
"allowedOutsideImage": false,
"highlight": true,
"active": false
},
"end": {
"x": 212.14302551629262,
"y": 196.42592706286837,
"index": 1,
"drawnIndependently": false,
"allowedOutsideImage": false,
"highlight": true,
"active": false,
"moving": false
},
"perpendicularStart": {
"x": 274.50844791314915,
"y": 189.13319621807466,
"index": 2,
"drawnIndependently": false,
"allowedOutsideImage": false,
"highlight": true,
"active": false,
"locked": false
},
"perpendicularEnd": {
"x": 255.3964636302415,
"y": 241.9426264734774,
"index": 3,
"drawnIndependently": false,
"allowedOutsideImage": false,
"highlight": true,
"active": false
},
"textBox": {
"x": 267.76188602709806,
"y": 164.64989562868368,
"index": null,
"drawnIndependently": true,
"allowedOutsideImage": true,
"highlight": false,
"active": false,
"hasMoved": true,
"movesIndependently": false,
"hasBoundingBox": true,
"boundingBox": {
"width": 96.234375,
"height": 45,
"left": 510.692968726158,
"top": 141.18515014648438
}
}
},
"longestDiameter": "50.5",
"shortestDiameter": "25.2",
"uuid": "5bdda424-3cd3-45c0-aee0-6db6cbbc347b"
}
]
}
};

This is the method that I trying to create new annotation.
image
This is the connerstoneviewport
image
image
image

This method I have reference from this issues: #30 (comment)

Expected behavior: (What you expected to happen)

I want to load the annotation data that was saved as json and when phasejson back to object like ExampleData it suppose to create a new annotation from the save json.
image

Actual behavior:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant