REGISTER_1D_IMAGES_SET: registers a set of images according to a given reference image GENERAL build_1d_bump_model(spline_type, placement_type, objective_function) INPUT/S -reference_image: Reference image for registration. -reference_points: The points that describe the warps applied to the reference image. -images: The images to be registered -images_points: The points that describe the warps applied to the images. -number_of_iterations: The number of iterations corresponding to warps. OUTPUT/S -returned_images: The images passed in post-warping. These exclude the reference image which is, of course, unchanged. -returned_points: The points that describe the warps applied to the images PENDING WORK KNOWN BUG/S COMMENT/S 7/1/04: Need to get points of reference image and images to be passed on to objective functions called only from MAKE_2D_IMAGES and was never used successfully as early 2-D efforts had been aborted. RELATED FUNCTION/S MAKE_2D_IMAGES ABOUT -Created: January 7th, 2004 -Last update: January 7th, 2004 -Revision: 0.0.1 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function [returned_images, returned_points] = register_1d_images_set(reference_image, reference_points, images, images_points, number_of_iterations) 0002 % REGISTER_1D_IMAGES_SET: registers a set of images according to 0003 % a given reference image 0004 % 0005 % 0006 % GENERAL 0007 % 0008 % build_1d_bump_model(spline_type, placement_type, objective_function) 0009 % 0010 % INPUT/S 0011 % 0012 % -reference_image: 0013 % Reference image for registration. 0014 % 0015 % -reference_points: 0016 % The points that describe the warps applied to the reference image. 0017 % 0018 % -images: 0019 % The images to be registered 0020 % 0021 % -images_points: 0022 % The points that describe the warps applied to the images. 0023 % 0024 % -number_of_iterations: 0025 % The number of iterations corresponding to warps. 0026 % 0027 % OUTPUT/S 0028 % 0029 % -returned_images: 0030 % The images passed in post-warping. These exclude the reference image 0031 % which is, of course, unchanged. 0032 % 0033 % -returned_points: 0034 % The points that describe the warps applied to the images 0035 % 0036 % PENDING WORK 0037 % 0038 % 0039 % KNOWN BUG/S 0040 % 0041 % 0042 % COMMENT/S 0043 % 0044 % 7/1/04: Need to get points of reference image and images to be passed on to objective functions 0045 % called only from MAKE_2D_IMAGES and was never used successfully 0046 % as early 2-D efforts had been aborted. 0047 % 0048 % RELATED FUNCTION/S 0049 % 0050 % MAKE_2D_IMAGES 0051 % 0052 % ABOUT 0053 % 0054 % -Created: January 7th, 2004 0055 % -Last update: January 7th, 2004 0056 % -Revision: 0.0.1 0057 % -Author: R. S. Schestowitz, University of Manchester 0058 % ============================================================== 0059 0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0061 % variables (parameters) initialisation 0062 0063 % spline type 'single_point' or 'multi_point' 0064 spline_type = 'multi_point'; 0065 % placement type for multipoint: 'grid' or 'edges' or 'random' 0066 % placement type for singlepoint: 'overlap_grid' or 'edges_and_scale' or 'random_and_scale' 0067 placement_type = 'edge'; 0068 objective_function = 'msd_opt_together'; 0069 verbose = 'off'; 0070 % be verbose or not 0071 n_points = 5; 0072 % an argument that is passed to the model optimisation function. 0073 % meaning still unknown. 0074 0075 ref_shift = 0.2; 0076 % shift in reference image?? 0077 max_shift = 0.2; 0078 % maximum allowed shift? 0079 step = 0.1; 0080 % used below only 0081 spec_iters = 25; 0082 % specificity iterations 0083 gen_iters = 25; 0084 % generalisability iterations 0085 min_error = 0; 0086 max_error = 1; 0087 % define error range?? 0088 error_step = 0.1; 0089 n_error_steps = (max_error-min_error)/error_step; 0090 0091 for n=1:number_of_iterations 0092 disp(['Itereation number ',num2str(n)]); 0093 % Smith: correct registration 0094 % attempt to register 0095 for i=1:size(images(2)), 0096 disp(['Warping image ',num2str(i),' of ',num2str(size(images(2))]); 0097 0098 image_vec = warped_images(:,i); 0099 points_vec = warped_points(:,i); 0100 0101 if(strcmp(objective_function,'model_opt_together')) 0102 [param_list, warped_point, warped_image, score] = optimise_all_warps_model([warped_images(:,1:i-1),warped_images(:,i+1:n_images)], [warped_points(:,1:i-1),warped_points(:,i+1:n_images)], image_vec, points_vec,spline_type,placement_type,n_points, 0, 0); 0103 elseif(strcmp(objective_function,'model_opt_separate')) 0104 [param_list, warped_point, warped_image, score] = optimise_warps_model([warped_images(:,1:i-1),warped_images(:,i+1:n_images)], [warped_points(:,1:i-1),warped_points(:,i+1:n_images)], image_vec, points_vec,spline_type,placement_type,n_points, 0, 0); 0105 elseif(strcmp(objective_function,'msd_opt_together')) 0106 [param_list, warped_point, warped_image, score] = optimise_all_warps_msd(reference_image, ref_points_vec, image_vec, points_vec, spline_type, placement_type, n_points, 0, 0); 0107 elseif(strcmp(objective_function,'msd_opt_separate')) 0108 [param_list, warped_point, warped_image, score] = optimise_warps_msd(reference_image, ref_points_vec, image_vec, points_vec, spline_type, placement_type, n_points, 0, 0); 0109 else 0110 error(['Unknown objective function: ', objective_function]); 0111 end 0112 0113 warped_images(:,i) = warped_image; 0114 warped_points(:,i) = warped_point; 0115 0116 end % end:images 0117 end % end:iterations 0118 0119 returned_images = warped_images 0120 returned_points = warped_points