help Dicominfo in Listbox

Could you help me put the dicominfo function in a listbox, you should display the image information in the listbox

1 comentario

Walter Roberson
Walter Roberson el 5 de Feb. de 2018
Are you certain you want it in a listbox ? listbox is an input control for the user to select a value or action. It would seem to make more sense to put it into a text box or uitable.

Respuestas (1)

Walter Roberson
Walter Roberson el 5 de Feb. de 2018

0 votos

If you want to construct a textbox, one of the ways to proceed would be to evalc() dicominfo, or to assign the result of dicominfo to a variable and evalc() disp() of the variable.
Note that evalc() will give back a result with embedded newline characters. To break it up into lines, I suggest using
cell_result = regexp(dicominfo_result, '\r?\n', 'split');
Make sure that you set Max of the uicontrol('style','text') to at least 2 if you are displaying multiple lines this way.

7 comentarios

david martinez
david martinez el 7 de Feb. de 2018
Editada: Walter Roberson el 11 de Feb. de 2018
Use this code, but the full information does not come out, you can help me.
im=dicomread(info);
s=fields(info);
uicontrol('Style','Listbox','String',s,'Position',[20 70 415 320])
Walter Roberson
Walter Roberson el 11 de Feb. de 2018
info = dicominfo(image_file_name);
s = fieldnames(info);
david martinez
david martinez el 16 de Feb. de 2018
I still get the same result, some other idea?
Walter Roberson
Walter Roberson el 18 de Feb. de 2018
I just tried this with respect to a file I had sitting around:
image_file_name = '000059.dcm'
info = dicominfo(image_file_name);
s = fieldnames(info)
LB = uicontrol('Style','List','String', s, 'Position', [20 70 415 320]);
When I look at the results, they look fine to me -- which is to say that only the field names come out.
To display the contents as well, I would
image_file_name = '000059.dcm';
info = dicominfo(image_file_name);
dicominfo_result = evalc('disp(info)');
cell_result = regexp(dicominfo_result, '\r?\n', 'split');
TB = uicontrol('Style', 'edit', 'enable', 'inactive', 'String', cell_result, 'Max', 2, 'Position', [20 70 415 320]);
david martinez
david martinez el 18 de Feb. de 2018
it worked perfect .. thank you very much
mohd akmal masud
mohd akmal masud el 19 de Feb. de 2018
Hi all,
I want to extract the RescaleSlope value from dicominfo for each slice. But i have 135 slice images. This is my code to extract RescaleSlope. But still failed. I JUST CAN EXTRACT ONE BY ONE ONLY.
P = zeros(256, 256, 135);
for K = 1 : 135
petname = sprintf('PET_I1001_PT%03d.dcm', K);
P(:,:,K) = dicominfo(petname);
end
info=dicominfo(P(:,:,K));
[r,c,slice] = findND (info.RescaleSlope);
Anyone who can help me solve this problem???
Walter Roberson
Walter Roberson el 19 de Feb. de 2018
Stop posting the same question over and over again. You already created https://www.mathworks.com/matlabcentral/answers/383405-extract-rescale-slope-value

La pregunta está cerrada.

Etiquetas

Preguntada:

el 5 de Feb. de 2018

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by