juglab / n2v

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

Error Loading data with TZYX axes #15

Closed lacan closed 5 years ago

lacan commented 5 years ago

Hello,

I am trying to update our protocol as per your new version but am unable ti lad data with imgs = datagen.load_imgs_from_directory(directory = "Images", dims="TZYX")

I have stacks from Fiji with Slices and Timepoints (TZYX when imported with imread an read into a numpy array. When I run teh above line I get

ValueError: repeated axis in `destination` argument

Debugging and looking at the values of print (move_axis_from, move_axis_to) I see that they are (0, 1, 2, 3) (0, 0, 1, 2)

So something somewhere isn't happy when reodering the axes...

Best Oli

Edit: line is at https://github.com/juglab/n2v/blob/509d6fd1b3cfadc35ffda78d12b4f0265200e4d4/n2v/internals/N2V_DataGenerator.py#L71

lacan commented 5 years ago

Same if I load data with TZCYX I get

print (move_axis_from, move_axis_to)
(0, 1, 2, 3, 4) (0, 0, -1, 1, 2)

So the axis reordering seems broken... Sorry I can't help much more

tibuch commented 5 years ago

Thank you for reporting. I am looking into it. Did you install via pip?

lacan commented 5 years ago

Yes I did, wanted to try it out after the recent Tweet :)

tibuch commented 5 years ago

Happy to hear that! It looks like we found this bug last Friday and forgot to release the new version to pip :sweat_smile: I am double checking the fix. Would you be able to install from the git-repository? You can do it by checking out the repository, change to it and then execute pip install ..

lacan commented 5 years ago

I've done it and it loads the data properly now! I haven't finished updating my pipeline to work with all the new features, but this issue is now solved! Thanks a lot!

tibuch commented 5 years ago

Great! Thanks for testing! I will release the new version immediately.