Did anyone add a private DICOM tag to a DICOM file successfully using ClearCanvas library?
The following code snippet is just what I am trying to add a private tag to the DICOM file dataset. But I can not find it when I open the saved DICOM file by MicroDicom viewer.
DicomTag tag = DicomTag.GetPrivateCreatorTag(0X7FE1, 0X0010);
DataSet[tag].SetStringValue("Left");
Does anyone know the reason?
I never used the toolkit but I can see the problem in your code.
You are creating the private tag correctly and also setting its value properly.
But, you are not adding that newly created private tag to dataset.
I am not sure about syntax. You have created a tag. Now, you need to load the file in which you want to add that tag. You access the DICOM dataset instance and add the new tag to its indexer. Then save the file.