//DcmRenamer //ImageJ macro to rename DICOM format images //and corresponding bitmap thumbnails //using the string from a DICOM header tag. //Copyleft Michael Doube 2007 requires("1.39f"); setBatchMode(true); open(); path = File.directory(); //Hit [i] with a DICOM image open and edit the following line tag = "0010,0010"; close(); function getTag(tag) { info = getImageInfo(); index1 = indexOf(info, tag); if (index1==-1) return ""; index1 = indexOf(info, ":", index1); if (index1==-1) return ""; index2 = indexOf(info, "\n", index1); value = substring(info, index1+1, index2); return value; } list = getFileList(path); for (i=0; i