The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Modify multiple field values in a structure
Replies: 2   Last Post: Oct 30, 2013 10:45 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 10/27/13
Modify multiple field values in a structure
Posted: Oct 27, 2013 5:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

This may be a basic question as I'm relatively new to matlab. I have a DICOM file which I've read the headers for into a structure using the dicominfo function. I would like to modify certain fields where there is more than one instance so for example:

info=dicominfo('Some dicim file.dcm');

Within info, there multiple sub-structures with multiple nested fields for example there is a sub-structure called SOPInstanceUID, and within this there are n fields storing value: field_1, field_2..field_n

To see the a certain value I can type within the structure:


However I would like to set a new value i.e to then write a new DICOM file.


I would like to do this automatically for all possible field numbers e.g:


for i=1:length(num_fields)



My question is how do I get Matlab to read the field name for each 'i', in order to set a new value for each field in the structure? I have tried various things like str2cat and sprintf but nothing works.

I hope this make sense and I would be very grateful for any help on this.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.