Skip to content

How to validate type if tag contains valid type of data? #559

Answered by Enet4
qarmin asked this question in Q&A
Discussion options

You must be logged in to vote

You can query the data element dictionary through dicom_dictionary_std::StandardDataDictionary, DataDictionary trait. Admittedly, the we're a bit thin on examples here.

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 vr.exact() is needed here because dictionary entries have a virtual VR type for scenarios where the VR depends on context)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by qarmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants