User Manual for stitch4Images

User Manual for stitch4Images

Contents

Introduction

In some cases, you might not be able to capture the whole region of interest using the x2.5 magnification objective of the microscopes. It is possible to "stitch" four images together in Matlab. For more than 4 images there are commercial software packages that can be downloaded for free. This manual describes how to stitch 4 images into a single one.

Loading the data into Matlab

As always, you need to load the data into matlab, either by using imread or drag-and-drop. Refer to other manuals for more details. In this case, I will load them using imread:

quadrant1=imread('Q1.bmp');
quadrant2=imread('Q2.bmp');
quadrant3=imread('Q3.bmp');
quadrant4=imread('Q4.bmp');

figure(1)
imagesc(quadrant1)
figure(2)
imagesc(quadrant2)
figure(3)
imagesc(quadrant3)
figure(4)
imagesc(quadrant4)

The order in which the images must be presented to the algorithm is the following: 1 : top - left, 2 : top - right, 3 : bottom - left, 4 : bottom - right.

Running the algorithm

To obtanined the stitched version of the image simply type:

completeImage = stitch4Images(quadrant1,quadrant2,quadrant3,quadrant4);

And to visualise it:

figure(5)
imagesc(completeImage/255)

The 255 is used as the output is a "double".

Saving

To save your image, you can simply click on the "edit" menu from the figure, the go to "copy" and then you can "paste" it in word, powerpoint, ... You can also click on "File" then "Save" and select the name (e.g. "myFabulousImage.jpg") and the format (jpg,tif,bmp,...) you prefer.

%or save it as a matlab file in the following way:

save myFabuolusImage completeImage

This last file will save the data of "completeImage" inside the file myFabulousImage. You can save more things there, for instance

save myFabuolusImage completeImage quadrant1 quadrant2 quadrant3 quadrant4

will save all the quadrants and the results.