Issue while trying to use imopen
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!