I have 110 CT dicom images, and their names are randoms, so when I display them using any dicom viewer, they are displayed randomly. Thus I am trying to rename these dicom images according to their Image Number (0020,0013) or Slice Location (0020,1041). I have already started to write a script
image_list=dir('*.dcm');
for i=1:25
img=dicomread(image_list(i).name);
imgHdr = dicominfo(image_list(i).name);
dicomwrite(img, ['T' num2str(i) '.dcm'], imgHdr,'CreateMode','Copy')
end
But I don't know how to tell it check the InstanceNumber and use it in the new name ?
.dcm
provided by MatLab (info = dicominfo('CT-MONO2-16-ankle.dcm')
and I did not findImage Number
within the info provided bydicominfo
. What do you mean withcheck the image number
? – il_raffa