Hi,

Our recommendation would be to not use a mask or have to do segmentation (for the registration).  Sometimes these may help, in special circumstances, but in general there is no need to use them.  You will need a segmentation to make your grey matter mask, but you shouldn't need that mask for the segmentation.

I can't help any more until you tell me more about what steps of your registration pipeline are working well or not working well.  You need to look at the outputs from the different stages and tell us about them.

All the best,
Mark



On 9 Jan 2014, at 17:35, Bedda Rosario <[log in to unmask]> wrote:

Hello, 

Thank you Mark for all your comments and suggestions.

This pipeline was based on a manuscript that I found.  The manuscript states the following

"For each subject, the b0 image was aligned to the T1-weighted image with affine registration, and the T1-weighted image was subsequently aligned to the MNI152 template using FNIRT, where the reference-weighing mask including the subcortical gray matter and brainstem was used. This reference-weighing mask was applied in order to obtain accurate registration of the region."

Since I am interested in gray matter mean diffusivity, I need to apply some type of gray matter mask to the mean diffusivity images.

I would like to know what usually is recommended
1) should I create a gray matter mask for each image and use the -inmask option during fnirt?  If so, any recommendations on how to do this?
2) should I perform segmentation on the T1-weighted and use it during the fnnirt step using -refmask?

I sent an email to the corresponding author for more details but I would like to know if anyone can provide help on this.

Thank you, 
Bedda


On Sun, Dec 15, 2013 at 5:02 PM, Mark Jenkinson <[log in to unmask]> wrote:
Hi,

It is hard to know what is wrong here without having more information about which stage causes good and bad registrations.  You should look at the results from each stage (e.g. the output image compared to the reference image) to see where the problem lies.  However, you are correct that we normally recommend using the skull-stripped versions of the individual image and MNI images in the flirt stage, but not in the fnirt stage (where you should use both images without any skull-stripping).  

All the best,
Mark


On 11 Dec 2013, at 06:28, Bedda Rosario <[log in to unmask]> wrote:

Hi Mark,

I tried your suggestions but still getting no good registration.  This is what I ran


$FSLDIR/bin/flirt -in 5104_avgboraw.nii -ref 5104_mprage.nii -omat flirtbompragemat_5104.mat -out flirt5104_bomprage -dof 6

$FSLDIR/bin/flirt -in 5104_mprage.nii -ref MNI152_T1_2mm.nii -omat flirtmprageMNImat_5104.mat -out flirt5104_mprageMNI

$FSLDIR/bin/fnirt --ref=MNI152_T1_2mm.nii --in=flirt5104_mprageMNI.nii --aff=flirtmprageMNImat_5104.mat --config=T1_2_MNI152_2mm.cnf --iout=fnirt5104_mprageMNI --cout=fnirtcout_5104 --fout=fnirtfout_5104 --jout=fnirtjout_5104 --intout=fnirtintout_5104 --logout=fnirtlogout_5104

$FSLDIR/bin/applywarp --ref=MNI152_T1_2mm.nii --in=5104_MD.nii --out=5104_MDinMNI  --premat=flirtbompragemat_5104.mat --warp=fnirtcout_5104


Is it because I am using the MNI with the skull?

I appreciate your help.

Thanks,
Bedda


On Sun, Dec 8, 2013 at 6:10 PM, Mark Jenkinson <[log in to unmask]> wrote:
Hi,

The general approach is right, but there are a few problems with the implementation.

a) you should always use a config file with fnirt (e.g. T1_2_MNI152_2mm.cnf in your case)

b) you also need to include the flirt matrix result (T1 to mprage) in the call to fnirt (with the --aff option)

c) the applywarp command is wrong - you do not need to include the matrix from the T1 to MNI (as this is contained in the warp output from fnirt) but you must include the matrix from the first step (the b0 to mprage result) as the premat

d) you should use 6 DOF in the first step, as it is within-subject

All the best,
        Mark


On 5 Dec 2013, at 20:30, Bedda Rosario <[log in to unmask]> wrote:

> Hello,
>
> I am trying to do some voxel based analysis for gray matter mean diffusivity.  Therefore. I need to register the mean diffusivity image to the MNI template.  I tried the following for one subject, however, results don't look good.
>
> Here it is what I did
>
> 1. register the b0 to the mprage using flirt.  The b0 and MD images are in the same space
> 2. register mprage to MNI using flirt
> 3. non linear registration, mprage to MNI using fnirt
> 4.  apply the parameters from 3 to the MD images
>
> $FSLDIR/bin/flirt -in 5104_avgboraw.nii -ref 5104_mprage.nii -omat flirtbompragemat_5104.mat -out flirt5104_bomprage
>
> $FSLDIR/bin/flirt -in 5104_mprage.nii -ref /usr/local/fsl-4.1.4/data/standard/MNI152_T1_1mm.nii.gz -omat flirtmprageMNImat_5104.mat -out flirt5104_mprageMNI
>
> $FSLDIR/bin/fnirt --ref=/usr/local/fsl-4.1.4/data/standard/MNI152_T1_1mm.nii.gz --in=flirt5104_mprageMNI.nii --iout=fnirt5104_mprageMNI --cout=fnirtcout_5104 --fout=fnirtfout_5104 --jout=fnirtjout_5104 --intout=fnirtintout_5104 --logout=fnirtlogout_5104
>
> $FSLDIR/bin/applywarp --ref=/usr/local/fsl-4.1.4/data/standard/MNI152_T1_1mm.nii.gz --in=5104_MD.nii --out=5104_MDinMNI --warp=fnirtcout_5104  --premat=flirtmprageMNImat_5104.mat
>
> Is this approach correct?  Any suggestions?
>
> Thank you,
> Bedda