[Mrtrix-discussion] Re: ignoreslices AND coregister

Jacques-Donald Tournier d.tournier at brain.org.au
Sun Jul 27 19:42:35 PDT 2008


Hi Samuel,

To answer your first question: I guess you've just found a bug. I've
attached a patch to allow dwi2tensor to accept multiple -ignoreslices
options. 

To apply the patch, find the "cmd/dwi2tensor.cpp" file in the folder you
originally extracted (i.e. "mrtrix-0.2.3"), replace it with the new
version attached, and issue the "./build" command again. Once it has
been recompiled, you can copy/paste the new "bin/dwi2tensor" executable
file over to your current installation (probably in "/opt/mrtrix/bin" if
you've followed the instructions in the documentation). Let me know if
you have any problems, and if it actually works...


You second question is a little bit trickier. I've had a go at
performing the realignment using SPM2. One of the problem is that SPM
stores the transform information in a separate .mat file, which MRtrix
can't access (it's stored using Matlab's own binary format). If you
convert the .mif image files (where the transform is stored in the
header) into Analyse (which doesn't store any transform information),
you will loose the information about how the two images relate to each
other. So if you display them in SPM, they'll probably be completely
misaligned.

Once you've realigned them together, the information about the
realignment is stored in the new .mat file. At this point, I'll need to
figure out how to apply this transform properly to one of the
original .mif files. It shouldn't be too hard, but there are a couple of
steps to get right. For one, the actual information stored in the SPM
transform matrix is slightly different to that expected by MRtrix. Also,
I need to take into account the fact that the SPM transform maps between
the two images assuming the initial default transforms assigned by SPM,
rather than the transforms actually stored in the original .mif files.
So it's not completely straightforward, but I'm working on it.

Realigning with FLIRT might be slightly more straightforward, since the
FSL transform matrix is in the same format as the MRtrix one (as far as
I remember). But it will still require a fair bit of playing around...

Cheers!

Donald.


On Sat, 2008-07-26 at 14:05 +0200, "Samuel Gröschel" wrote:
> Hi Donald,
> 
> With some delay I am back in your wonderful MRtrix and have again some beginners questions.
> 
> 1. I would like to discard some slices with artefacts from my analysis. The command "dwi2tensor" makes this possible with the option "-ignoreslices" as I can see in the documentation. First part of the question is how many slices can I discard in order for the following analyses to run smoothly? Second part is the error message I get when I want to discard more than one slice. E.g. when entering
> 
> dwi2tensor dwi.mif dt.mif -ignoreslices 0 36 -ignoreslices 1 6,8,57
> 
> I get the message "dwi2tensor: multiple instances of option "ignoreslices" are not allowed"
> 
> What did I do wrong?
> 
> 2. The other question I have is about realigning the anatomical image (3dflash) to the diffusion images. This would be important in order to define seed and target regions more accurately and also to overlay tracks on the anatomical image. Unfortunately the anatomical image is not in the same spatial dimension (subject probably moved between the scans). As you said, in theory it should be possible to coregister the anatomical image to the b0 image. B0 can be obtained by the following command:
> 
> mrconvert dwi.mif -coord 3 0 b0.img
> 
> First thing I realised is that when transforming the ".mif"-images to the analyse-format (img/hdr) using "mrconvert" the mif and img images appear in a slightly different position on "mrview". Therefore the tracks can only be overlayed correctly onto mif-files.
> 
> I tried coregistering the anat.img to b0.img in SPM. Unfortunately both images had not the same voxel positions in z-dimension using the display function in SPM. Could it be due to the fact that in the b0-image brain stem and inferior part of cerebellum is cut off? I also tried with FLIRT (fsl) but without success so far. What would you recommend? Do you have experience with coregistering using flirt in that case?
> 
> Thanks for your help and best regards,
> 
> Samuel
-- 
Jacques-Donald Tournier (PhD)
Brain Research Institute, Melbourne, Australia
Tel: +61 (0)3 9496 4078
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dwi2tensor.cpp
Type: text/x-c++src
Size: 5524 bytes
Desc: not available
Url : http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20080728/aef3fe1c/dwi2tensor.bin


More information about the Mrtrix-discussion mailing list