Here is an workflow which can be used for analyzing two points in a .HDF image.
1. Load the HDF Image:
img = h5read('your_image.hdf', '/ImageData'); % Adjust dataset name as needed
img = squeeze(img); % Remove singleton dimensions
img = double(img);
2. Segment the Spots with K-means:
[idx, C] = kmeans(img(:), 2);
clusters = reshape(idx, size(img));
spotMask = clusters == find(C == max(C)); % Assume brighter spots
3. Find Centers and Intensities:
props = regionprops(spotMask, img, 'Centroid', 'MeanIntensity');
imshow(img, []); hold on;
for k = 1:length(props)
plot(props(k).Centroid(1), props(k).Centroid(2), 'r+', 'MarkerSize', 15);
fprintf('Spot %d: Intensity %.2f\n', k, props(k).MeanIntensity);
end
hold off;
I hope this helps!