Dear Matlab experts,
I need to change the value of the StudyInstanceUID in my DICOM images so that is equal to that of the first DICOM. I´m doing this because I need to convert them into BIDS format using Heudiconv and the conversion is only possible if they all have the same StudyInstanceUID. So I was adviced to do this change in the Heudiconv forum (more info here: heudiconv).
This is the code I´m using in Matlab for this:
dicomwrite(X, 'test.IMA', info, 'CreateMode', 'Copy','CompressionMode','None');
clear X info j
However, though the StudyInstanceUID has been successfully changed in the output image (test.IMA) the image size goes from 272KB to 131KB (so approx. half size). Also, the attibutes from the header in test.IMA are not completely recognized by Heudiconv and the conversion is still not possible.
Could anyone suggest any idea to make this change in the header of my DICOM files without any further modification?
Thank you in advance for your time.