saalfeldlab / paintera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mask resolution is not correct for non-isotropic data.

hanslovsky opened this issue · comments

It is possible to paint at higher resolution than the low resolution of non-isotropic CREMI data:
paintera-brush-issue-(2) crop

I expect that this is not a problem with the brush but with the canvas.

May be related to #342

Recent changes to how Painting and Masks are used I believe solve this. @hanslovsky, @axtimwalde let me know if you think this gif seems to show this issue solved, or if you would expect different behavior:

PainteraIssue361

I would expect that all the blue labels that are created by the line are connected, i.e. the individual components would need to be taller along the y axis of the viewer in this case. In the original issue comment, the painted area was overestimated. Here, it is underestimated. Basically, I would want every voxel painted that the brush overlaps with. I believe you may be checking for overlap with the center of a voxel only. I remember that I did not find a good (and efficient) way for collision/overlap detection of a cylinder with an arbitrarily rotated box.

Good point to consider, we will drool over this a little longer. One way to interpret this could be that if you paint with a brush thinner than a pixel you get shapes that are thinner than a pixel and potentially disconnected. Another interpretation could be that for materializing into the mask, we have to loop over a raster that is the minimum of the resolutions of the screen mask and the label mask, that would fill those pixels but it may feel as slight overpainting again (by the thickness of the brush).

With the most recent release, there where again significant changes to this. Now all voxels that the brush overlaps with are painted, and the resulting annotation will always be connected, regardless of the rotation. Here are a few examples:

paintera_mask_paint.mp4
paintera_mask_fill.mp4

@axtimwalde @hanslovsky let me know if you think this issue can be closed.

I had a look at the frames when it flips from paint overlay to mask in the first video and it looks good to me. Do you have a link to the commit that fixed it? I am curious what the bug was.

We are now painting into a 2D mask at screen resolution and at mouse release fill all voxels of the canvas that intersect with the screen and the mask.

It's a fairly involved change, but if you want to look at the most relevant part of the commit, it's this particular function ViewerMask.applyMaskToCanvas.

Awesome, thank you!