Opening and finding distance between circles in multiple images from a Tiff Stack
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Noah Wegley
el 20 de Feb. de 2020
Respondida: Pujitha Narra
el 26 de Feb. de 2020
I am trying to write a code that would allow me to calculate the distance between circles in 100 images all from one .tif file. I was able to get the code to work for the first image in the stack, and am now stuck on how to get the code to look at the other 99 images in the stack. Any ideas?
Also, after computing the distance on all of the images, I want matlab to give me a matrix with all of the data, how do I do that?
Here is what I have so far:
a = imread('My_image.tif');
bw = a > 40000;
imshow(bw)
[centersBright,radiiBright,metricBright] = imfindcircles(bw,[20 25], ...
'ObjectPolarity','bright','Sensitivity',0.92,'EdgeThreshold',0.1);
stats = regionprops('table',bw,'Centroid',...
'MajorAxisLength','MinorAxisLength');
centers = stats.Centroid;
distance = pdist2(centers(1,:),centers(2,:));
0 comentarios
Respuesta aceptada
Pujitha Narra
el 26 de Feb. de 2020
Hi,
You can use indexing along with 'imread' like this:
a = imread('My_image.tif', i); % ith image in the stack
Using this with a loop would help.
For the second part, you could use concatenation like this:
distance = [];
% Calculate the values for a new image
distance = [distance; new_values]; % Concatenate it the existing data
Hope that helps!
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!