-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Can not handle an h5 file with 5D data structure #1111
Comments
Double value in np.arange was not the only problem. Fix 1In line 63-64,
Fix 2I don't know why there is this comment data = (nchan x) (nframes x) nplanes x pixels x pixels If that comment is right, than...
but the second case of the 4D and the 5D fail because of the line 81 It would be much safer to check the shape of the data and raise error when the data shape didn't match with Same thing applies to line 82-83 Fix 3I don't understand the logic in line 97 as For the 5D, don't we want something like this?
In this case, Then line 98-99 and line 104-105 should be changed too. Minorline 87 Please correct me if I'm wrong. BTW, it's an awesome package! Thank you for your job! |
Thanks @knowblesse for noticing this and trying to fix this issue. We don't use h5 files ourselves, but I think this deinterleaving of irange is necessary for scanbox converted files? I believe these files had data arrays which were/are 3D/4D which needed to be converted to 5D format to put into our binaries (tiffs have this sort of ordering too from Scanimage). But I honestly don't remember who we added this specific 4D/5D fix for. If possible, ideally the fix would be backwards compatible, e.g. for Fix 1,
For Fix 2 -- check if the h5 file has the right dimensions -- if so, skip all of the deinterleaving steps and write straight to binary? I'm not sure if Fix 3 means there is a bug for these sorts of files already anyway? |
Hi Dr. Stringer, I'm Ji Hoon, and thank you for your comment! Your feedback is truly an honor! I actually fixed the issue, and tested on 3D, 4D (with multiple channels), 4D (with multiple planes), and 5D (both multiple channels and planes). I've submitted a pull request (#1112), and I would greatly appreciate your review.
Thank you! |
Describe the issue:
When
suite2p
try to open an h5 file with 5D data structure, it can not iterate through frames with this error.TypeError: Indexing arrays must have integer dtypes
The cause of the error is the fact that arguments of
np.arange
receivesint / int
whenhdims != 3
.Reproduce the code example:
# needs an h5 file with 5D array structure.
Error message:
Version information:
0.14.0
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: