-
Notifications
You must be signed in to change notification settings - Fork 597
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
Store annotations in database and retrieve them later #509
Comments
Yes, the application can save a state that contains annotations, see |
From the examples, I got to know that those annotations will be saved locally as a json file. Is it so? What I want is to use this in my application, which views mammograms(dicoms), add annotations on them and store the annotations in the database rather than generating the json file. Could you please help me with the setup? I would be using dwv-jqui. Should I raise an issue over there or we can discuss over here? |
We can continue discussing here. To create the state you could use this code: var state = new dwv.State();
var json = state.toJSON(app); You would then have to write the code that sends the state to your server. |
I made a simple page, included the dicom and added zoom and pan functionality. Now how to add the toolbox. Error: |
Check out the code of dwv-jqui, copy all and remove what you do not need. |
Loaded the image from url #489. |
Can you share the full console log to have more details on the error? |
You also need to remove the |
Still the same error. |
@ivmartel |
Ok. Now I am done with loading the image. I want to rename the json file before downloading it. Means I dont want that dialog box thats prompts us for the download. I want to provide a specific name and download the json file in background. |
@anoob09 The code I mention above can go in an event handler that you create, so in another js file than the main dwv one. |
@ivmartel I used the simplest |
I have added a new button with |
Tried changing the code for |
We loaded the dicom, made the state.file but when we are trying to load them, it shows an error: What can be the reason Sir? |
The application @anoob09, are you running one of the watch scripts provided with dwv? If so, it is possible that they re-create the minified dwv at each code change. Are you two working together? And no need for the sir, Sir!! |
Yes, we are working togeather. |
@ivmartel We tried it without using |
What we are doing is
add_annotation_script.php:
|
We are getting the annotations back in the history window(not all, some of the annotations are missing) but these annotations are not visible by default on the dicom. They are visible after chicking on them from the showAnnotation tab. Alert : Error : We are loading the state.json file through URL Firefox says: |
`dwv.min.js:2 TypeError: Cannot read property 'getParent' of undefined
G @ dwv.min.js:2 |
It seems Konva has troubles loading the json as if it does not contain the information it expects. Have you tried to load the state manually to see if the file is ok? No cookies, just a json file. |
How to load it manually? And I have verified that the json file created via download link and json file created by me are same. |
You can drag and drop it on the dwv-jqmobile demo for example (after having loaded the DICOM). |
I drew 3 lines in this dicom. But when I used the |
No. We are not using yarn or npm scripts. We simply linked all the js files to our php page. |
I took the live demo of dwv-jqmobile and dwv-jqui. Loaded the image, made some annotations on them, downloaded the image. Then again I loaded the image and tried to load the state(those I downloaded) manually, it showed the same error in both(dwv-jqmobile and dwv-jqui). |
There seems to be something dwv does not like about your images... I'll investigate and tell you. |
Ok, good one, it's not only your images, it's a general bug! State files with multiple shapes crash the app. Can you try replacing this line drawController.js#L395 with Tell me how it goes and thanks for spotting it! |
We cannot locate the drawController.js in dwv-jqui. |
It's in dwv. |
It worked! |
You need to call this code in the same context as where you create the app, in the demos that would be in the |
It worked well. Thanks for all the help. We appreciated it. |
The application cannot cannot distinguish between a arrow and a line. |
We are also unable to delete any of the annotations. We are trying to delete by dragging and dropping the annotations to the red cross mark but it is not working. |
You need to check |
No. There we have Delete All option. I'm taking about deleting the annotations individually. |
For the arrow, I found a fix: change this line in arrow.js#L61 to I'll have a look at the delete problem... |
Yes. Now the arrow head is visible. |
Did you find any fix to the delete problem? |
Is there any way to reduce the image load time? Chrome is taking 3.7-4 seconds to load the image. |
Nearly there for the delete problem. Improving the loading time on the dwv side needs work... Your image is quite large, can you make it smaller? |
I don't think we can compromise with the size here. Please let us know what can we to reduce the loading time. |
@ivmartel Is there any way to reduce the loading time ? I just want to show the image from DICOM file. I don't want to add any features. |
Understood but I do not know of any easy solution... One thing would be to check that there are no bottlenecks in the code and that the code is the fastest it could be. Parsing the pixel data using web workers could help, this needs investigation... |
Hey. Did you fix the delete issue? |
Yep cf #517 |
Now its working well. |
Good. Can you close the issue if you think it is resolved? |
I want to draw red rectangular annotations on the images and store them in the database. Later when that image is viewed again, those annotations should be retrieved and viewed. Is there a way by which I can target these annotations, and further redraw them.
The text was updated successfully, but these errors were encountered: