users > Warps settings optimization
Showing 1-6 of 6 posts
Display:
Results per page:
Apr 16, 2016  02:04 PM | Pieter Louwe - University of Edinburgh
Warps settings optimization
Hi guys,

So I have been playing around a bit with using CMTK to register a sample that has been imaged from two sides to itself.  By then adding the signals together the weak signal I get from te middle of the tissue will be a bit stronger and hopefully be better for final analysis. The main set-up works but I am still struggling a bit with the warp settings. Though most of my cells are overlaying almost perfectly there still appear to be a few cells where the two channels are not overlapping the way they should, leading to an overestimation of the cell size when finally adding the signals. I have attached an example image(green and red are the two channels to be registered, in yellow is the sum of the two).

Right now i am running the Cachero Ostrovsky registration parameters. I have been looking at some possible things to optimize the warping settings but I a having some trouble understanding the details for the warping ( as described in on http://flybrain.mrc-lmb.cam.ac.uk/dokuwiki/doku.php?id=warping_manual:registration_parameters)

As far as i understand the solution would be to increase the number of grid refinements and the accuracy but i am not too sure. 

I would greatly appreciate if you guys could give some feedback on which parameters to change.


Best,

Pieter
Attachment: cropped .tif
Apr 16, 2016  09:04 PM | Torsten Rohlfing
RE: Warps settings optimization
Hi Peter -

I can't really see the image you posted, but I seem to understand that you are not getting enough warping, rather than too much, correct?

In that case, I have a few general comments:

1. If the area that are not properly aligned are somewhat large and/or somewhat far from each other after registration, you may want to make the initial control point spacing coarser and also make the optimizer take larger steps (not sure how that translates to arguments for the munger script that I assume you are using).

2. If the misregistered areas and/or the residual displacement are somewhat small, then relaxing the constraints of the warping by reducing the penalty term parameters (again, no idea what that means for munger) may help.

Basically, the idea here is that misregistration could result from either things being too far apart in the initial configuration (which could be improved by 1. above), or from the warping being to "stiff" to account for the true complexity of the difference between your images (which would be improved by 2. above). Obviously, the distinction is a bit fuzzy (what is "somewhat" exactly, right?), and it may well be that you have a little bit of both problems.

Hope this helps a little, and perhaps Greg can fill in the munger gaps in my knowledge.

Best,
  Torsten
Apr 18, 2016  09:04 AM | Pieter Louwe - University of Edinburgh
RE: Warps settings optimization
Hi Thorsten,

Thank you for the quick and helpful reply. I had a closer look at my data with your comments in mind, in most of channel the registration is almost perfect. There are a few bits where the registration isn't though. If i then look at these bits in the affine registered data I noticed that in these cases the structures where quite far apart. So it would appear that the warping isn't able to bridge the gap and register all the way.

As you guessed correctly I am using the munger. To loosen the warping should I be changing the values for Jacobian constraint and rigidity weight then ? It would be great if Greg ( or anyone else) could give some advice on how to adapt the munger. 

Best,

Pieter
Apr 18, 2016  03:04 PM | Greg Jefferis
RE: Warps settings optimization
Originally posted by Pieter Louwe:
Thank you for the quick and helpful reply. I had a closer look at my data with your comments in mind, in most of channel the registration is almost perfect. There are a few bits where the registration isn't though. If i then look at these bits in the affine registered data I noticed that in these cases the structures where quite far apart. So it would appear that the warping isn't able to bridge the gap and register all the way.
In these cases, is is the whole volume that is not well aligned at the affine stage, or just part of the volume? If the former, you need to improve your initial affine estimate. If the latter then as Torsten discusses you could increase the grid spacing/step size or increase the ability of the registration to deform the volume (principally warp energy). There is one either that might be worth checking off the shelf – switching the metric to e.g. cross correlation, since these images must be very similar.
As you guessed correctly I am using the munger. To loosen the warping should I be changing the values for Jacobian constraint and rigidity weight then ? It would be great if Greg ( or anyone else) could give some advice on how to adapt the munger. 
eYou can change the following munger command line options to modify the parameters discussed above.

-X [exploration] (default 16)
-G [grid-spacing] (default 40)

-E [energy] energy of warp transform (default e-1)
-J [0 to 1] jacobian-weight volume constraining param (default 0)

The metric can be set by:

-M [metric] (Supported values: nmi, mi, cr, msd, ncc, default is nmi)

You can get help for munger by choosing help for CMTK tool, running munger on the command line without arguments, or going to:

https://gist.github.com/jefferis/6cac924...

Best,

Greg.
Apr 19, 2016  02:04 AM | Torsten Rohlfing
RE: Warps settings optimization
Hi Peter,

From your description, it seems to me that a coarser initial control point spacing (and, optionally, an added level of refinement to get to the same final spacing) would be the first option to try. Combine this with a roughly equivalent increase in the initial optimization step size ("exploration" in CMTK warp lingo, perhaps similar in munger terms?), so if you do 150% of your previous initial grid spacing, then also use 150% of your previous optimization step size.

Best,
  Torsten
Apr 19, 2016  03:04 AM | Torsten Rohlfing
RE: Warps settings optimization
Ah, I see I skipped Greg's munger explanation. So based on what I was saying earlier, you'd want to increase your -X and -G parameters by about the same factor; see what happens.

Another thing I realized looking through Greg's list: you may also want to change the image similarity measure, if you haven't already. The default, NMI, tends to be rather insensitive to magnitude of intensity differences, which makes it well-behaved and that is usually a good thing.

But if you have essentially single-modality data, i.e., you expect the same structures to be bright in both images (and others dark in both, also), then you may be able to use a more aggressive metric, such as NCC (normalized cross correlation; assumes a linear relationship between intensities in both images), or even MSD (mean-squared difference; assumes that identical structures in both images will have identical intensities).

If these work better for you but go overboard in some areas and create excessive warpings, then you might be able to counteract that by increasing the -E parameter.

All this is, unfortunately, a little bit like a dark art, but it's the best I can offer.

Torsten