Image segmentation for each slice in a volume stack
11 ビュー (過去 30 日間)
古いコメントを表示
I am trying to segment the largest boundaries in a cropped image for each slice in a volume. I am using imbinarize, applying a threshold, and then smoothing out the boundaries before using regionprops to calculate the areas of the blobs. I am having trouble getting to the point where I can have a list of areas for each slice in my volume. I believe only the last slice is getting outputted. Here is my code as of now
vol = tiffreadVolume('filename.tiff');
stack = vol(:, :, [224:2:276]);
stack = mat2gray(stack);
[a, rectout] = imcrop(stack(:,:,1))
for i = size(stack,3)
img_crop = imcrop(stack(:, :, i), [rectout]);
imshow(img_crop)
binary_img = imbinarize(img_crop, 0.1);
fill = imfill(binary_img, 'holes')
area_filt = bwareafilt(fill, 5);
imshow(area_filt)
boundaries_trace = bwboundaries(area_filt);
all_areas = regionprops(area_filt, 'Area')
areas = [all_areas.Area];
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!