Hi Clare,
To try and make a more restricted mask I would do the following:
fslmaths aparc+aseg -bin segmask
flirt -applyxfm -init flirtinverse.mat -in segmask -ref FA.nii.gz -out resamp_segmask
fslmaths resamp_segmask -thr 0.3 -bin -mul aparc+asegtoFAinvflirt new_aparc+asegtoFAinvflirt
assuming you used the name aparc+asegtoFAinvflirt as the output of your current resampling.
The tricky bit will be to see if the 0.3 is a "good" value for this. The smaller you make this
value the thicker the result will be. The larger you make it, the more likely you will get holes in it!
So I'm hoping that 0.3 would be a good compromise, but I can't think of a good way of ensuring
that you get the best of both worlds. You'll just have to try some different values and see how
you get on.
All the best,
Mark
On 14 Mar 2012, at 11:59, Gibbard, Clare wrote:
> Hi Mark,
>
> Thank you for your email. I've tried dilating the aparc+aseg file and re-running the final flirt resampling with the extended output image as you suggested. It seems to work well and I don't have the gaps I was seeing previously, which is great.
>
> I'm planning to use the resampled regions for tractography so am less concerned about the cortical thickening than I would be if I was looking at measuring precise thicknesses etc. But I would like to try creating a mask and thresholding it to see what difference it makes. Please would you be able to give me a few more details on this? It would be a great help. Thank you very much.
>
> Best wishes,
> Clare
>
> ------------------------------
>
> Date: Tue, 13 Mar 2012 17:57:49 +0000
> From: Mark Jenkinson <[log in to unmask]>
> Subject: Re: problem using flirt to register aparc+aseg from freesurfer to diffusion space
>
> Hi Clare,
>
> I'm guessing that this is an issue caused by the cortical folding making some voxels in the
> FA closer to non-labelled ones (the image didn't come through as anything except the
> tiniest attachments are not allow on the list). My recommendation would be to make a
> version of your input label image which just extends the labels a little into the unlabeled
> space (where it current has zeros) but doesn't change the labelling elsewhere. This will
> thicken your cortex, which could be a problem, depending on what you are doing, but
> would solve this issue of gaps. To do this extension of the labels just run:
> fslmaths aparc+aseg.nii.gz -dilD extended_aparc+aseg
> or even
> fslmaths aparc+aseg.nii.gz -dilD -dilD extended_aparc+aseg
> for a 2-voxel extension.
> Once this is done, just use the output image as the input for the final flirt resampling.
>
> If you are very concerned about the cortical thickening that this creates then you could
> create a mask that gave effective partial volume and then threshold this. If you want
> more details on this just reply to this email and ask for them.
>
> All the best,
> Mark
>
>
> On 12 Mar 2012, at 19:53, Gibbard, Clare wrote:
>
>> Hi,
>>
>> I am trying to register my aparc+aseg T1 parcellation from FreeSurfer T1 space to diffusion space using flirt. The registration seems to work ok except that gaps have appeared in the parcellation where they weren't there in FreeSurfer space (see the picture below for an example of the empty voxels). Are there any options I can apply to flirt in order to prevent these gaps or fill them in? I have tried following flirt with fnirt and got similar results.
>>
>> I have pasted my scripts and a screenshot below. I really appreciate any guidance. Thank you.
>>
>> Best wishes,
>> Clare
>>
>> Scripts - I ran flirt FA to FreeSurfer T1 followed by the inverse (FreeSurfer T1 to FA) and then applied the inverse to the FreeSurfer T1 and aparc+aseg files:
>> flirt -in FA.nii.gz -ref FreeSurfer_T1_bet.nii.gz -out FAtoT1flirt.nii.gz -omat FAtoT1flirt.mat -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12 -cost normcorr -minsampling
>> convert_xfm -omat flirtinverse.mat -inverse FAtoT1flirt.mat
>> flirt -applyxfm -init flirtinverse.mat -in FreeSurfer_T1_bet.nii.gz -ref FA.nii.gz -out T1toFAinvflirt.nii.gz
>> flirt -applyxfm -init flirtinverse.mat -in aparc+aseg.nii.gz -ref FA.nii.gz -out aparc+asegtoFAinvflirt.nii.gz -interp nearestneighbour
>>
>> Screenshot:
>>
>
>
>
|