open-discussion
open-discussion > RE: DTIPrep problem with b=0 not in first vol
Dec 7, 2017 05:12 PM | Martin Styner
RE: DTIPrep problem with b=0 not in first vol
There are probably better ways to do this, but I would do it as
follows:
Use "unu crop" 3 times to make 3 DWI parts:
a) the DWI's before b=0
b) the b=0 DWI
c) the DWI's after b=0
Assuming that the 4th axis is where your DWI images are indexed in the 4D DWI volume, this would look like, and 30 is the index of your b=0 DWI (starting index 0):
unu crop -i yourfile.nrrd -o part1.nrrd -min 0,0,0,0 -max M,M,M,29
unu crop -i yourfile.nrrd -o part2.nrrd -min 0,0,0,30 -max M,M,M,30
unu crop -i yourfile.nrrd -o part3.nrrd -min 0,0,0,31 -max M,M,M,M
Then use unu join to put these back together
unu join -i part2.nrrd part1.nrrd part3.nrrd -o joined.nrrd
Now, you will have to go end exit the nrrd header to change the informaiton of the gradients in the header (move the 30th diretion to the 0th and update all direction numbers).
I know that's quite ugly, there may be simpler/more elegant solutions out there.
Martin
Use "unu crop" 3 times to make 3 DWI parts:
a) the DWI's before b=0
b) the b=0 DWI
c) the DWI's after b=0
Assuming that the 4th axis is where your DWI images are indexed in the 4D DWI volume, this would look like, and 30 is the index of your b=0 DWI (starting index 0):
unu crop -i yourfile.nrrd -o part1.nrrd -min 0,0,0,0 -max M,M,M,29
unu crop -i yourfile.nrrd -o part2.nrrd -min 0,0,0,30 -max M,M,M,30
unu crop -i yourfile.nrrd -o part3.nrrd -min 0,0,0,31 -max M,M,M,M
Then use unu join to put these back together
unu join -i part2.nrrd part1.nrrd part3.nrrd -o joined.nrrd
Now, you will have to go end exit the nrrd header to change the informaiton of the gradients in the header (move the 30th diretion to the 0th and update all direction numbers).
I know that's quite ugly, there may be simpler/more elegant solutions out there.
Martin
Threaded View
| Title | Author | Date |
|---|---|---|
| Giuseppe Cabras | Dec 5, 2017 | |
| Martin Styner | Dec 5, 2017 | |
| Giuseppe Cabras | Dec 6, 2017 | |
| Martin Styner | Dec 7, 2017 | |
