フィルターのクリア

How do I display numbers enclosed in single quotes from DICOMINFO?

2 ビュー (過去 30 日間)
JayJay
JayJay 2018 年 8 月 3 日
コメント済み: JayJay 2018 年 8 月 3 日
So, I obtained the DICOM information of a particular file using the dicominfo function. However, when I want to access the Date of the exam and display it, I'm getting an error as it's enclosed in single quotes.
info1 = dicominfo(filename1);
fileID = fopen('xxx.txt','w');
fprintf(fileID,'The date is %d \n ',info1.DateOfLastCalibration);
The output im getting is,
The date is 50
The date is 48
The date is 49
The date is 50
The date is 49
The date is 50
The date is 49
The date is 55
This is what's given in the DICOM file info: DateOfLastDetectorCalibration: '20121217'
The output I want is:
The date is 20121217
Can you guys help me out?

採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 8 月 3 日
編集済み: Fangjun Jiang 2018 年 8 月 3 日
fprintf(fileID,'The date is %s \n ',info1.DateOfLastCalibration);
FYI
>> double('20121217')
ans =
50 48 49 50 49 50 49 55
  1 件のコメント
JayJay
JayJay 2018 年 8 月 3 日
Thanks so much!!! That was simpler than I expected haha

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by