Issue while trying to use imopen

1 次查看(过去 30 天)
Hello Everyone,
I have a segmentation volume created after processing an image stack by pixel classification.
However, the presence of tiny sharp endpoints (circled black in the image here) creates an issue while trying to extract the centerline lengths.
So I tried to remove these small, sharp endpoints by performing an erosion followed by dialtion (imopen) before reconstructing of the 3D volume.
input.tiff is the input file
vessels_seg = loadtiff('input.tiff');
num_slices = size(vessels_seg);
vessel_seg_bin = vessels_seg==1;
se_open = strel('sphere',2);
vessel_seg_open = imopen(vessel_seg_bin,se_open);
post_vessels = vessel_seg_open>0;
vessels_processed_name = strcat(shortfile,'_post_processed.tif');
num_slices = size(vessels_seg,3);
imwrite(uint8(vessels_processed(:,:,1)),vessels_processed_name);
for p = 2:num_slices
imwrite(uint8(vessels_processed(:,:,p)),vessels_processed_name, 'WriteMode','append');
end
end
Unfortunately, this returns a stack with all black pixels. Could someone please look into this?
Please note: loadtiff used for loading multipage tiff can be found here

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by