-
Notifications
You must be signed in to change notification settings - Fork 205
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
drawing ROIs #63
Comments
Here's the general approach:
That's a very high-level overview. It won't be a simple change, but it is definitely doable if you want a small project to work on. We haven't added ROI support mainly since there's no way to save the generated ROI data -- but it may be useful to say create an ROI to calculate some statistics. Other thoughts...
|
Thanks for the suggestions! I'm actually more interested in tracing, and I have a server I'd eventually send the tracing to. I'm running into a small problem - for some reason Even |
The reason your Get the new build and try this: |
Thanks! Now, I can mousedown to start the tracing, mousemove to add points to it, and mouseup to end it. Now my problem is that as soon as I mousedrag, the previous point I drew is cleared, so you can't really see what you've traced! On each mousemove, I could re-draw the all the points in my "tracing" array, but this doesn't seem very efficient. Is there a better way to do this? |
It's possible to only update the part of the image that was changed, such as where the latest point was drawn, but this will get complicated. It's a lot simpler to just re-draw the entire scene each time. Save your state (the list of points), then just re-draw all the points each time. It may not seem efficient, but considering all the work it's already doing to redraw the underlying image (see |
Ok, here is a demo of what I have so far: http://mindcontrol.herokuapp.com/freesurfer/sub86516-sub86516-000-MPRAGE . On the left hand side, click on the "logged curves" menu, and then shift + click and drag to draw on papaya. When I move the mouse slowly, I don't notice any performance issue, but when I move quickly, I see a lag. However, the lag isn't any different from the lag I see when I look at the crosshairs during a click+drag (maybe this is built in?). Alternatively, I could just get rid of the mouseup/mousedown requirement and only shift+mousemove to draw, but that feels unintuitive to me. The other thing I've noticed is that my re-draw occurs only on the mousemove even though I call it in the mousedown/up events. I think my repaint in mousedown/up is fired before the |
P.S the demo only works on chrome! |
I'm going to close this up now. Let me know if have any other issues. |
@akeshavan I have a simple project which needs a function like "drawing ROIs", I have created an account, and try your demo, it is so awesome! But in the source code I can't find the function to draw ROIs, Can you tell me where to implement the function of drawing curves in the source code? Thanks in advance |
I am trying to use papaya to draw ROIs. So far, I am able to use the Context Manager to log points and calculate the real world coordinates. Is there a way to use this to "paint" ROIs? I'm happy to contribute, but I'm not sure where to start. Thanks!
The text was updated successfully, but these errors were encountered: