Open soichih opened 6 years ago
Do you know what error message they are getting?
I think the error could be in 47-49: # dims = img.header['dim'][0] if dims != 3: results['errors'].append("input should be 3D but has " + str(dims))
Not sure how to fix this, I thought the dimensions were supposed to be 3?
Yes, that's the message user is seeing.
According to mrinfo, it is 3D, but nibabel doesn't think so.. (I am guessing?)
Otherwise, a workaround to get the dimensions is to replace dims = img.header['dim'][0]
by dims = img.get_data().ndim
or dims = len(img.get_data().shape)
I am seeing this issue with nibabel 2.2.1 (the latest via pip).
Most other t1 shows something like this.
dim : [ 3 260 311 260 1 1 1 1]
The workaround didn't work with the problem dataset.
i.get_data().ndim 4 i.get_data().shape (176, 240, 256, 1)
Maybe we can just count dimensions with >1?
Now, even if we can just patch around this issue, I am not sure if the problem dataset is actually a valid T1 (will it break some App?)
Thank you for all this info.
Maybe we can just count dimensions with >1?
I think we should avoid doing that
Now, even if we can just patch around this issue, I am not sure if the problem dataset is actually a valid T1 (will it break some App?)
Agree with that point. we should test this dataset with other apps. if it breaks them too, we assume it is not a valid dataset. Otherwise, we can be less strict with the test by doing
if i.get_data().ndim < 3:
@bcmcpher Have you seen an issue like this? The user mentions that he downloaded the dataset from LONI / PPMI. I don't have access to it.
A user informed me that this validator is failing with his t1w image that he is trying to upload.
Nibabel gives following output for this input. Please note the dim is not right..
But, mrinfo shows following dimensions
I can open this image just fine with fslview, freeview, etc..
@aarya22 @skoudoro do you know what could be going wrong with this?