- Modify the “textToInsert” variable to string before assignment to “dicomInfo” metadata. In the given code, “textToInsert” variable is stored as cell array. The modified line of code is shown below:
- Check that the appropriate metadata field is used from “dicomInfo” variable to insert the comment. Use the following command to display different fields in DICOM metadata:
- When using “dicomwrite” function to create the new file, consider using “CreateMode” option set to “Copy”. This will copy all values from the input file. The modified line of code is shown below:
- “dicomwrite” function: https://www.mathworks.com/help/images/ref/dicomwrite.html
- “dicominfo” function: https://www.mathworks.com/help/images/ref/dicominfo.html
- “dicomread” function: https://in.mathworks.com/help/images/ref/dicomread.html