-
Notifications
You must be signed in to change notification settings - Fork 125
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
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
#670
Comments
seems to be specifically
so can you try with |
Thanks for the suggestion - however I seemed to have run into the same error with 0.12.2 as well:
|
is there a chance you could share that DICOM publicly? privately? I think we should file the issue with nibabel -- I don't see a similar issue there. |
@yarikoptic I get the same error as above using
Note: The containall flag was used to rule out a conflict with nibabel installed locally. There were no differences whether running with |
Can confirm I'm getting this error as well. Same versions. It is happening on derived TRACEW images from DWI sequences. |
Filed nipy/nibabel#1245 since I think the issue is to fix within nibabel. |
Not any that I'm aware of. However, I think you can derive/calculate the tracew images from dwi data. TRACEW sounds like weighting of the traces of the DTI matrix. |
I'm able to send one of ours as an example. As long as its not posted to be publicly accessible. Please advise where I can send. |
The problem is caused in this block of
For a trace image it detects all frames as derived and removes them. You are left with an empty image. |
eh, you really confused me with the statement of it being in
and that is why should be fixed there, thus nipy/nibabel#1245 . @kodiweera - could we collect some on phantom in coming days? (@chrisadamsonmcri we better have a public copy of it) or may be @neurolabusc has one of those tracew files somewhere among qa_ datasets? |
Sorry my bad. |
Sample tracew DICOMs were collected and available now at http://datasets.datalad.org/?dir=/dicoms/dartmouth-phantoms/Siemens-DWITrace-20230803 . But upon quick try with |
You may want to have dcm2niix ignore derived images ( If you do ask dcm2niix to retain derived data, it will add a hint to the JSON indicating that the image has been detected as derived:
However, dcm2niix's derived image detection errs on the side of caution, and therefore not all derived data will be identified as such. Indeed, in many cases whether data is derived or not is in the eye of the beholder, e.g. some users only export images with NonlinearGradientCorrection and use it as their raw data, while other users export with and without this manipulation and likely consider the corrected image derived from the uncorrected image. |
this logic happens in heudiconv before invoking dcm2niix -- we also try to sort dicoms into separate series which we then eventually give to |
Since my attempts to reproduce on locally collected data failed, if you could share with me (yarikoptic at gmail) some way -- would be great. I will then look into fixing up nibabel for it. |
nevermind! I have gone through all
! edit: full log with some other errors observed is at http://www.oneukrainian.com/tmp/dcm_qa_heudiconv_sweep.txt |
@chrisadamsonmcri I think you nailed the reason in #670 (comment) ! FWIW, if I disable that removal of isotropic images, and use "experimental" dcm2niix and check what dcm2niix assigns for BidsGuess, I get:
so looks all good and legit. I guess we need to look into fixing nibabel to not overzealosly remove there since in this particular case it looks like a legit DWI ( |
@yarikoptic 20_DWI_dir80_AP is a derived image. This is clear in the JSON:
The derived TRACE image is typically the geometric mean of the raw directional images. One should expect better derived diffusion measures (TRACE, MD, ADC, FA, etc) after processing with dwidenoise, mrdegibbs, topup and eddy. In general, BIDS treats derivatives differently than source data. |
What exactly is the fix for this? I'm experiencing the same thing. |
no fix yet unfortunately... I followed up on nipy/nibabel#1245 |
Hi I'm getting the same issue. Did anyone resolving this. Running through Singularity container. Error: numpy.exceptions.AxisError: axis 1 is out of bounds for array of dimension 1 |
a solution is proposed by @effigies in nipy/nibabel#1245 (comment) . Those who can -- try by using patched nibabel |
if you do
then you could test on your sample dicom using smth like |
@yarikoptic Thanks. I'll try that and let you know. |
The nipy/nibabel#1245 (comment) fix has resolved this (locally). Would you be able to update this patch into a new heudiconv container? I'm not sure how to fix the container myself. |
nibabel 5.2.1 is on PyPI. |
I have now merged and released so you should be all set to use that docker image ❯ docker pull nipy/heudiconv
Using default tag: latest
latest: Pulling from nipy/heudiconv
09e2bc8a597c: Already exists
119c26737198: Already exists
55899c7a837b: Already exists
d976abd2a5fb: Already exists
11b5f8f00533: Already exists
5e3ef4f14ec4: Pull complete
d89fd4dd54dd: Pull complete
7ab0c18a5b97: Pull complete
99e911c23a9d: Pull complete
148a08b8543f: Pull complete
Digest: sha256:5f26567ac56461ddaf734034a92c54eee1203236f512051d8070630b64e174d8
Status: Downloaded newer image for nipy/heudiconv:latest
docker.io/nipy/heudiconv:latest
❯ docker run --rm nipy/heudiconv --version
1.1.0
❯ docker run --rm --entrypoint /opt/miniconda-py39_4.12.0/bin/python nipy/heudiconv:master -c 'import nibabel; print(nibabel.__version__)'
5.2.1 |
Summary
Description of issue: using heudiconv to convert some participants' sessions ("vis") results in a
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
error. The same heuristic was successfully used on other participants, but I'm not seeing the difference between participant data that is successfully converted and the data that runs into the error.commands:
command-line output:
heuristic:
Platform details:
Choose one:
Docker
tag: nipy/heudiconv:latest
image ID: 0d55d3d24064
The text was updated successfully, but these errors were encountered: