Dear Leo,
There are two reasons for this non-zero value.
Firstly, is that FLIRT internally resamples the reference image unless
you tell it not to with the -noresample option.
Secondly, several cost functions (like the default one in flirt, which is
Correlation Ratio) are implemented with some speed ups which mean
that constant parts are not calculated, and so the value at the identity
transformation may not be zero.
If you use the default cost function used in *mcflirt* (-cost normcorr)
together with the -noresample option then you should get a zero result
with the identity matrix.
All the best,
Mark
On 16 May 2011, at 20:22, Yiou Li wrote:
> Dear Mark,
>
> Sorry for the late response.
>
> I tried your suggestion below on the mcflirt output images and I found that the cost value on the reference volume (vol0100 in this case) is not zero although the transformation matrix is identity, as shown below:
>
> flirt -in vol0100.nii.gz -ref vol0100.nii.gz -init vol_mcf.mat/MAT_0100 -schedule $FSLDIR/etc/flirtsch/measurecost1.sch
>
> 0.000970483 0.000000 -0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000
>
> Final result:
> 1.000000 0.000000 0.000000 0.000000
> 0.000000 1.000000 0.000000 0.000000
> 0.000000 0.000000 1.000000 0.000000
> 0.000000 0.000000 0.000000 1.000000
>
> Do you think the cost value should be zero in this case?
>
> I also checked the cost value of other volumes and they are distributed around 0.001 as shown below.
>
> Best,
> Leo
>
> For other volumes, the values is like:
> 0090 (volume #)
> 0.00125372 (cost value)
> 0091
> 0.00135988
> 0092
> 0.00133979
> 0093
> 0.00139797
> 0094
> 0.00139606
> 0095
> 0.00133246
> 0096
> 0.00128937
> 0097
> 0.00121671
> 0098
> 0.0011279
> 0099
> 0.00104415
> 0100
> 0.000970483
> 0101
> 0.00104493
> 0102
> 0.00102204
>
> On Tue, May 3, 2011 at 11:04 PM, Mark Jenkinson <[log in to unmask]> wrote:
> Dear Leo,
>
> There is no direct equivalent for mcflirt.
> However, you can use the output matrices from mcflirt
> and then use flirt (with the appropriate reference volume
> extracted from the timeseries) and get the cost value
> that way. This will be equivalent to the costs used inside
> mcflirt.
>
> All the best,
> Mark
>
> On 3 May 2011, at 22:57, Yiou Li wrote:
>
> > Dear Mark,
> >
> > Thanks for the confirmation!
> >
> > I am trying to pullout the cost value for mcflirt to check the quality
> > of motion correction. However, it seems there is no such an option for
> > mcflirt. Please kindly advise if there is a way to pullout the
> > information.
> >
> > Best,
> > Leo
> >
> >
> > On Mon, May 2, 2011 at 12:21 PM, Mark Jenkinson <[log in to unmask]> wrote:
> >> Dear Leo,
> >>
> >> Yes, the first number is the cost value.
> >> You can suppress the printing of the matrix by using the -omat
> >> option with a dummy name.
> >>
> >> All the best,
> >> Mark
> >>
> >>
> >> On 2 May 2011, at 20:16, Yiou Li wrote:
> >>
> >>> Dear Mark,
> >>>
> >>> Thanks very much for the detailed comments!
> >>>
> >>> Here is what I got by running flirt with the schedule file:
> >>>
> >>>>> flirt -in inputfile -ref $FSLDIR/data/standard/MNI152_T1_2mm_brain.nii.gz -init xmat_T1_to_MNI152_2mm -out test1 -schedule $FSLDIR/etc/flirtsch/measurecost1.sch
> >>>
> >>> 0.0669054 0.000000 -0.000000 0.000000 0.000000 0.000000 0.000000
> >>> 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000
> >>>
> >>>
> >>> Final result:
> >>> 0.971940 -0.035396 0.008270 -1.957650
> >>> 0.033794 0.891260 0.081227 -0.548800
> >>> -0.004905 -0.131739 0.998848 5.771490
> >>> 0.000000 0.000000 0.000000 1.000000
> >>>
> >>> I guess the first number in the first output row is the cost value,
> >>> please kindly confirm.
> >>>
> >>> Best,
> >>> Leo
> >>>
> >>>
> >>> On Sat, Apr 30, 2011 at 1:06 AM, Mark Jenkinson <[log in to unmask]> wrote:
> >>>> Dear Leo,
> >>>>
> >>>> This is a fairly standard question and the answer is that
> >>>> there is no good answer! The metrics you suggest in 1
> >>>> and 2 are flawed, as you pointed out. Using the same
> >>>> metric that the registration uses won't tell you much, as
> >>>> it is explicitly optimised by the registration method.
> >>>> However, you can get cost function values from FLIRT
> >>>> by using the schedule file: $FSLDIR/etc/flirtsch/measurecost1.sch
> >>>>
> >>>> This returns the cost for the given -init matrix (this matrix
> >>>> should be the output of the registration step you've run
> >>>> previously). It is difficult to interpret the cost function values
> >>>> when comparing different images, as there may be differences
> >>>> in the image intensities that modify the overall cost without
> >>>> necessarily affecting the accuracy of the registration.
> >>>>
> >>>> The best solution to assess the quality of the registration is
> >>>> to inspect the results by eye, or use manually placed landmarks
> >>>> and quantify the displacement errors of the landmarks after
> >>>> registration. There are quite a few papers dealing with the
> >>>> assessment of registration quality (often for comparing methods)
> >>>> which you can read more about if you are interested.
> >>>>
> >>>> All the best,
> >>>> Mark
> >>>>
> >>>>
> >>>> On 30 Apr 2011, at 00:24, Yiou Li wrote:
> >>>>
> >>>>> Dear FSLers,
> >>>>>
> >>>>> I want to assess the quality of the FLIRT registration of different T1
> >>>>> images to MNI152_T1 template. Could you please advise what is a good
> >>>>> numeric metric for the assessment?
> >>>>>
> >>>>> I am thinking of the following ones:
> >>>>>
> >>>>> 1. Sum of mean square error between the registered and the reference
> >>>>> image (this might not be a good one because I found the intensity
> >>>>> scales of the two images are quite different).
> >>>>>
> >>>>> 2. Determinant of the transformation matrix (I know this has been used
> >>>>> to evaluate local deformations, but large deformation could result in
> >>>>> good registration quality, so this metric is not relevant?)
> >>>>>
> >>>>> 3. The final cost function value obtained by FLIRT (corrate, mutual
> >>>>> information, etc.) However, flirt doesn't output this information, is
> >>>>> there easy way to get this value?
> >>>>>
> >>>>> Any comment on this will be appreciated.
> >>>>>
> >>>>> Leo
> >>>>>
> >>>>> PS. Congrats to new royal couple ^_^
> >>>>>
> >>>>
> >>>
> >>
> >
>
|