load series of DICOM and convert it to volume to use volume viewer

Hi everyone,
I want to segmentation a 3D image, I have a series of DICOM CT scans and I want to convert it to volume image and to load it with volume viewer to do segmentation.
Can Someone knows such work?

1 Comment

Have you looked on the file exchange? There are dozens of readers and 3D viewers.

Sign in to comment.

Answers (1)

Refer the example code below,
close all; clc;
% Load the demo DICOM image
[X, map] = dicomread('US-PAL-8-10x-echo.dcm');
% Display the DICOM image
montage(X, map, 'Size', [2 5])
% Remove dimensions of length 1
X = squeeze(X);
% Launch volume viewer
volumeViewer(X)
% K-means clustering based volume segmentation
L = imsegkmeans3(X, 3);
% Visualize the segmented volume
volumeViewer(L)
Hope this helps!

9 Comments

Thank you very much, but if I have a series of dicom it will work?
and another question, do you know how to remove plaster from the 3D image, and to see only the bones?
@ eran bamani Can you share atleast 2-3 of these images so that I can test in my end?
@ eran bamani before sharing some slices of your DICOM file on a public forum, please confirm they do not contain any personal information or patient data.
And did you see my suggestion about the File Exchange? There are many functions there that will read a list of DICOM files to a 3D variable. I have attached my current version. Note that I am still working on it, so there may be some issues here and there.
Yes, but I can only in privet.
So how can I share with you the images?
If you can't share the files publicly, I doubt you are allowed to send them by email.
Did you try the function I attached to my comment?
@ eran bamani As rightly pointed out by Rik, please do not share the files. Refer the below code, it reads example DICOM data from a folder to form a volume.
close all; clc;
% Load the demo DICOM images from a folder
[V, spatial, dim] = dicomreadVolume(fullfile(matlabroot,'toolbox/images/imdata/dog'));
% Display the DICOM slices
montage(imadjustn(V), 'Size', [2, 11])
% Remove dimensions of length 1
V = squeeze(V);
% Launch volume viewer
volumeViewer(V)
% K-means clustering based volume segmentation
L = imsegkmeans3(V, 3);
% Visualize the segmented volume
volumeViewer(L)
Thank you Rik, You are right.
I try with with a lot code version but it didn't work.
'it didn't work' is not helping us to solve your issue. What release of Matlab are you using, what exact code are you running, and what is the exact and complete error message?

Sign in to comment.

Categories

Asked:

on 28 May 2020

Commented:

Rik
on 28 May 2020

Community Treasure Hunt

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

Start Hunting!