Center for Imaging Science : About | Research | Publications | Education | Activities | Downloads | Visiting

BIRN Header home

Software @ CIS : lddmm-similitude


Algorithm

Let $x_1, ... , x_N$ and $y_1, ... , y_N$ be corresponding template and target landmarks respectively. Find the rotation, $R$, translation $t$, and scale $s$ which minimize

\begin{displaymath}
\sum_{i=1}^N \vert\vert y_i-sRx_i-t\vert\vert^2.
\end{displaymath}

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.

  1. x_file: the template landmark file
  2. y_file: the target landmark file
  3. tx_file: the output file containing the transformed template. Use /dev/null if this is not required.
  4. norm_constant: always use 1.0
  5. Rts_file: omit this option
  6. Options:
    1. -a --all-info: print data provenance info
    2. -x --all-info-xml: print data provenance info in an xml format
    3. -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

NIH                    NCRR                     DHHS                      TeraGrid


 
 




301 Clark Hall
3400 N. Charles Street
Baltimore, MD 21218
Office: (410) 516-3826
Fax: (410)516-4594
webmaster@cis.jhu.edu