saalfeldlab / paintera

GNU General Public License v2.0
100 stars 17 forks source link

Can't paint on the first/last frame of the volume #342

Closed wangyuhan01 closed 1 year ago

wangyuhan01 commented 5 years ago

Not sure if this is an issue on my end or a general issue, but I was having trouble painting on the very first/last frame of the image volume, when I tried to do that, the painting appeared on the second frame.

On a separate note, the new interface looks AWESOME! Thanks for the great work!

hanslovsky commented 5 years ago

Can you share the data that you are working on? I tried on one of the CREMI datasets and cannot reproduce there, but it may be only for certain resolutions.

On a separate note, the new interface looks AWESOME! Thanks for the great work!

Thanks, much appreciated :fireworks:

wangyuhan01 commented 5 years ago

Due to the file size limit, I have deposited the file to the following link: https://www.dropbox.com/s/k4rl81by90qy5vn/2019_r3_13_1390_1178.n5.zip?dl=0 The file path in json will need to be modified. Thanks!

hanslovsky commented 5 years ago

@wangyuhan01 I was able to confirm that behavior with the data that you provided.

hanslovsky commented 5 years ago

I also noticed that the label data is "smaller" even though both datasets have the same transform

$ grep '"transform"' -A 13 attributes.json
              "transform": [
                0.23,
                0.0,
                0.0,
                0.0,
                0.0,
                0.23,
                0.0,
                0.0,
                0.0,
                0.0,
                0.42,
                0.0
              ]
--
                "transform": [
                  0.23,
                  0.0,
                  0.0,
                  0.0,
                  0.0,
                  0.23,
                  0.0,
                  0.0,
                  0.0,
                  0.0,
                  0.42,
                  0.0
                ]

and dimensions

$ jq '.dimensions' t0/channel0/data/s0/attributes.json labels/data/s0/attributes.json
[
  1920,
  1920,
  213
]
[
  1920,
  1920,
  213
]

Note that, hopefully soon, datasets can be relative to a project directory without having to rename the paths in the project file: https://github.com/saalfeldlab/paintera/pull/343

igorpisarev commented 5 years ago

Maybe this is a side effect of #220 where I changed the half-pixel offsets in the mask transformations, although I thought that I got them correctly in that PR.

wangyuhan01 commented 5 years ago

Thank you for looking into this. If it helps, the label dataset was created in paintera through Ctrl+Shift+N and I only defined the pixel size (0.23, 0.23, 0.42) and used the default image dimension.

hanslovsky commented 5 years ago

@igorpisarev I don't think it is that because it happens on both sides of the data in each dimensions. If the offset was wrong, we should see it only on one side and an overhang on the other side instead, no?

igorpisarev commented 5 years ago

Ah, yes, then it's probably something else. I haven't looked into it, but this was just my hypothesis that if the offsets are slightly off, it would round up the 0.5px and treat the last slice as being outside.

axtimwalde commented 1 year ago

Works now, painting logic has changed and fixed this.