Introduction

I have written a tcl script, ResultViewer.hx, based on work from Steffen Prohaska that allows

  1. visualisation in Amira of affine registered brains compared with a template
  2. selection of what kind of affine (9dof, ght etc)
  3. selection of a template brain (FC6475, FCWB)
  4. calculation of surface-based affine registration

There is also a related simpler script StackViewer which simply allows rapid scanning through a directory of confocal scripts.

Install

  1. You need the Amira mesh toolbox (on gjac or gj8c) or ZIB Amira for surface based affine registrations
  2. git clone git@bitbucket.org:jefferis/resultviewer.git somewhere sensible
  3. This also lives on JData here /Volumes/JData/JPeople/Steffen/2011-07-29_InitBrainPosGHT
  4. Make sure that you have a template brain called TemplateStem.surf in the hx subfolder
    1. use a downsampled brain to make this and aim for ~ 20k faces in the surface model

Configuring

  1. make downsampled versions of your images in a folder called images4um that is next to the folder containing registrations e.g.
    • MyBigRegistrationFolder
      • images4um
      • Registration
        • warp
        • affine
  2. Make a keylist file, a text file which contains the key for one brain per line
    1. TCL will look for the registration folders like this: ${refbrain}_${brainkey}_${chan}_${regtype}.list
    2. so make sure that the key corresponds to everything between the name of the refbrain and the channel
    3. so for a registration folder called IS2_AABD4-1_01_9dof.list the key would be AABD4-1
    4. the script currently assumes that the reference (nc82) channel will be channel 1
  3. Double click/drag and drop src/ResultViewer.hx onto Amira to get started
    1. This lives at /Volumes/JData/JPeople/Steffen/2011-07-29_InitBrainPosGHT/src/ResultViewer.hx if you are using the JData version.
  4. You will get a blue node in your object pool
  5. Click on it
  6. Choose the Reg root dir e.g. /Volumes/JData/JPeople/Aaron/YourRegistrationFolder/Registrations/IS2/Registration
  7. Choose the key list file e.g. /Volumes/JData/JPeople/Aaron/YourRegistrationFolder/Registrations/IS2/Registration/mynicebrains.txt
    1. the key list can be called anything and the location doesn't matter
  8. Choose your reg type e.g. 9dof or ght
    1. this must be eveything between the last underscore after the channel number and .list (${refbrain}_${brainkey}_${chan}_${regtype}.list)
  9. Choose your Ref Brain e.g. FCWB
  10. Tick Save registration at CMTK if you want to save in CMTK format
    1. if you want to use this as an initial affine registration (to feed into image based affine) then you should save as XXX_ght.list and use munger.pl's -H switch
    2. if you want to use this as an affine to pass to the warp program then you should save as XXXX_9dof.list

Resampling Brains

  • You should have some resampled brains as input
  • This script expects them to live in a folder called images4um (though you can choose any voxel size you want within reason)
  • Voxel dimensions in the range 2x2x2 um to 4x4x4 um are sensible
  • In R with AnalysisSuite you can use NrrdResample(<infile>,<outdir>,voxdims=c(2,2,2))
  • See using_showclones for a longer example

Selecting brains

  • move the brain num slider to move the brains in a list (FIXME there must be 2 or more at the moment)
  • Tick selected to choose a brain
  • Click SaveSelected button to save your selected brains
    • if your input was mynicebrains.txt this will make a file called mynicebrains.txt-sel.txt
    • if you already had a file called mynicebrains.txt-sel.txt it will make a backup called mynicebrains.txt-sel.txt.bak
    • if you already had a backup file called mynicebrains.txt-sel.txt.bak it will be overwritten
  • Save at least every few hundred brains (it seems to crash after ~ 1000)
  • If you want to restart with an existing selection click LoadSelected

Calculating Affine Registrations

If the existing registration is poor (or non-existent) you can often make a good one using Amira's surface based registration

  • Click SetupReg
  • a red surface model should appear
    • Turn off curbrainview (volume rendering) so you can see more clearly
  • Click on curbrain.surf
    • Click on the Transform editor (4th icon along)
    • Choose Manipulator … Tab Box
    • Make sure that you have the arrow selected (top left icon in viewer pane)
    • Drag the red surface model on top of your reference
    • Either click on curbrain.AlignSurfaces
      • choose Trafo rigid
      • Hit Surfaces
      • choose Trafo rigid + unifiorm scale
      • Hit Surfaces
      • choose Trafo affine
    • OR scale it using the green corners if the size is different
      • then click on curbrain.AlignSurfaces
      • choose Trafo affine
      • Hit Surfaces
    • You now have an affine that can be used to initialise either an image based affine or a warping registration
    • Go back to ResultViewer.hx
    • Hit SaveReg

ToDo

  1. Make affine directories if they don't exist (so that one can make surface based registrations from scratch)
  2. Add a surface for IS2
  3. make it possible to look at reformatted images directly (rather than applying registration to original image)
  4. resample images

Log In