I am reading an image with imread:
out_image = itk.imread(files[0], itk.UC)
then changing adding metadata tags:
out_image['TileWidth'] = str(int(size[0]))
out_image['Date_start'] = other_image['Date']
When I run print(dict[image])
, I see all the metadata. However, when I write out the image and read it in again and the metadata is not stored with the image.
itk.imwrite(out_image, str(out_file))
new_im = itk.imread(str(out_file), itk.UC)
print(dict(new_im))
What am I doing wrong please?