juglab / n2v

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

N2V_DataGenerator error in 3D making patches #70

Closed trasse closed 4 years ago

trasse commented 4 years ago

Dear All,

i tried to use the N2V_DataGenerator to make patches out of this image: (1, 30, 1024, 1024, 1)

print(imgs[0].shape) X = datagen.generate_patches(imgs[0], shape=(15,512,512),augment = False)

However i get: (1, 30, 1024, 1024, 1) Generated patches: (1, 15, 512, 512, 1)

Instead of: Generated patches: (8, 15, 512, 512, 1)

print(imgs[0].shape) X = datagen.generate_patches(imgs[0], shape=(14,511,511),augment = False) works as expected: (1, 30, 1024, 1024, 1) Generated patches: (8, 14, 511, 511, 1)

Thanks a lot & Kind regards

Tobias

trasse commented 4 years ago

I solved the issue and saved it as N2V_DataGenerator2.py in trasse/n2v where I also added some options i needed for other reasons.

tibuch commented 4 years ago

Would you mind creating a pull request with the fix?

Then we can potentially merge it into N2V and create a new release with the fix.

Best wishes

trasse commented 4 years ago

Yes sure. I just did. Please check if my solution creates problems elsewhere. I used N2V_DataGenerator for something else. Therefore I gave it also a different name.