brainlife / ezbids

A web service for semi-automated conversion of raw imaging data to BIDS

Home Page:https://brainlife.io/ezbids

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to run preprocess -- code:1

ZviBaratz opened this issue · comments

Hi,

I'm trying to upload a single subject's DICOM directory and am getting the following message:
image
preprocess.err.log
preprocess.log

I tried running the conversion using dcm2niix locally and did not encounter any issues. It did take relatively long though, is it possible there's a timeout that is being triggered?

Thank you for all the great work!

@ZviBaratz Thank you for posting this error message.

We run multiple dcm2niix in parallel, so it's hard to find which image is failing to convert (sorry!), but can you try converting all of these and see if you can convert them successfully?

  • echo ./DLX77C1B/1.3.12.2.1107.5.2.43.66024.2016120813254113240295385.0.0.0
  • echo ./DLX77C1B/1.3.12.2.1107.5.2.43.66024.2016120813374817750401149.0.0.0
  • echo ./DLX77C1B/1.3.12.2.1107.5.2.43.66024.2018012411353289977157238.0.0.0
  • echo ./DLX77C1B/1.3.12.2.1107.5.2.43.66024.2016120813371566601400887.0.0.0
  • echo ./DLX77C1B/1.3.12.2.1107.5.2.43.66024.2016072712013983867187539.0.0.0

I converted the files successfully. However, I think I know what the issue might be. The conversion log shows:

Warning: Adjusting for negative MosaicRefAcqTimes (issue 271).

I'm guessing this changes the return code? I am using the latest release of dcm2niix (v1.0.20210317).

I don't think Warning will change the return code.. but I could be wrong.

Just to be sure though.. With all 5 DICOM directories, you were able to convert them to .nii.gz file with dcm2niix running locally? Can you check $? (return code) from each command and make sure they are returning code 0?

@ZviBaratz Also.. is it possible to share the data that is causing ezBIDS to fail? I'd like to troubleshoot it with @dlevitas

Closing this issue now, due to inability to replicate error with other datasets. Will re-open if the error arises again.

I thought I found the dataset (batch2) that I was able to reproduce this, but I can't anymore..

Actually, I was able to reproduce it with batch2

DICOM file: ./batch2/027_S_5170/Accelerated_Sagittal_IR-FSPGR/2019-09-06_13_27_38.0/S871493/ADNI_027_S_5170_MR_Accelerated_Sagittal_IR-FSPGR__br_raw_20190909140833640_75_S871493_I1224553.dcm
 Optimal piped gz will fail if pigz version < 2.3.4.
Compress: "/usr/bin/pigz" -n -f -6 > "./batch2/027_S_5170/Sagittal_3D_FLAIR/2019-09-06_13_27_38.0/S871491/time-20190906132738-sn-4a.nii.gz"
Unable to equalize slice distances: slice order not consistently ascending:
dx=[0 0 1.2 2.4 3.60001 4.8 6 7.2 8.4 9.60001 10.8 12 13.1998 14.3998 15.5998 16.7998 17.9998 19.1998 20.3998 21.5998 22.7998 23.9998 25.1998 26.3998 27.5998 28.7997 31.1997 32.3997 33.5997 34.7997 35.9997 37.1997 38.3997 39.5997 40.7997 41.9997 43.1997 44.3997 45.5997 46.7997 47.9997 49.1997 50.3997 51.5997 52.7997 53.9997 55.1997 56.3997 57.5997 58.7997 59.9997 61.1997 62.3997 63.5997 64.7997 65.9997 67.1997 68.3997 69.5997 70.7997 71.9997 73.1997 74.3997 75.5997 76.7997 77.9997 79.1997 80.3997 81.5997 82.7997 83.9997 85.1997 86.3997 87.5997 88.7997 89.9997 91.1997 92.3997 93.5997 94.7997 95.9997 97.1997 98.3997 99.5997 100.8 102 103.2 104.4 105.6 106.8 108 109.2 110.4 111.6 112.8 114 115.2 116.4 117.6 118.8 120 121.2 122.4 123.6 124.8 126 127.2 128.4 129.6 130.8 132 133.2 134.4 135.6 136.8 138 139.2 140.4 141.6 142.8 144 145.2 146.4 147.6 148.8 150 151.2 152.4 153.6 154.8 156 157.2 158.4 159.6 160.8 162 163.2 164.4 165.6 166.8 168 169.2 170.4 171.6 172.8 174 175.2 176.4 177.6 178.8 180 181.2 182.4 183.6 184.8 186 187.2 188.4 189.6 190.8 192 193.2 194.4 195.6 196.8 198 199.2 200.4 201.6 202.8 204 205.2 206.4 207.6 208.8 210 211.2 212.4 213.6 214.8 216 -3.30484e+14 3.06338e-41 3.82554e-43 0 0 0 -3.29854e+14 3.06338e-41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.27e-22 4.558e-41 -nan 0 2.75506e-39 0 2.93874e-39 0 -3.30185e+14 3.06338e-41 -nan -nan 3.48975e-39 0 -nan -nan 0 0 4.04076e-39 0 4.22443e-39 0 -nan 0 4.59177e-39 0 4.77545e-39 0 2.26503e-22 4.558e-41 2.93194e-41 0 0 0 0 0 0 0 5.87747e-39 0 5.00123e-42 0 2.26975e-22 4.558e-41 2.26975e-22]
 Recompiling with '-DmyInstanceNumberOrderIsNotSpatial' might help.
Progress: 1
dcm2niix returned 1
dcm2niix returned 1

See dcm2niix post #539 for details. There is indeed an error message that I believe is causing the problem we're seeing. The preprocess.err.log provided by @ZviBaratz contains Error: Recompiling with '-DmyInstanceNumberOrderIsNotSpatial' might help. which is the same error as our ADNI validation example.

@soichih we may want to consider having preprocess.sh avoid such error messages in the future, though this would mean letting dcm2niix errors through. We should also consider increasing the dcm2niix verbosity (-v 2)

@dlevitas thanks for figuring this out, sorry I wasn't more help. Let me know if you need anything else.

Hello,

ADNI related questions are welcome at http://adni.loni.usc.edu/support/experts-knowledge-base/ask-experts/ , where questions are forwarded to the appropriate experts according to their category. In particular, we would like to be notified of any data related problems that can be resolved for future users, and may be causing problems for processing and analysis software. All ADNI images are manually inspected for quality control, but a few substandard scans or incomplete series have escaped quarantine over the years, for miscellaneous reasons.

If you have a question or comment concerning specific data, please provide, to the best of your ability,

  • the subject ID (DICOM tag (0010, 0020))
  • the scan date, (DICOM tag (0008, 0020))
  • the LONI image ID
  • the series number (DICOM tag (0020, 0011))
  • the series description (DICOM tag (0008, 103e))

(ADNI includes more than just imaging, so the Ask the Experts page will not prompt you for these.)

Since in this case it sounds like there may be missing slices, it might also be worth checking if LONI has all the slices, and if so, downloading again.

Thank you,

Rob Reid, on behalf of ADNI

Hi @captainnova, I've submitted the information to the ADNI knowledge base.

Hi @ZviBaratz,

We've updated ezBIDS to allow users to continue processing even in the event of dcm2niix errors. ezBIDS will provide and error and offending file(s), so that users can reach out to the dcm2niix group for guidance. Depending on the nature of the error, the offending files may or may not be included for BIDS conversion.

Hi @dlevitas ,
Sounds like a reasonable strategy for handling this. Thank you very much for the update!