[url]Import Siemens MGH DTI

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
Guidon
Posts: 23
Joined: Fri Mar 25, 2005 9:34 pm
Location: Rochester, New York, USA
Contact:

[url]Import Siemens MGH DTI

Post by Guidon »

Hi all,

Hubert Fonteijn already posted a message last july about importing Siemens DTI in Brainvisa. I downloaded the latest BV1.6.3 and I didn't find the appropriate process in Data management/import/diffusion.

:?: So my first question is... Has anybody already done it?
If not I would like to create the import sequence; I don't know if I'm good in Brains but I'm definitely good in Visas... This will be good practice for the bv newbie that I am.

To start with, I copied ImportGems.py into ImportSiemensMGH.py. Then I created a Siemens-specific file with the gradients ranging from 13 to 99 directions. Please note that this file contains the gradients for the MGH(Massashussets General Hospital) DTI sequence which is what we are using on our scanner instead of he default gradients provided by Siemens. If you are using the MGH DTI sequence you can download the 2 files HERE.

I tested the process by giving as input the first dicom file of the folder containing the b0 and all the raw dwi (36 directions x 32 slices). These dicom slices are numbered from bottom to top in increasing order. I was pleased to find out that selecting only the first file would automagically load all of them at once and then create a distinct b0 file and a 4D volume. Unfortunately the coronal and sagittal views appeared upside-down.
:?: Hopefully brainvisa has some handy tools to reorient data. If true, I would be glad to hear from them...

As a workaround I converted the whole dataset into a 4D analyze volume and ran ImportSiemensMGH on it. The orientation looked ok so I went ahead and applied the DTI pipeline. I had to adjust the threshold in the component "T2 Brain Mask" because the default 350 was way too stringent for my data. I chose a linient threshold of 50 and obtained a nice FA image.

Eventually I would like to improve the importation of Siemens-MGH data by loading at once the dicom raw data in the proper orientation. I would certainly welcome your comments. Thank you!
Kind Regards,

Arnaud Guidon, Rochester NY
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi,

