How to apply Region Growing function on DICOM images ?

Hi all
I have a DICOM file (128*128*16) consisted of 16 sequencial images. I want to apply Region Growing function ( a function created by Dirk-Jan Kroon for segmenting by growing a region from seed point using intensity mean measure) on my set of images (n=16). I am getting this error every time i try to run this function:
Error using images.internal.imageDisplayValidateParams>validateCData (line 115)
Multi-plane image inputs must be RGB images of size MxNx3.
Error in images.internal.imageDisplayValidateParams (line 27)
common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 78)
common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 246)
images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});
Error in regiongrowing (line 29)
if(exist('y','var')==0), figure, imshow(I,[]); [y,x]=getpts; y=round(y(1)); x=round(x(1)); end
Error in Untitled1111 (line 3)
J = regiongrowing(I);
After i saved Region Growing script, i used this code to call the Region Growing function:
I = im2double(squeeze(dicomread('MUGA.dcm')));
figure, imshow(I,[]);
J = regiongrowing(I);
figure, imshow(I,[]+J);
The function can be found in this link:
Can you please tell what should be the problem ?

 Respuesta aceptada

Subhadeep Koley
Subhadeep Koley el 29 de Oct. de 2019
Hi, it seems that the regiongrowing() function can only handle images of size MxNx3. Where as your DICOM file has a dimension of MxNx16.
When I tried calling the same function with a DICOM image of size MxNx3, it ran without any error.
Therefore, please try calling the same with image of maximum size MxNx3.

9 comentarios

Thank you Subhadeep,
Do you know how can i do this ?
How can i restrict this function to be done on 3 images only ?
Yes you can do that. Refer the code below.
I = im2double(squeeze(dicomread('MUGA.dcm'))); % Read your MxNx16 DICOM file here
I_3 = I(:,:,1:3); % Select only the first 3 layers
figure, imshow(I_3,[]);
J = regiongrowing(I_3); % apply region growing in the first 3 layers
figure, imshow(I_3,[]+J);
Hope this helps!
Hi Subhadeeb.
Thank you for your answer.
I am recieving this massege:
Error in (line 2)
I_3 = I(:,:,1:3); % Select only the first 3 layers
Ahmad, for me the below code is running fine (See the output).
clc;
I = im2double(squeeze(dicomread('MUGA1.dcm'))); % Read your MxNx16 DICOM file here
I_3 = rescale(I(:,:,1:3)); % Select only the first 3 layers
figure, imshow(I_3,[]);
J = regiongrowing(I_3); % apply region growing in the first 3 layers
figure, imshow(I_3+J,[]);
region_growing.png
Can you share your full error message?
Hi Subhadeep
I think this is not the expected image !.
i copied the full error in the above comment.
the image is viewed as black, which is not expected !.
Yes Ahmad, the image is black because is not in the range of [0,1] or [0,255]. To bring the image in [0, 1] range I have used the rescale function in the 3rd line. Have you tried the below code?
clc;
I = rescale(im2double(squeeze(dicomread('MUGA1.dcm')))); % Read your MxNx16 DICOM file here
I_3 = rescale(I(:,:,1:3)); % Select only the first 3 layers
figure, imshow(I_3,[]);
J = regiongrowing(I_3); % apply region growing in the first 3 layers
figure, imshow(I_3+J,[]);
Because the error is not showing in my end.
Hi Subhadeep
Now your code is working, but still the region growing function is not performinmg what it intended to do (segmentation sould happen as in the example included with the code) !. Again, this is not the expected image !.
Do you think this is rom the function itself ?.
Ahmad, regiongrowing() is a MATLAB File Exchange contribution by a MATLAB Central community user. I am not aware of the detail implementation of that function. You can post your quaries about the regiongrowing() function in that File Exchange submission page so that the author can help you.
Hi Subhadeeb
Thank you for your help, it is appreciated.
Ahmad

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Centro de ayuda y File Exchange.

Preguntada:

el 22 de Oct. de 2019

Comentada:

el 4 de Nov. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by