code of pushbutton to read series image from a file (format DCM)

code of pushbutton to read series image from a file (format DCM)

Réponses (1)

Image Analyst
Image Analyst le 28 Juil 2013
Did you look up the help for dimcomread()? Doesn't that example help you?

2 commentaires

zerr hamza
zerr hamza le 28 Juil 2013
Modifié(e) : zerr hamza le 28 Juil 2013
i have cet code but how implimenter in pushbutton to choose a file
Files = dir('C:\*.dcm');
for v=1:length(Files)
filename = strcat('C:\',Files(v).name);
M= dicomread(filename);
end
Try this to have a user browse to select a file:
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = 'C:\Program Files\MATLAB';
if ~exist(startingFolder, 'dir')
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)

Cette question est clôturée.

Question posée :

le 28 Juil 2013

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by