MATLAB: Cell Analysis Imaging threshold and merging

cell analysisImage Processing Toolbox

Hi
I am wanting to convert two images (which contain images of cells [ before and after shot]) into a black and white image and then use a threshold
If image one and two are say under threshold of 100- i need each image pixel location to be set to 0, otherwise set it to 1. Ie- for each location a cell is present I would like to represent this as a one in the matrix format and where its simply a background- represent this as a zero.
Here after, I need to merge images 1 and 2 such that when I multiply the matrix of image 1 by image two, onyl cells which remain in the same location ( ie 1 X 1) are shown.
Is there a simple way of doing this in matlab. I am a new user and struggling to find some coding. Any great would be greatly appreciated.
this is what i have so far…
% Read image
originalImage1 = imread('LDV.tiff');
imshow(originalImage1);
originalImage2 = imread('LDV2.tiff');
imshow(originalImage2);
% Threshold the image to get a binary image (only 0's and 1's) of class "logical."
% Method using a logical operation.
thresholdValue = 100;
binaryImage1 = originalImage1 > thresholdValue; % Bright objects will be the chosen if you use >.

binaryImage2 = originalImage2 > thresholdValue; % Bright objects will be the chosen if you use >.
Thanks in advance!!

Best Answer

Looks fine so far. Now you just need to AND the two together.
inSameLocation = binaryImage1 & binaryImage2;
if I understood you correctly. This will tell you which pixels are 1 in both images.