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.

landmarktransform2d(options)
%InSPIRE: control points based warping
%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 set the input file names and output file names
%for ITK warping.
%2002 winter at Mainline, PA.
%Could use other ITK landmark-based warping.
%Get fixedimage and movingimage from my other postings
function result = landmarktransform2d(options)
%modified from anneal.m (downloaded from Matlab Central by another author)

defaultoptions = struct(...
        'landmarks','landmarks.txt',...
        'fixedimage','fixedimage.png',...
        'movingimage', 'movingimage.png',...
        'defmovingimage', 'defmovingimage.png');

% Check input
if ~nargin %user wants default options, give it and stop
     options = defaultoptions;
    return
elseif nargin<2, %user gave only objective function, throw error
    error('MATLAB:anneal:noParent','You need to input a first guess.');
elseif nargin<3, %user gave no options structure, use default
    options=defaultoptions;
else %user gave all input, check if options structure is complete
    if ~isstruct(options)
        error('MATLAB:anneal:badOptions',...
            'Input argument ''options'' is not a structure')
    end
    fields = {'landmarks',...
        'fixedimage',...
        'movingimage',...
        'defmovingimage'};
    for nm=1:length(fields)
        if ~isfield(options,fields{nm}), options.(fields{nm}) = def.(fields{nm}); end
    end
end

% main settings
landmarks = options.landmarks;
fixedimage = options.fixedimage;      
movingimage = options.movingimage;        
defmovingimage = options.defmovingiamge;  

result= system('LandmarkWarping2 landmarks fixedimage movingimage defimage')

Contact us