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

Painting lines on Nrrd slice #50

Open
LinkunGao opened this issue Jul 21, 2022 · 1 comment
Open

Painting lines on Nrrd slice #50

LinkunGao opened this issue Jul 21, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@LinkunGao
Copy link
Owner

Issue: after painting on canvas, when we change the slice and back to the drawing slice, all paints will disappear. This is because every time when we switch to a painted slice the threejs will re-paint to canvas based on volume data. But when we paint on the canvas we cannot change the volume data.

@LinkunGao LinkunGao self-assigned this Jul 21, 2022
@LinkunGao LinkunGao added bug Something isn't working and removed bug Something isn't working labels Jul 21, 2022
@LinkunGao
Copy link
Owner Author

LinkunGao commented Jul 21, 2022

Solution:

  1. Do not paint directly on slice’s canvas, we should create an empty div to display it.
  2. On the same area (slice canvas position), we can create an empty canvas on it and set the position to absolute and zindex should be higher than the slice’s canvas.
  3. So when mouse down we can draw lines on the empty canvas. when the mouse moves we can update the line pixels on the empty canvas to slice’s canvas.
  4. Create a paint image object, the data structure should be like this:
paintImages = {
	“Slice.aixs”:{
		Slice.index: paintImage
      }
 } 
  1. Every time when we switch back to the painted slice, we can judge whether the slice index has painted image data, if yes, we can paint the image on the current slice canvas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant