Open lguerard opened 1 year ago
@imagejan Thanks for cleaning up a bit the PR ;)
However, I'm not sure if that closes the issue aryehw was mentioning, but it at least closes mine. (I probably should have made a different issue for this, sorry..)
Good point, @lguerard, sorry, I maybe was a bit fast to add the "Closes #38" to your PR description.
4
according to here:So how about relaxing to gridType >= 4
even?
I would be fine but I don't have any files to test the other types which is why I asked if there was a reason to keep it only for 5 and 7.
@lguerard wrote in https://github.com/fiji/Stitching/issues/38#issuecomment-1293368423
Was there a reason to only do the downsampling if
GridType
was 5 or 7 ?
The Downsampler
logic was introduced with https://github.com/fiji/Stitching/commit/f37c98f8b6ca3fb9bc8cc27a7efa2bf2021ff4bf.
There's actually two code paths, for grid type {5,7}
and for all others:
!( gridType == 5 || gridType == 7)
(note the ds
arguments in the function calls):
https://github.com/fiji/Stitching/blob/340ab1123e1b1c32744e05df63c5c0023056fc15/src/main/java/plugin/Stitching_Grid.java#L406-L418
( gridType == 5 || gridType == 7)
https://github.com/fiji/Stitching/blob/340ab1123e1b1c32744e05df63c5c0023056fc15/src/main/java/plugin/Stitching_Grid.java#L460-L466
So while the fix might work for your case, @lguerard, I believe there was some other breakage since https://github.com/fiji/Stitching/commit/f37c98f8b6ca3fb9bc8cc27a7efa2bf2021ff4bf. It would be good to have unit test cases for this 😄
Indeed, sorry about this. I'll investigate a bit more and update this PR when I have found something !
Actually, I think I was right.
If I understand correctly what the ImageCollection
corresponds to, this part https://github.com/fiji/Stitching/blob/340ab1123e1b1c32744e05df63c5c0023056fc15/src/main/java/plugin/Stitching_Grid.java#L417-L418
only changes the grid elements which corresponds to the position of the tiles no ? The real downsampling of the ImagePlus
is happening here and only if the GridType
is 5 or 7.
https://github.com/fiji/Stitching/blob/340ab1123e1b1c32744e05df63c5c0023056fc15/src/main/java/plugin/Stitching_Grid.java#L460-L466
Just changing this line fixes the issue with the TileConfiguration reported here : https://forum.image.sc/t/fusion-of-label-images-using-downsampling/73150
Closes #38.