Why do I get different solutions using uigetfile and path strings?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dende
le 2 Mar 2022
Réponse apportée : Walter Roberson
le 2 Mar 2022
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)
0 commentaires
Réponse acceptée
Walter Roberson
le 2 Mar 2022
you should be using the two-output form of uigetfile, then fullfile() to create a complete path.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur DICOM Format dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!