Struct dicom_dictionary_parser::parser::Parser
source · pub struct Parser { /* private fields */ }
Expand description
A parser for the data elements defined in various tables in the DICOM standard (part 6 “Data Dictionary”).
Implementations§
source§impl Parser
impl Parser
sourcepub fn new() -> Result<Self, Box<dyn Error>>
pub fn new() -> Result<Self, Box<dyn Error>>
Creates a new Parser
instance with a downloaded version of the
current part 6 of the DICOM standard.
Errors
This function fails if:
- Downloading part6.xml fails
- Reading the downloaded part6.xml fails
sourcepub fn with_part6_file(file_path: &Path) -> Result<Self, Error>
pub fn with_part6_file(file_path: &Path) -> Result<Self, Error>
Creates a new Parser
instance using the part6.xml given as file_path
.
Errors
This function fails if:
- Opening the file at
file_path
fails - Reading the file at
file_path
fails
sourcepub fn with_part6_file_contents(contents: String) -> Self
pub fn with_part6_file_contents(contents: String) -> Self
Creates a new Parser
instance given the full contents
of a part6.xml file.
sourcepub fn parse_data_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
pub fn parse_data_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
Returns all data elements defined in the “Registry of DICOM Data Elements” table of the DICOM standard.
Note that all data elemnts from the dictionary are returned, including elements:
- without name/keyword (e.g. “(0018,0061)”)
- with tags defining ranges (e.g. “EscapeTriplet” -> “(1000,xxx0)”)
- without VR (e.g. “Item” -> “(FFFE,E000)”)
Errors
This function fails if:
- Parsing of the part6.xml fails
- The table element of the “Registry of DICOM Data Elements” chapter cannot be found
- The format of how values are stored in part6.xml has changed and this function is no longer able to parse it appropriately
sourcepub fn parse_file_meta_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
pub fn parse_file_meta_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
Returns all file meta elements defined in the “Registry of DICOM File Meta Elements” table of the DICOM standard.
Errors
This function fails if:
- Parsing of the part6.xml fails
- The table element of the “Registry of DICOM File Meta Elements” chapter cannot be found
- The format of how values are stored in part6.xml has changed and this function is no longer able to parse it appropriately
sourcepub fn parse_directory_structuring_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
pub fn parse_directory_structuring_element_registry(
&self
) -> Result<Vec<DataElement>, Box<dyn Error>>
Returns all file meta elements defined in the “Registry of DICOM Directory Structuring Elements” table of the DICOM standard.
Errors
This function fails if:
- Parsing of the part6.xml fails
- The table element of the “Registry of DICOM Directory Structuring Elements” chapter cannot be found
- The format of how values are stored in part6.xml has changed and this function is no longer able to parse it appropriately
sourcepub fn parse_unique_identifier_registry(
&self
) -> Result<Vec<UID>, Box<dyn Error>>
pub fn parse_unique_identifier_registry(
&self
) -> Result<Vec<UID>, Box<dyn Error>>
Returns all unique identifiers defined in the “Registry of DICOM Unique Identifiers (UIDs)” table of the DICOM standard.
Errors
This function fails if:
- Parsing of the part6.xml fails
- The table element of the “Registry of DICOM Unique Identifiers (UIDs)” chapter cannot be found
- The format of how values are stored in part6.xml has changed and this function is no longer able to parse it appropriately