Dwifslpreproc error for multishell dwi image

Dear MRtrix3 experts,

I met a problem when I doing dwifslpreproc for multishell (5 shells) dwi images.

The command I used:

dwifslpreproc dwi_den.mif dwi_den_preproc.mif -nocleanup -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear --data_is_shelled" 

I pasted the error contents after topup completed:


Command:  mrconvert dwi.mif -import_pe_table dwi_manual_pe_scheme.txt eddy_in.nii -strides -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt
Command:  eddy_cuda10.2 --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --topup=field --slm=linear --data_is_shelled --out=dwi_post_eddy --verbose
***dwifslpreproc: CUDA version of 'eddy' was not successful; attempting OpenMP version***
Command:  eddy_openmp --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --topup=field --slm=linear --data_is_shelled --out=dwi_post_eddy --verbose

dwifslpreproc: **[ERROR]** eddy* --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --topup=field --slm=linear --data_is_shelled --out=dwi_post_eddy --verbose (app.py:196)
dwifslpreproc: [ERROR] Information from failed command:
dwifslpreproc:
               =============
               eddy_cuda10.2
               =============
               
               
               ===========
               eddy_openmp
               ===========
               Reading images
               EDDY:::  EddyUtils::get_groups: Inconsistent b-values detected
               EDDY:::  EddyUtils.cpp:::  static bool EDDY::EddyUtils::get_groups(const std::vector<EDDY::DiffPara>&, std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>&, std::vector<double>&):  Exception thrown
               EDDY:::  EddyUtils.cpp:::  static bool EDDY::EddyUtils::GetGroups(const std::vector<EDDY::DiffPara>&, std::vector<std::vector<unsigned int> >&, std::vector<double>&):  Exception thrown
               EDDY:::  ECScanClasses.cpp:::  std::vector<std::vector<unsigned int> > EDDY::ECScanManager::GetShellIndicies(std::vector<double>&) const:  Exception thrown
               EDDY::: Eddy failed with message EDDY:::  ECScanClasses.cpp:::  EDDY::ECScanManager::ECScanManager(const string&, const string&, const string&, const string&, const string&, const string&, const string&, const string&, EDDY::ECModel, EDDY::ECModel, const std::vector<unsigned int>&, const EDDY::PolationPara&, EDDY::MultiBandGroups, bool):  Exception thrown
               
               
               =============
               eddy_cuda10.2
               =============
               eddy_cuda10.2: error while loading shared libraries: libcublas.so.10: cannot open shared object file: No such file or directory
               
               
               ===========
               eddy_openmp
               ===========
               
               
dwifslpreproc:
dwifslpreproc: [ERROR] For debugging, inspect contents of scratch directory: /home/..../dwifslpreproc-tmp-KITOSL/
dwifslpreproc: Scratch directory retained; location: /........

However it is so strange that few subj’s image can work well with dwifslpreproc and without this error even though they are aquired by the same scanner with same parameters.

Does anyone has any idea or suggestion? Thank you!

Best,
Sia

Hi Sia,

There are two issues here. The first is on this line:

eddy_cuda10.2: error while loading shared libraries: libcublas.so.10: cannot open shared object file: No such file or directory

This suggests that you either don’t have CUDA version 10 installed on your system, or it’s not available or otherwise misconfigured. This means you won’t be able to use the GPU-accelerated version of EDDY (and also won’t be able to do slice-to-volume correction). If you have access to a NVIDIA GPU and you were expecting to be using the CUDA version, then I suggest you search for the keyword ‘CUDA’ on this forum – you’ll find this is a common problem, but the solution will vary depending on the specifics of your system.


The second issue occurs when the script falls back to the OpenMP (CPU) version of EDDY, and fails with the message:

Inconsistent b-values detected

If these data were acquired with the same protocol as other subjects that have been successfully processed with the same command, then this is indeed unexpected – but it can happen. If you can post the full output of:

mrinfo dwi_den.mif -shell_sizes -shell_bvalues -dwgrad

This might give us a better idea of what the problem might be.

All the best,
Donald.

Dear kdtournier,

Thanks you so much for your reply.

For the first error, I have cuda11.5 located in /usr/local/cuda, do I have to keep the cuda version the same as 10.2 so that I can use the eddy cuda command?

For the second, I have copied the b-value following this command into the tmp file, still report the same error. I really have no idea and finally copied the b-value in tmp file from subj without error, :joy: :sweat_smile: and run eddy_openup and the other commands of dwifslpreproc one by one, it worked.
This is really weird but anyway it goes well without error.

