Code covered by the BSD License  

Highlights from
InSPIRE: optimizers and set ITK option Matlab wrap

InSPIRE: optimizers and set ITK option Matlab wrap

by

 

Uses optitool (matlab), gridsearch, random gridsearch for 2D image registration.

imgreg2d2(param)
%InSPIRE: metric for optimization
%Rex Cheung MD, PhD P&S Columbia University '97
%Do email cheung.r100@gmail.com or call 215-287-2501 if you have comments
%This m-script calculates the metric of each iteration
%Could use other ITK metric.
%2012 winter at Mainline, PA.
function metric = imgreg2d2(param)
 
%param = write x into paramfile.dat 
save paramfile.txt param -ASCII;
display(param);

% copy the moving image to temp image because it will be destroyed
% needs paramfile.txt
% fixedimage.png and movingimage.png
system('ImgReg2d2b');
 
% calculate mutual information
[r s]=system('MattesMI fixedimage.png output.png');

% %write output.png back to movingimage.png for next iteration
a=str2num(s);
metric = a;

Contact us