users > Unit for registration
Showing 1-8 of 8 posts
Display:
Results per page:
Dec 19, 2016  12:12 AM | Dan Xie - UCSF
Unit for registration
Hi Developers and Advanced Users,

I have a question regarding units of the images --- I got fluorescent image stacks from a light-sheet microscope and the FOV is ~ 600 microns. When saving the images as .nrrd files, I selected micron as the length unit. However, in the user guide, I see that the --grid-spacing option in the warp tool has a unit of mm (or is it just a number ?). Should I change my image metadata to replace micron units with mm, or I can just use it as it is? Thanks!


Best,
Dan
Dec 19, 2016  07:12 AM | Greg Jefferis
Unit for registration
CMTK ignores units. So long as your image data and the parameters you set have values that are consistent with your implicit units, you will be fine. So there is no need to resave.

Just set the grid spacing to values that are consistent with your FOV and the degree of warping that may be necessary. I would imagine that an initial spacing of order 100 and final spacing of 10 might be plausible - normally they are powers of two so perhaps 128 ... 8. Torsten is the expert on that of course and it is specimen dependent.

Best,

Greg.

Dec 19, 2016  05:12 PM | Dan Xie - UCSF
RE: Unit for registration
Thanks Greg! I was wondering what is the normal computational time for warping --- I cropped out two small stacks of image to test the warping tool,  each stack is ~ 28 MB (500* 500*50 pixels). This does not seem a very intensive job, but it took over 7 hours on my laptop to finish a warping job with grid size. The affine registration took only ~ 3 minutes though. Did I do anything wrong?

P.S. my imaging samples are larval zebrafish brains with GCaMP6s expressed in neuronal nuclei.

Best,
Dan
Dec 19, 2016  11:12 PM | Greg Jefferis
RE: Unit for registration
7 hours is certainly long for a volume of that size. Are you setting the step size and accuracy parameters? You can spend a lot of time trying to over-optimise the highest resolution (i.e. smallest step size) at the end of the registration.

See:

* http://flybrain.mrc-lmb.cam.ac.uk/dokuwi...
* http://flybrain.mrc-lmb.cam.ac.uk/dokuwi...

for some discussion. Setting '--accuracy ' to e.g. half of your voxel size may save you a lot of time (e.g. '--accuracy 0.5' if you have 1�m voxels) and you can experiment with larger values. Also if your image is oversample compared with the biological variability of the specimen you can decide what the finest resolution image data you want to use is using the and then add the '--omit-original-data' argument.

Also are you using parallel threads? warp will do quite well with 4-8 threads on most hardware.

Best,

Greg.

Dec 20, 2016  12:12 AM | Dan Xie - UCSF
RE: Unit for registration
Thanks Greg! I currently do not parallize the procedure, but even so 7 hours does sound too long. So far I only used single commands following the UserGuide, for example:

warp -o ffd40.xform --grid-spacing 40 --initial affine.xform  [ref_image] [float_image]

where I got the affine.xform from the command:

registration --initxlate --dofs 6,9 --auto-multi-levels 4 -o affine.xform [ref_image] [float_image]

Did I do anything wrong?  Also, what is the difference between the method in the online tutorial and that in the User guide? What does the flag '-awr' mean? I cannot find an instruction anywhere in the manual.

I found a sample script of "munger.pl" here:
https://github.com/jefferis/AnalysisSuit...
Could I use the script as it is, or should I modify anything based on my computer specs?

Best,
Dan
Dec 20, 2016  01:12 AM | Greg Jefferis
RE: Unit for registration
munger is a wrapper script which coordinates running registration and warp for many brains. There are some sample parameters which have been widely used for fly brains. I believe similar paramo have also been used for larval fish brains by e.g. Mike Orger, Owen Randlett, Michael Kunst, Ruben Portugues.

You might like to try the Fiji CMTK GUI (ask google) to generate scripts that call munger. The -awr flags you mentioned are arguments to munger not to CMTK.

Jan 3, 2017  08:01 PM | Dan Xie - UCSF
RE: Unit for registration
Thanks Greg! Unfortunately when I install CMTK from the Fiji CMTK GUI, the cmtk folder in the /bin/cmtk is always empty. I have another cmtk installed independently under /usr/bin and it functions under the command lines in the user guide, but it does not have munger.  I reinstalled my Fiji but the problem remains.

Is there any way to by pass the cmtk installed by the GUI and use the one under /usr/bin, but still use the GUI for input and configurations?Thanks!

Best,
Dan
Jan 3, 2017  09:01 PM | Greg Jefferis
RE: Unit for registration
When you install CMTK from source there is an option during the Cmake configuration to build optional tools (one of which is munger). It is easiest to do this via the ccmake gui.

Alternatively the binary installs should already have munger.

There is a GitHub issue to enable use of system CMTK.

https://github.com/jefferis/fiji-cmtk-gu...

You can subscribe to this / +1 it to remind me to take a look.

Best,

Greg.