Why do I get different solutions using uigetfile and path strings?

1 回表示 (過去 30 日間)
Dende
Dende 2022 年 3 月 2 日
回答済み: Walter Roberson 2022 年 3 月 2 日
How does uigetfile operate? Does the second prompt overwrite the first one?
I have the following code and I want to use the commented part instead of the path strings. However while using uigetfile I don't get the wanted solution.
The rzFactor should be 1.4 and that is what i get using the path strings. Using uigetfile I just get 1.0 as the solution. How does uigetfile operate? Does the second prompt overwrite the first one?
% Open and read CT and CBCT DICOM file
% Shows all files with a .dcm extension
% inputCT_File = msgbox('Please select planning CT file in DICOM format.')
% FileName_CT = uigetfile('.dcm')
%
%
% inputCBCT_File = msgbox('Please select Cone Beam-CT file in DICOM format.')
% FileName_CBCT = uigetfile('.dcm')
FileName_CT = 'C:\Users\Deniz\Desktop\Uni\Semester 7\Bachhelor_Arbeit\Codes_24012022\Kopf\CT\CT.#_STR_IMG.Bild 10.dcm';
FileName_CBCT = 'C:\Users\Deniz\Desktop\Uni\Semester 7\Bachhelor_Arbeit\Codes_24012022\Kopf\CBCT\CT.#_STR_IMG.Bild 10.dcm';
% Get information of .dcm file
info_CT = dicominfo(FileName_CT);
info_CBCT = dicominfo(FileName_CBCT);
vz_CT = info_CT.PixelSpacing;
vz_CBCT = info_CBCT.PixelSpacing;
rzFactor = vz_CT(1)/vz_CBCT(1)

採用された回答

Walter Roberson
Walter Roberson 2022 年 3 月 2 日
you should be using the two-output form of uigetfile, then fullfile() to create a complete path.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by