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

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

답변 (1개)

Image Analyst
Image Analyst 2013년 7월 28일

0 개 추천

Did you look up the help for dimcomread()? Doesn't that example help you?

댓글 수: 2

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)

이 질문은 마감되었습니다.

질문:

2013년 7월 28일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by