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