Algorithm
Let
and
be corresponding template
and target landmarks respectively. Find the rotation,
,
translation
, and scale
which minimize
Reference
S. Umeyama, "Least-Squares Estimation of Transformation Parameters Between
Two
Point Patterns".IEEE Transactions on Pattern Analysis and Machine
Intelligence, Vol 12, NO 4, April 1991.
(pdf)
The LDDMM-simlitude matching executable, named lddmm-similitude is a
program
to determine the similarity between two landmark data sets based on
rotation, translation, and scale. The program will write the scale
to standard out and create a file representing the transformed template.
Typical Usage and Parameters:
lddmm-similitude [OPTIONS] x_file y_file tx_file norm_constant [Rts_file]
The following are the command line options.
- x_file: the template landmark file
- y_file: the target landmark file
- tx_file: the output file containing the transformed template. Use /dev/null if this is not required.
- norm_constant: always use 1.0
- Rts_file: omit this option
- Options:
- -a --all-info: print data provenance info
- -x --all-info-xml: print data provenance info in an xml format
- -v --version: print program version information
Landmark File Format:
The format for a 2-D landmark file is as follows:
N x 2
[ x_0 y_0
x_1 y_1
.
.
x_N y_N ]
|
And for a 3-D file:
N x 3
[ x_0 y_0 z_0
x_1 y_1 z_1
.
.
x_N y_N z_N ]
|
Scripting:
Here is an example Perl script that computes the similarity for every pair of landmark sets in start_folder and writes the output line by line to a text file for later analysis. This can easily be adapted to do different comparisons (ex. left & right data separately) by calling the function do_sims on a number of different lists:
#!/usr/bin/perl
$program = "lddmm-similitude";
$start_folder = "/cis/project/botteron/hippocampus/Converted_Lmk";
@inlist= `ls -1 $start_folder/*.lmk`;
$outfile = "/cis/project/botteron/hippocampus/left_scale_list.txt";
&do_sims ($infile, \@outlist);
sub do_sims {
my $outfile = shift;
my $list_ref=shift;
my @list = @$list_ref;
print "$outfile\n";
print "List size: $#list\n";
for($i=0; $i<=$#list; $i++) {
chomp $list[$i];
$list[$i] =~ /^.+\/(.+)/;
$shortlist[$i] = $1;
}
open OUT, "> $outfile";
for($i=0; $i<=$#list; $i++) {
for($j=$i+1; $j<=$#list; $j++) {
$sim = `$program $list[$i] $list[$j] /dev/null 1.0 | cut -f3 -d\\ `;
print OUT "$shortlist[$i]:$shortlist[$j]:$sim";
}
print "Finished $shortlist[$i]\n";
}
close OUT;
}
Software developed with support from National Institutes of Health NCRR grant P41 RR15241.
Last Modified: Monday, 08-Jan-2007 10:27:13 EST