funkelab / gunpowder

A library to facilitate machine learning on multi-dimensional images.
https://funkelab.github.io/gunpowder/
MIT License
78 stars 56 forks source link

Fixed: Resample requesting outside available ROI for interpolation padding #170

Closed rhoadesScholar closed 2 years ago

rhoadesScholar commented 2 years ago

Pre-Merge Checklist:

pattonw commented 2 years ago

Good catch. To avoid interpolation border artifacts it might be better to shrink the provided roi by 1 voxel in setup rather than doing an roi intersection which will still lead to border artifacts if the request happens to be at the boundary of what is provided. Also I'm not completely clear on the purpose of ndim, can you please update the docstring?

rhoadesScholar commented 2 years ago

To avoid interpolation border artifacts it might be better to shrink the provided roi by 1 voxel in setup rather than doing an roi intersection which will still lead to border artifacts if the request happens to be at the boundary of what is provided.

The downside of this is that the Resample node can no longer be placed downstream of a RandomLocation node, because RandomLocation provides an (inf, inf, inf) shaped ROI, which breaks the setup.

rhoadesScholar commented 2 years ago

To avoid interpolation border artifacts it might be better to shrink the provided roi by 1 voxel in setup rather than doing an roi intersection which will still lead to border artifacts if the request happens to be at the boundary of what is provided.

The downside of this is that the Resample node can no longer be placed downstream of a RandomLocation node, because RandomLocation provides an (inf, inf, inf) shaped ROI, which breaks the setup.

Fixed (d092313)

pattonw commented 2 years ago

Looks pretty good to me. If no one else has any comments I'll merge it tomorrow