When you use the simple RegistrationRunner.app gui it makes a subdirectory in your main registration directory called commands. Whenever you start a new job it saves a .command file in this directory. This file contains the actual commandline that is used to invoke the registration software. There are 3 layers:

  1. Registration gui (RegistrationRunner.app, written by Greg)
  2. command line wrapper script (munger.pl, written by Greg)
  3. core registration tools (registration, warp …, written by Torsten Rohlfing)

These .command files call munger.pl, which then calls the core tools that actually do the heavy lifting.

You can open these in a text editor to slightly modify the commands, or double click them to re-run the command (a new Terminal window will open.

Here is an example. Note the use of '\' to split long lines.

#!/bin/sh
# 2008-11-17 19:21:52 GMT
cd "/Volumes/GJ8CHD/JPeople/Sebastian/fruitless/Registration/Job1" \
"/Applications/IGSRegistrationTools/RegistrationRunner.app/Contents/Resources/munger.pl" \ 
-b "/Applications/IGSRegistrationTools/RegistrationRunner.app/Contents/Resources" \
-awr 0102 -v -L -T 2 -s "refbrain/T1.PIC" "images"

This can be explained as follows:

  • change directory to the required working directory
  • call munger
  • specifying a location for the core registration binaries [-b]
  • run [a]ffine and [w]arp
  • [r]eformat channels 1 and 2
  • be [v]erbose
  • find initial affine transform using [L]andmarks
  • use 2 threads [-T] (can be up to the same as the number of cores in your machine)
  • -s = reference brain
  • images directory.

Here's another:

cd "/Volumes/GJ8CHD/JPeople/Sebastian/fruitless/Registration/Job1"
"/Applications/IGSRegistrationTools/RegistrationRunner.app/Contents/Resources/munger.pl" \
-b "/Applications/IGSRegistrationTools/RegistrationRunner.app/Contents/Resources" \
-a -r 01 -l a -s "refbrain/T1.PIC" "images"

This one:

  • only runs the [a]ffine registration
  • [r]eformats channel 01 …
  • and does the reformatting for the [a]ffine registration [l]evel

The full command line options for munger.pl are:

Usage: ./munger.pl [OPTIONS] <PICFILE/DIR> [<PICFILE2/DIR2> ...]
Version: 1.17

	-h print this help
	-v verbose (provide extra feed back at runtime)
	-t test run (no commands are actually run)
	-g debug: prints every command run by myexec and the return value
	-p make a scriPt from commands that would be run 
	   (nb cannot produce commands that depend on earlier commands)
	-u statUs - display number of images, registrations etc
	-z turn gzip off (on by default)
	-k lock message ie contents of lock file (defaults to hostname:process id)
	-m maximum time to keep starting registrations (in hours, default 8760=1y)
	   nb this will not stop any running registrations
	-x [never|only|any]:[truncate|delete] Clear input images when done.
	   default is never, eg only:truncate, any:delete
	   only => only the job that runs reformat can clear input
	   any  => any job can delete; in fact a job started with any will not
	           reformat at all. This is useful because you can run a cleanup
               job if it becomes clear that you are running short of space.
	   truncate => leave a 0 length file with same mtime as original image

	-a run affine transform
	-w run warp transform
	-c [01|02|..] channels for registration (default 01 or "")
	-r [01|02|..] run reformat on these channels
	-l [p|a|0..9|f] run reformat on these levels
	   (default f=final warp, p=principal axis, a=affine, 0..9=warp intermediates)
	-f [01|02|..] channel of the images used for registration - default is 01

	[nb use -f to specify the channel of the images that were previously used to
	 generate a registration if you now want to reformat a different channel using
	 that registration information]

	-i register brain to itself if possible (default is to skip)
	-0 Don't output intermediate warp registration levels

	-s [file|fileStem] Reference brain (average e-2 by default)
	-b [path] bin directory
	-d [stem] registration subdirectory (default ./Registration)
	   [nb if this begins in a dot then the value will be appended to both
	   reformatted and Registration directories]
	
	-e File ending of input images (pic, nrrd, nhdr)
	-o File ending of output images (bin, nrrd, nhdr) - defaults to torsten raw bin

	-P find initial affine transform using image principal axes
	-L find initial affine transform using landmarks
	-I inverse consistent warp weight (--ic-weight) default 0, try 1e-5
	-E [energy] energy of warp transform (default e-1)
	-X [exploration] (default 16)
	-M [metric] (default 0 (NMI), options 1=MI)
	-C [coarsest] (default 4)
	-G [grid-spacing] (default 40)
	-R [refine] (default 3)
	-J [0 to 1] jacobian-weight volume constraining param (default 0)
	-T [threads] (default auto)
	
	-A [option] additional options for affine transformation
	-W [option] additional options for warp transformation
  
Munge a BioRad PIC file or (recursively) parse a directory of PIC files
by running the affine and warp registrations and reformatting images
as required.  Final argument must be the images directory or a single image.

Log In