sprintf + calling value in nested structure
显示 更早的评论
I need to loop through a set of structures/fields within a structure, 'dicom', to obtain specific reference numbers stored within the structure.
The reference number(s) that I am looking for can be called by: dicom.DVHSequence.Item_1.DVHReferencedROISequence.Item_1.ReferencedROINumber
However, the Item_# will change each time I call a reference number.
I have used sprintf to change the Item_# that I am calling:
ref_ROI_num_file_name = sprintf('dicom.DVHSequence.Item_%i.DVHReferencedROISequence.Item_%d.ReferencedROINumber',h,h)
with a for loop to increment 'i' (which works).
However, after I use sprintf, I cannot seem call the field name. I have tried getfield() to no avail.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 DICOM Format 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!