{"action":"created","issue":{"url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/9","labels_url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/9/comments","events_url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/9/events","html_url":"https://github.com/NIRALUser/DTIPrep/issues/9","id":99518719,"number":9,"title":"Incorrect gradient directions when B0 is not the first volume","user":{"login":"SyamGadde","id":1247460,"avatar_url":"https://avatars.githubusercontent.com/u/1247460?v=3","gravatar_id":"","url":"https://api.github.com/users/SyamGadde","html_url":"https://github.com/SyamGadde","followers_url":"https://api.github.com/users/SyamGadde/followers","following_url":"https://api.github.com/users/SyamGadde/following{/other_user}","gists_url":"https://api.github.com/users/SyamGadde/gists{/gist_id}","starred_url":"https://api.github.com/users/SyamGadde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SyamGadde/subscriptions","organizations_url":"https://api.github.com/users/SyamGadde/orgs","repos_url":"https://api.github.com/users/SyamGadde/repos","events_url":"https://api.github.com/users/SyamGadde/events{/privacy}","received_events_url":"https://api.github.com/users/SyamGadde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-06T20:31:31Z","updated_at":"2015-12-09T16:55:03Z","closed_at":null,"body":"We are using v1.2.4 of DTIPrep.\r\n\r\nSeveral of our users like to concatenate multiple DTI runs together.  Generally each run consists of a single B0 volume followed by diffusion-weighted volumes, and this works pretty well.  I believe DTIPrep averages the B0 volumes together and the averaged volume is placed where the first B0 volume would have been in the original data, and the rest of the B0 images are removed.  In most cases, the diffusion directions are output correctly.\r\n\r\nThis also generally works if any of the B0 volumes are excluded for poor quality.  The averaged volume is placed where the first non-excluded B0 would have been.\r\n\r\nHowever, we've noticed that if it excludes the first B0 volume, the averaged B0 goes where the second B0 would have been (as expected above), BUT the gradient directions are written out with the B0 direction always associated with the first volume.\r\n\r\nTo illustrate, if our dataset was:\r\n\r\n    B0a   D0a D1a D2a D3a D4a D5a   B0b   D0b D1b D2b D3b D4b D5b\r\n\r\nIf no volumes were removed, then the resulting dataset would be:\r\n\r\n    B0   D0a D1a D2a D3a D4a D5a    D0b D1b D2b D3b D4b D5b\r\n\r\nwhere B0 is the average of B0a and B0b.\r\n\r\nHowever, if the B0a was excluded, then the output image data would look like this:\r\n\r\n    D0a D1a D2a D3a D4a D5a   B0b    D0b D1b D2b D3b D4b D5b\r\n\r\nBut the gradient directions in the .nrrd file would be written out as:\r\n\r\n    B0b   D0a D1a D2a D3a D4a D5a    D0b D1b D2b D3b D4b D5b\r\n\r\nNote that in this case there is only one B0 left so no averaging is done, but I suspect the same thing would happen if there were more than 2 concatenated runs.\r\n\r\nOne kludge, for subjects where this happens, is to have our users reverse the order of concatenation.  This is not an automated workaround, but gets some more data through the gauntlet.\r\n\r\nI looked at the source a while back (ca. v1.1.6) but was unable to pinpoint the place where the error was occuring.  If anyone has an idea how to fix this, or can point me in the right direction, our users would be very appreciative.  Thank you!"},"comment":{"url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/comments/163322747","html_url":"https://github.com/NIRALUser/DTIPrep/issues/9#issuecomment-163322747","issue_url":"https://api.github.com/repos/NIRALUser/DTIPrep/issues/9","id":163322747,"user":{"login":"SyamGadde","id":1247460,"avatar_url":"https://avatars.githubusercontent.com/u/1247460?v=3","gravatar_id":"","url":"https://api.github.com/users/SyamGadde","html_url":"https://github.com/SyamGadde","followers_url":"https://api.github.com/users/SyamGadde/followers","following_url":"https://api.github.com/users/SyamGadde/following{/other_user}","gists_url":"https://api.github.com/users/SyamGadde/gists{/gist_id}","starred_url":"https://api.github.com/users/SyamGadde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SyamGadde/subscriptions","organizations_url":"https://api.github.com/users/SyamGadde/orgs","repos_url":"https://api.github.com/users/SyamGadde/repos","events_url":"https://api.github.com/users/SyamGadde/events{/privacy}","received_events_url":"https://api.github.com/users/SyamGadde/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T16:55:03Z","updated_at":"2015-12-09T16:55:03Z","body":"That's a nice option to know about.  Thanks!\n\n\n________________________________\nFrom: Michael Harms <notifications@github.com>\nSent: Wednesday, December 9, 2015 11:40 AM\nTo: NIRALUser/DTIPrep\nCc: Syam Gadde\nSubject: Re: [DTIPrep] Incorrect gradient directions when B0 is not the first volume (#9)\n\n\nJust wanted to mention that another \"kludge\" for this particular bug is to just turn off the baseline averaging feature entirely. In that case, even if the first B0 is excluded, the gradient directions in the .nrrd file and the output image data still stay in correspondence. (Note though that one consequence of taking this approach is that if you are also using the \"eddymotion\" step, your reference image for eddy/motion correction will then be whatever the first, non-excluded image happens to be).\n\n-\nReply to this email directly or view it on GitHub<https://github.com/NIRALUser/DTIPrep/issues/9#issuecomment-163318358>.\n\n[https://avatars2.githubusercontent.com/u/1247460?v=3&s=400]<https://github.com/NIRALUser/DTIPrep/issues/9#issuecomment-163318358>\n\nIncorrect gradient directions when B0 is not the first volume · Issue #9 · NIRALUser/DTIPrep\nWe are using v1.2.4 of DTIPrep. Several of our users like to concatenate multiple DTI runs together. Generally each run consists of a single B0 volume followed by diffusion-weighted volumes, and ...\nRead more...<https://github.com/NIRALUser/DTIPrep/issues/9#issuecomment-163318358>\n\n"}}