juglab / n2v

This is the implementation of Noise2Void training.
Other
387 stars 107 forks source link

N2V Patch Generation #73

Closed tibuch closed 4 years ago

tibuch commented 4 years ago

It is not possible to create patches which have the same size as the input data.

It looks like the error is somewhere in here. Probably a +1 or >= is missing.

tibuch commented 4 years ago

A test covering this issue is also required.

Romain-Laine commented 4 years ago

I have found the same issue independently by comparing the number of patches expected to the number of patches calculated by N2V, when the image size is exactly divisible by the patch size. This issue looks to me like it's to do with range(start, stop, step), not including 'stop'.

Screen Shot 2020-04-16 at 10 11 36

I think it could be fixed by replacing: for z in range(0, data.shape[1] - shape[0], shape[0]): by for z in range(0, data.shape[1] - shape[0] + 1, shape[0]):

(same for all dimensions)

turekg commented 4 years ago

Fixed new version released v0.1.11