cornerstonejs / cornerstoneTools

A framework for tools built on top of Cornerstone.
https://tools.cornerstonejs.org/
MIT License
578 stars 455 forks source link

How to load tools from a local file and draw them? #1038

Open dimo2008 opened 5 years ago

dimo2008 commented 5 years ago

Hello, I want to save tools and load them again , the situation is that i have an already made program with C++ (desktop software) and the new web viewer , so i want to integrate both together. i already have done saving from the web viewer to the desktop software, as the desktop has its own tools so i made an intermediate class for tools that takes the needed variables from both mine and cornerstone tools . so for a brief i want the website to load the tools already stored in a file or database to be drawn automatically on the web viewer.

dimo2008 commented 5 years ago

@dannyrb any help please ?

dannyrb commented 5 years ago

What have you tried? Have you searched existing open and closed issues? Most tools utilize top level API methods like getToolState, or their toolStateManager's saveToolState to accomplish what you're describing.

Try poking around the entry index.js file, our API docs, these issues, and the imageIdSpecificToolStateManager

dimo2008 commented 5 years ago

What have you tried? Have you searched existing open and closed issues? Most tools utilize top level API methods like getToolState, or their toolStateManager's saveToolState to accomplish what you're describing.

Try poking around the entry index.js file, our API docs, these issues, and the imageIdSpecificToolStateManager

ok i will check that and get back to you, thanks

dimo2008 commented 5 years ago

@dannyrb sorry for the late response. now i have tried saving and getting the tool state- data using the state manager but in the same session. while what i am really searching for is closing the browser and opening it again and when the page loads i can find the tools as was drawn. as i told you earlier i can save and load the necessary variables for each tool ( like start- end - result ...etc) what i am asking for is that , is there a way to draw the wanted tools after loading the page automatically ?

dannyrb commented 5 years ago

is there a way to draw the wanted tools after loading the page automatically

I believe we're straying outside the scope of support it makes sense for us to provide for this repository. If you need more assistance in this vein, you may wish to reach out to a consultant.

There are a lot of ways to persist data outside of the current session.