Yes, the version of the CUDA library needs to match the version that the eddy_cuda executable expects. You can have both versions installed alongside each other if needed.

:exploding_head: I have no idea what you’ve just done…

Any chance you could explain this in more detail, including the filenames involved and their contents, so we can try to figure out what might have gone wrong in the first place? If there’s an issue in the script, it’s worth fixing before others also encounter problems…

If you can post the full output of:

For the second, I have copied the b-value following this command into the tmp file, still report the same error.

@Sia: What @jdtournier was asking for was to post the output of that mrinfo command here on the forum, not to attempt to inject those data into the script (if eddy claims that there’s an issue with the gradient table, extracting that gradient table and putting it in the scratch directory can’t possibly fix the problem).

Hi everyone, I’d appreciate your advice
I had a similar problem recently, according to the file error.txt in the dwifslpreproc-tmp

eddy_openmp --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --topup=field --slm=linear --out=dwi_post_eddy --verbose

Reading images
EDDY::: ECScanManager::GetShellIndicies: Data not shelled
EDDY::: ECScanClasses.cpp::: std::vector<std::vector > EDDY::ECScanManager::GetShellIndicies(std::vector&) const: Exception thrown
EDDY::: Eddy failed with message EDDY::: ECScanClasses.cpp::: EDDY::ECScanManager::ECScanManager(const string&, const string&, const string&, const string&, const string&, const string&, const string&, const string&, EDDY::ECModel, EDDY::ECModel, const std::vector&, const EDDY::PolationPara&, EDDY::MultiBandGroups, bool): Exception thrown

I used

dwifslpreproc DWI_den_unr.mif DWI_preproc.mif -nocleanup -rpe_pair -se_epi DWI_b0_pair.mif -pe_dir ap -align_seepi -eddy_options " --slm=linear"

Given this, i got this in the last 2 rows

0 1000 2000 3000
18 16 64 128

Should I copy the whole table?

Thanks a lot

Hi,

I think your error is different from the original one of the post.

Eddy is complaining about the acquisition no having a shell structure, this happens a lot with multishell sequences. Adding the flag --data_is_shelled to your command should do the trick:

dwifslpreproc DWI_den_unr.mif DWI_preproc.mif -nocleanup -rpe_pair -se_epi DWI_b0_pair.mif -pe_dir ap -align_seepi -eddy_options " --slm=linear --data_is_shelled"

Best regards,

Manuel

Hi J-Donald,
I am trying to run Sia’s data with the same problem. That says: EDDY::: EddyUtils::get_groups: Inconsistent b-values detected.
Here I am attaching the info of dwi_den.mif for your referring. Thank you.
$ mrinfo dwi_den.mif -shell_sizes -shell_bvalues -dwgrad

              0                    0                    0                    0
               0                    0                    0                    0

