Binarizing of a 3D image

5 views (last 30 days)
Hege
Hege on 14 Sep 2020
Commented: Hege on 18 Sep 2020
I have scanned a pack of fibres using Micro CT machine and now I want to process it using the Matlab. I used below code to processed the .vol file. However, now I want to view this 3D array clearly which means to see the fibres. my expectations are mentioned in below. please correct me if I am wrong.
1)convert the 3D grey scale array in to a binarise image and then start the thresholding.
2)find the optimum thresholding value and add filters accordingly to remove the noise which means to find the air and fibres clearly and then convert back to the 3D grey scale image
Are my expectations are correct? Could you help me to do these things for the 3D array.
Below is the code for my pack of fibers
fid = fopen('E:\FL\fl_D_7mm_6um_1d42s\rfl_D_7mm_6um_1d42s.vol');
voxels = fread(fid, '*uint32'); %read as 32 bit unsigned. I'm assuming they're unsigned
fclose(fid);
voxels = reshape(voxels,[1920,1920,1536]);
%voxels = reshape(voxels, [1920, 1920, 1536]); %you may need to permute the numbers here
% %and you may need to permute the dimensions afterward

Accepted Answer

Image Analyst
Image Analyst on 14 Sep 2020
  14 Comments
Image Analyst
Image Analyst on 16 Sep 2020
Try this:
image3d = randi(255, 100, 100, 100); % Sample data. Replace with your 3-D array.
histObject = histogram(image3d);
title('Histogram of 3-D Image', 'FontSize', 15);
xlabel('Gray Level', 'FontSize', 15);
ylabel('Count', 'FontSize', 15);
grid on;
Hege
Hege on 18 Sep 2020
Thank you so much for your great help Image Analyst!

Sign in to comment.

More Answers (0)

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!