Can I use another filename instead?
조회 수: 1(최근 30일)
표시 이전 댓글
If this file is 'image.nii', and it is located at c:\users\matlab,
while using niftiinfo(filename) funtion,
Is it okay to write niftiinfo("c:\users\matlab\image.nii") instead of niftiinfo("image.nii")?
댓글 수: 0
답변(2개)
Image Analyst
2023년 1월 30일
Even more robust:
folder = "c:\users\matlab";
if ~isfolder(folder)
errorMessage = sprintf('Error: folder does not exist:\n', folder);
uiwait(errordlg(errorMessage));
return;
end
fullFileName = fullfile(folder, "image.nii");
if ~isfile(fullFileName)
errorMessage = sprintf('Error: file does not exist:\n', fullFileName);
uiwait(errordlg(errorMessage));
return;
end
% If we get to here, the file exists.
niftiinfo(fullFileName)
댓글 수: 0
참고 항목
범주
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!