Hi Guys, Let me give you some context of my problem:
I’m doing a registration between two images, MovingVolume and FixedVolume and I’m going to do some processing to generate two final images that are related with the MovingVolume, so I want to create two images with the metadata of the MovingVolume (m_Labeled_Image and registeredImage). So I’m trying this:
std::vector<std::string> metadata = MovingVolume.GetMetaDataKeys();
for (int i = 0; i < metadata.size(); i++)
m_Labeled_image.SetMetaData(metadata[i], MovingVolume.GetMetaData(metadata[i]));
For the m_Labeled_image the copy is OK, but when I try to do the same for the registeredImage, which is the result of the registration, I got an itk Exception saying that the key does not exist.
Your description sounds fine. Can you share the code fragment declaring registeredImage and m_Labeled_image, as well as code for setting the metadata on both?