I don't know for Siemens diffusion images, I can only answer for the images orientation issue:
Many of our reading/writing tools don't really handle image orientation at the moment. Except for SPM/Analyze format where we have done some efforts to conform more or less to what people expect compared to SPM (more or less because the orientation is actually not written in SPM images), we always assume that images are in the orientation of our internal coordinates system... Read http://brainvisa.info/doc/html/aims/en/ ... tials.html to get a better idea of what is going on.
In the future (but not in the next version) we hope we will be able to conform to orientations provided in some image formats (when it is provided: I don't even know if the Dicom format does or not), but for now, data is read in the slice files order (generally corresponding to the acquisition orientation).

It is always possible to reorient the images afterwards as long as you know their initial orientation.
There is no such general reorientation tool in Brainvisa (at least, not yet), but there is something for anatomical T1 images (the "PrepareSubject" process), and commandlines can be used to do the job Brainvisa does not:
AimsFlip performs simple flips along specified axes
Otherwise, AimsLinearResamp (renamed AimsResample in the development version) applies any transformation matrix to a volume: it is a bit more complex because you have to generate such a matrix, but also more general: it can perform complex flippings, rescalings, rotations etc.

Denis
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Post by Yann Cointepas »

Hi Guidon,

There is no BrainVISA process to import Siemens diffusion data yet. I really appreciate your effort for writing such a process.

As Denis said, the image orientation issue should be managed at DICOM reader level. However, it will take time before it is done. In the mean time, I could write a reorientation BrainVISA process that coul be used either in the import process or directly by the user. The main drawback of this approach is that it will require to read the diffusion data twice: once for creating t2 and dw volumes and once for reorientation.

The T2 mask extraction method is really rough (lack of time to make a better one). However, the way the threshold is computed has changed in the developpement version. Threshold is now expressed as percentage of T2 dynamic (0% means threshold=minimum T2 value, 100% means threshold=maximum T2 value).
Guidon
Posts: 23
Joined: Fri Mar 25, 2005 9:34 pm
Location: Rochester, New York, USA
Contact:

Post by Guidon »

Thanks Yann and Denis,

I am trying to get the development version to work so that I can use the latest command lines including AimsFlip.

I thought I was done with the import but my first tracking results proved me wrong: the fibers don't seem to be oriented properly which sends me back to the referential issue. I am totally aware that brainvisa works with Left+ Posterior+ Inferior+ data but I would like to know whether you apply any transformation to the gradient file (GEMS...), or at least in which referential is this file written, so that I can check the validity of my Siemens file ...?

Thanks a lot!

Arnaud
Kind Regards,

Arnaud Guidon, Rochester NY
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Be careful, the versions you indicate in your other message are not the development versions... Development ones are not numbered but are the tarballs in *-main.tar.gz.
Denis
PeterK
Posts: 45
Joined: Fri Mar 05, 2004 3:18 pm

Re: [url]Import Siemens MGH DTI

Post by PeterK »

Guidon wrote:Hi all,
:?: So my first question is... Has anybody already done it?
If not I would like to create the import sequence; I don't know if I'm good in Brains but I'm definitely good in Visas... This will be good practice for the bv newbie that I am.
I've done. It is quite easy. Are you refering to the mosaic format?

I've pretty much done it the same way you've stated and it worked just fine.
Guidon
Posts: 23
Joined: Fri Mar 25, 2005 9:34 pm
Location: Rochester, New York, USA
Contact:

Re: [url]Import Siemens MGH DTI

Post by Guidon »

PeterK wrote: I've done. It is quite easy. Are you refering to the mosaic format?

I've pretty much done it the same way you've stated and it worked just fine.
I was refering to the specific orientation set from Siemens which to my understanding differs from GE. Siemens is posterior first, left first, superior first. As a result, the images are loaded upside down in anatomist. I don't know if you had to deal with it when you tried to import mosaics. I used AimsFlip to do flip the images in the z direction.

With the MGH DTI taskcard, images are output in mosaic formats only when the number of directions is greater than about 60. Right now I am using 36 directions so my dwi output is a list of single files. The process I wrote works well enough for my needs but I would welcome to have a look at your mosaic version as I may improve my DTI acquisition protocol soon.
Thanks.
Kind Regards,

Arnaud Guidon, Rochester NY
Guidon
Posts: 23
Joined: Fri Mar 25, 2005 9:34 pm
Location: Rochester, New York, USA
Contact:

Post by Guidon »

Yann Cointepas wrote:As Denis said, the image orientation issue should be managed at DICOM reader level. However, it will take time before it is done. In the mean time, I could write a reorientation BrainVISA process that coul be used either in the import process or directly by the user. The main drawback of this approach is that it will require to read the diffusion data twice: once for creating t2 and dw volumes and once for reorientation.
After applying AimsDiffusionConcatenation to the list of raw dicom files,
I used AimsFlip to flip the T2 and dw volumes according to the z axis. The only problem is that the output files don't contain the gradient infos. As a consequence I'm having trouble down the road:

Code: Select all

AimsDiffusionFixedDTModel: b-value(s) are missing in header.: Cannot build b-values. Try to check input image header; some information may be missing.  
Is there a command I can use to tweak the image header and reprogram the same as what AimsDiffusionConcatenation was doing or shall I concatenate the T2 and dw after they've been flipped and try applying AimsDiffusionConcatenation? I'll eventually find a way to do it but your experience might help me do it faster and more properly. Thank you for your suggestions.
Kind Regards,

Arnaud Guidon, Rochester NY
Guidon
Posts: 23
Joined: Fri Mar 25, 2005 9:34 pm
Location: Rochester, New York, USA
Contact:

Post by Guidon »

Ok there is no problem anymore. AimsFlip does not copy the diffusion-related attributes into the output minf file. I should be able to use setMinf() or other to do so.
Kind Regards,

Arnaud Guidon, Rochester NY
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Post by Yann Cointepas »

I corrected AimsFlip to keep the properties of the source image. This bug correction will be in the next release.
Post Reply