I hadn't forgotten your email, I just needed time to make a schedule
file to do what you wanted.
There are three things you need in the schedule file:
measurecost (which you had) , printparams and setscale commands
Flirt (at present) requires all the scales to be stepped through
sequentially in order to generate the appropriate reference and input
images internally. Hence you need setscale for 8 then 4 then 2 then 1.
I'm attaching my schedule file (showcost) which printed the correct cost
function measurement for me. You need to use it in registration
mode, rather than applyxfm mode. For example:
flirt -in epi -ref highres -schedule showcost -init epi2out.mat -omat
where epi2out.mat is the previously generated registration matrix,
and -omat /dev/null is just used to junk the printing out of the final
matrix (which of course is just the same as the -init in this case).
Let me know if you have any trouble with this.
All the best,
Martin Kavec wrote:
>I apologize for reposting my question, but I am afraid it got lost in a forked
>I am trying to compare effect of brain extraction (BET) and more importantly
>RF bias field correction (FAST) on accuracy of rigid body registration of my
>I would like to compare cost function (normalized mutual information) values
>if I apply different transformation matrices to input image. I think that I
>can get the cost function value from flirt using "-verbose x" command line
>option. Example of output is as follows and the value is above "^^^^".
>7 : -1.1338 :: 0.852393 0.00369968 0.0853298 62.6364 69.734 -21.1884
>I get transformations by registering reference and processed input images.
>Since I can not compare the last value of cost functions from processed input
>images, I want to apply the transformation matrix (-applyxfm) to un-processed
>input image. However, using both "-verbose x" and "-applyxfm" options I am
>not getting cost function value.
>I tried to use "-init my.mat" option and modified schedule file with 1mm scale
>and hoped to get the value with "measurecost", but it doesn't work.
>I have been able to perfectly register horriblly looking interventional MR
>images using FSL, while other registration tools (Analyze, ITK, SPM) failed
>badly. The neurosurgeons like my results a lot. I would be grateful for any
>help on how to get the cost function value.
# 8mm scale
# 4mm scale
# 2mm scale
# 1mm scale
setoption smoothing 1
setoption boundguess 1
setrow UF 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
measurecost 12 UF:1 0 0 0 0 0 0 abs