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

조회 수: 4 (최근 30일)
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 CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by