In the original demons by Thirion (1998) no specific optimization is used but instead a rather ad hoc proposal is given for estimating the update field (based upon optical flow). The update field is added to the displacement which is regularized using a Gaussian kernel. This process is then iterated until convergence, where convergence is undefined. Thus, in general demons do not utilize a specific optimization approach.
Later work, eg. Pennec (1999) show that the demons update rule can be considered as a second-order gradient descent approximation using the SSD, and Vercatueren (2007) shows that the symmetric demons update rule can be considered as an efficient second-order minimization. Despite these works, the significant feature of the demons is the alternating framework used for estimating the displacement, ie alternating between estimating the update field and regularization.
If your interested in working with different optimizers and different distance measures, then you should probably have a look at elastix (though limited to parametric transformations, if I correctly remember). ITK could also be good starting point, or Slicer if you want a GUI as well.
Yes Daniel you get it right,actually i want to compare different optimizers with different cost functions but want that transformation method remains the same.I am confused between Demons and B-spline.Can you suggest anything about this.I downloaded the elastix software but cant be able to install it rightly.
Demons uses what is known as a non-parametric transformation whereas B-splines uses parametric transformations. If you want to compare different similarity measures and optimizers I would recommend you to use a parametric transformation model (eg B-splines) otherwise you'll end with a very high dimensional space which you should optimize. Using parametric transformation models you can also avoid regularization some extent or simple regularization terms.
When it comes to evaluating different optimizers and similarity measures, have a look at the paper by Stefan Klein from 2007. Stefan is one of the authors of elastix.