0.433641366273926 0.8431979590493 0.317761494380893 500
-0.714438078140159 -0.676283706638014 0.179495349910089 1000
0.439631049014048 -0.121938539103897 -0.889862648628436 500
-0.530636732191643 0.529426273591663 0.661915764489576 1000
0.496478186886326 -0.814430401377568 0.300354009891727 500
0.963959269031585 0.013275214710435 0.265718453108707 150
-0.767640415393808 0.331682885897325 0.548374557995577 1000
-0.344391621288487 0.935888842068714 -0.0742057038075194 500
0.187358790404654 0.739154067018359 -0.646952818116069 1000
0.148778610404849 -0.840376676827389 -0.521183236616986 500
0.908029952481783 -0.23078440219537 0.349600007292986 1000
-0.719363522985004 -0.0895781322981327 -0.688833709985641 500
-0.31614429050642 0.159703974703243 -0.935172405518992 50
-0.45848538351037 -0.880744125519921 0.118663130202684 1000
0.555358035511333 0.330027107606735 0.763321400615577 500
-0.852211541124519 -0.0504106266714504 -0.520763149514983 1000
0.605794823003737 -0.349334313802155 0.71482737050441 500
-0.217392281291744 0.61798086437653 -0.755539705971306 1000
0 0 0 0
-0.333901313792672 -0.717225178584258 -0.611635476286576 500
-0.820531060174031 -0.0824841662573895 0.565619254982099 1000
-0.739009479416762 0.654634825614848 -0.159117046303609 500
-0.248634722894616 0.691770466785021 0.67796341778532 1000
-0.252133450693605 -0.562551173685732 0.787378498580029 500
0.147994501198523 0.183042648898174 -0.971901752390302 150
-0.928168752412914 0.120091344101671 0.352251098104901 1000
-0.223678701705553 0.200287050004972 -0.953862115823678 500
0.82273183509092 -0.485306890094644 -0.295955317496734 1000
-0.0224157866896442 -0.0366043630694189 -0.99907840188414 500
0.266094183495413 0.335555488294215 -0.903657235784421 1000
0.335966653094782 0.521909058191894 0.784051875187822 500
0.499423606880584 0.593288987976935 -0.631335281475456 50
0.726436178990533 0.465534204393933 -0.505537716093412 1000
0.78690408621646 0.285803563005978 -0.54689878631144 500
-0.463975042613036 -0.0980061407927536 0.880410106824736 1000
0.129125366494403 0.902417956360887 0.411057747482184 500
0.250315077804315 0.944561042916283 0.212477758903663 1000
0 0 0 0
-0.72416249782805 0.646146162725028 0.241005836309335 500
0.559209337315167 0.689244221318693 -0.460681365412494 1000
-0.36009884129311 -0.931962186882168 -0.0421343888191938 500
0.396930556719098 -0.327274256915747 -0.85751833444126 1000
0.457545811609533 0.323363669406737 -0.828304151617257 500
-0.0302077939311353 0.825256617331014 0.563949470021194 150
-0.644534589669956 0.136978862393615 0.752204728764937 1000
0.875246320258149 -0.480764842077012 -0.0530004292174657 500
-0.282053372089095 0.929636284864059 -0.237112363990833 1000
-0.819594318991405 0.443034584795354 -0.36329809929619 500
0.951464156496893 -0.295041069299037 -0.0875598442697141 1000
-0.434108903402773 0.698664270704463 0.568698247603633 500
-0.513669097420529 -0.720557534228798 -0.465769146918615 50
0.221625945292529 -0.0952196391267901 -0.970471617667285 1000
0.816849508635523 -0.193045712708395 0.543590133323639 500
0.555947412018544 -0.821558522627403 0.126348996704214 1000
-0.808132056322718 0.138549353403895 0.572474153316093 500
-0.325450975603214 -0.352919550303485 -0.877228279008664 1000
0 0 0 0
-0.594699850316059 0.339447613509166 0.728771161419679 500
0.0553716911276461 0.243972184189629 0.968200159658842 1000
0.651212306062529 0.533207807669319 0.540011079768927 500
0.167212982595592 -0.376018476390087 0.911399980175973 1000
-0.38049072270864 -0.738893189116779 0.556114794812629 500
0.825535792411036 0.312136748304173 -0.470171570606285 150
-0.537503934503651 -0.132238156500898 -0.832828067705657 1000
-0.529855334794701 -0.798496438592015 0.285756472797142 500
-0.493932885704202 -0.541462151104606 -0.680330098805788 1000
0.327839887493736 -0.713724148086364 0.618965951088174 500
0.432501327594816 -0.891210108889318 -0.136700926998362 1000
-0.755109807741633 -0.563809877231086 0.334555825818446 500
0.393859913103894 -0.864368578508546 -0.312636097303091 50
0.631463490194031 0.289727577697261 -0.719243902493202 1000
-0.656940729900445 -0.0876323992100593 0.748832050600507 500
-0.495786054398955 0.533888256798875 -0.684952200898556 1000
-0.989045569955816 0.104270513495342 0.104482154295332 500
-0.770891937316524 -0.627833761913457 -0.107472733202304 1000
0 0 0 0
0.877140748970701 0.436602315085416 0.200006312293319 500
0.68596324313031 -0.135675430905995 0.714875238431588 1000
0.923880224663105 0.0975959332561025 -0.370027518285223 500
-0.318689532000193 -0.862784129800523 0.392479970900238 1000
0.954040875091938 -0.26858477879773 0.132921876498877 500
-0.527592944498463 -0.342908318299001 -0.777212692997736 150
-0.421434651196345 0.771582947293307 -0.476500356995867 1000
-0.983269451571773 -0.165666679295244 -0.0757346484578259 500
0.0617930267922854 0.544935039820155 -0.836198196730927 1000
0.603336683798036 -0.604555828898032 0.520093352898307 500
-0.157556727794353 -0.985579854864674 0.0617108354477881 1000
-0.59278324020858 0.804745323211648 0.0315118215404561 500
0.427694865915558 -0.353120416512845 -0.832095591330268 50
0.16835252640013 0.618018064500478 0.767926493100594 1000
0.842978613967996 0.277261585889474 0.460991398382498 500
0.869197458674871 -0.471822344286359 0.147917048595724 1000
0.504367545292377 -0.0809479331387766 0.859686461087007 500
-0.602739136495949 0.689174868595368 0.402173512097297 1000
0 0 0 0
-0.20119665459262 0.89092133986732 -0.407159762685065 500
-0.561922354809803 -0.697228443412163 -0.445101971307765 1000
-0.028888800641045 0.674974223324416 0.73727554892667 500
0.427975485278792 0.543628645873061 -0.722014459264221 1000
-0.103944826998512 -0.86679484358759 0.487711156393018 500
0.439234726705753 -0.716853038909389 0.541474445807092 150
-0.324971064886098 0.846117583163805 0.422467563781928 1000
-0.248752473306524 -0.943342691224741 0.21960595150576 500
0.148221394996465 -0.988398820976426 -0.0331389311492096 1000
0.585922458705568 0.52084233810495 -0.6208205306059 500
-0.301324048205944 -0.823357722416241 -0.480921905209486 1000
0.689822048469129 -0.512624697177059 -0.511235230877121 500
-0.0549123043898496 0.951154366497395 -0.303792708799168 50
-0.991670717534747 0.0599453697521004 -0.113998862403994 1000
0.0272918651497892 -0.693786153294642 0.719663760094442 500
0.923471398344325 0.383666151876869 0.000927547288344079 1000
-0.0386214300802252 -0.373038516902175 0.927011677405406 500
-0.117513889602648 0.490053148611045 0.863735143019466 1000
0 0 0 0
0.18002081320225 -0.292026157403649 -0.939315298611739 500
0.880694412205918 0.337655781602269 -0.332213674402233 1000
0.479506555094272 -0.819338713290212 -0.314257118496246 500
0.108770962395492 -0.821125877565971 0.56028668637678 1000
-0.326285255793484 0.522163110589572 0.787961685484264 500
-0.738736010674926 0.569930050480656 0.359789999987788 150
0.983459271778271 0.110625493797556 -0.143421967896831 1000
0.330303467398711 -0.46886992449817 0.819182893696804 500
0.446482363402003 -0.271411257801218 0.852636750503825 1000
-0.227112515494311 0.94934950197622 0.217153006894561 500
0.0368956399415947 0.805201783034802 0.591852008825581 1000
0.308311116292451 0.179934423595595 0.934113407877129 500
-0.956950258204586 -0.289626729301388 0.0190410345400913 50
-0.733770789397074 0.398386910598411 -0.550334714597806 1000
0.245269058100576 0.133495491800314 -0.960219788802256 500
-0.68461106839814 0.638463695798265 -0.351670007499044 1000
0.0849162038120002 0.433385051510208 0.897199328721134 500
-0.270856209310419 0.0150470332405788 -0.962502208137024 1000
0 0 0 0
-0.0619839468896899 -0.989798045495048 -0.128288033199358 500
0.78730562202929 0.484014746518007 0.38194185771421 1000
-0.626609265024615 -0.779047697130604 0.0211072163208292 500
0.744095965426698 -0.666002744123896 -0.0525503478118855 1000
-0.936531426102257 -0.315006281400759 0.153882847000371 500
0.393682822897012 0.903146524993145 -0.1712897817987 150
0.0493549840003792 -0.944395872107255 -0.325085407702497 1000
0.0539260441578342 -0.989167423960272 0.136527613094517 500
-0.934378781566495 -0.224003905591968 -0.277053321290066 1000
0.946852353574878 0.00386770676389738 0.321645241491466 500
0.0226067402799655 0.152569205399767 -0.988034196198491 1000
-0.682101795683116 -0.676120396183264 -0.278564804293105 500
0.821976444873205 -0.503802109983577 0.265590206991342 50
0.712776881560686 0.311130494882839 0.628607136665329 1000
0.826179721611332 0.556954663707639 -0.0850209984211662 500
0.541620327320251 0.827313896230933 0.148993752005571 1000
0.889671006958791 -0.312329477885533 -0.333070257784572 500
-0.0243746712688655 -0.94766779995589 0.318326273385183 1000
0 50 150 500 1000
9 8 8 64 64