I want to read a dicom tag, and the code is:
import SimpleITK as sitk
reader = sitk.ImageFileReader()
reader.SetFileName(path)
reader.LoadPrivateTagsOn()
reader.ReadImageInformation()
val = reader.GetMetaData('0040|9225')
It return an error as:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Anaconda3\envs\general\lib\site-packages\SimpleITK\SimpleITK.py", line 8765, in GetMetaData
return _SimpleITK.ImageFileReader_GetMetaData(self, key)
RuntimeError: Exception thrown in SimpleITK ImageFileReader_GetMetaData: D:\a\1\sitk-build\ITK\Modules\Core\Common\src\itkMetaDataDictionary.cxx:88:
itk::ERROR: Key '0040|9225' does not exist
Then, I open the file using radiant:
So, how can I obtain the ‘0040|9225’?