-
Recently I found that in one place I used SH instead CS type. I wanted to create simple validator to check if object is proper type. I found ENTRIES slice, that could be used, but I cannot use it outside of this crate Is there any other way to validate object type? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can query the data element dictionary through use dicom_core::prelude::*;
use dicom_dictionary_std::{tags, StandardDataDictionary};
let entry = StandardDataDictionary.by_tag(tags::MODALITY);
let vr = entry.vr();
assert_eq!(vr.exact(), Some(VR::CS)); (the |
Beta Was this translation helpful? Give feedback.
You can query the data element dictionary through
dicom_dictionary_std::StandardDataDictionary
,DataDictionary
trait. Admittedly, the we're a bit thin on examples here.(the
vr.exact()
is needed here because dictionary entries have a virtual VR type for scenarios where the VR depends on context)