Error using ==> dicominfo in standalone exe

I am trying to create a program including different small applications to evaluate DICOM images. Within MatLab, everything works fine; in the standalone exe on Windows 7 an error occurs telling me
Error using ==> dicominfo > getFileDetails at 392
File "filename.dcm" not found.
Images:dicominfo:noFileOrMessagesFound
Here is an example of the code that seems to be processed thus far.
global pwd
pwd=uigetdir('C:\','Choose folder');
cd(pwd);
d=dir;
str={'App1.m','App2.m'};
[s,v]=listdlg('PromptString','Chosse app','ListString',str);
str=char(str(s));
for k=1:size(str,1)
if strfind(str(k,:),'App1.m')
App1.m
end
end
The subprogram "App1.m" looks like this:
global pwd
pwd=evalin('base','pwd');
FileName=(uigetfile('pwd\*.dcm','Choose DICOM file'));
info_FileName=dicominfo(FileName);
Pic=dicomread(info_FileName);
What am I missing and/or doing wrong? I've tried to set the path variable "pwd" as global but that doesn't seem to solve the problem. Thanks

 採用された回答

Robert Cumming
Robert Cumming 2014 年 6 月 17 日
編集済み: Robert Cumming 2014 年 6 月 18 日

0 投票

You dont need pwd as a global.
Did you add the dicom libraries when you compiled your code?
if you think the filename is a problem - use fullfile, i.e:
[filename, pathname] = uigetfile ( '*.dcm', 'Choose DICOM file' )
% check that the user selected a file
if pathname ~= 0
filename = fullfile ( pathname, filename );*
info_FileName=dicominfo(FileName);
Pic=dicomread(info_FileName);
end
edit update the uigetfile command where originally the output arguments were typed the wrong way around - lesson for writing code and not testing....

3 件のコメント

Pascal
Pascal 2014 年 6 月 17 日
No I didn't. Can you give me a little tip how to include the libraries? I took a brief look on the net already but haven't found anything useful yet. Also, I will try to use the full path and name to adress the file.
Thank you
Robert Cumming
Robert Cumming 2014 年 6 月 17 日
When compiling you add the files to your project - in deploytool click "Add Files" and select all the dicom libraries your code requires.
Pascal
Pascal 2014 年 6 月 17 日
Of course, sorry, I misunderstood that. Unfortunately, including the necessary DICOM libraries didn't help.
But using fullfile actually is perfect. Just as a notification, it's
[filename, pathname] = uigetfile ( '*.dcm', 'Choose DICOM file' )
Thank you again for your quick response. Cheers

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDICOM Format についてさらに検索

タグ

質問済み:

2014 年 6 月 17 日

編集済み:

2014 年 6 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by