I want to loop over dicom tags and image series in my script in a user interactive way. But I am unable to create a loop, which can ask user: Do you want to modify or add tags? if add then How many tags you want to add? and if no then which tags you want to modify? and then ask for the tags details and then later add them into my image series..
I have written a user interactive script which i will share with you, which can ask user to add any two tags in any image series(MRI, PET or CT).
tag1 = input("Enter the tag: ")
VR1 = input("Enter VR: ")
Value1 = input("Enter the value at VR: ")
tag2 = input("Enter the tag: ")
VR2 = input("Enter VR: ")
Value2 = input("Enter the value at VR: ")
for imagePath in image_path_list:
image = dcmread(imagePath)
image.add_new(tag1, VR1, Value1)
image.add_new(tag2, VR2, Value2)
image.add_new(0x00180020, 'CS', 'GR')
image.add_new(0x00180021, 'CS', 'SP\OSP')
src_fname, ext = os.path.splitext(imagePath)
'''
I expect a loop over my tags and image series in a interactive way.