Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why element_by_name cannot get SourceApplicationEntityTitle #329

Open
liaohongxing opened this issue Feb 22, 2023 · 3 comments
Open

Why element_by_name cannot get SourceApplicationEntityTitle #329

liaohongxing opened this issue Feb 22, 2023 · 3 comments
Labels
C-object Crate: dicom-object

Comments

@liaohongxing
Copy link

liaohongxing commented Feb 22, 2023

Why element_by_name cannot get SourceApplicationEntityTitle

sample code:

use dicom::object::{open_file};

fn main() {
    let obj = open_file("./dcm/ct-0.dcm").unwrap();

    let source_application_entity_title = obj.element_by_name("SourceApplicationEntityTitle").unwrap();

    println!("============={:?}", source_application_entity_title);
}

print:

oSuchDataElementAlias { tag: Tag(0x0002, 0x0016), alias: "SourceApplicationEntityTitle", backtrace: Backtrace(()) }

dcm file:

ct-0.zip

@Enet4 Enet4 added the C-object Crate: dicom-object label Feb 22, 2023
@Enet4
Copy link
Owner

Enet4 commented Feb 22, 2023

Thank you for reaching out. As Source Application Entity Title is in the file meta information group, it is currently not reachable directly through element* methods. You can call meta() to reach the file meta table and retrieve source_application_entity_title from there.

if let Some(source_application_entity_title) = obj.meta().source_application_entity_title.as_ref() {
    println!("> {source_application_entity_title}");
} else {
    println!("No source application entity title");
} 

@liaohongxing
Copy link
Author

code test is available, thanks

@Enet4
Copy link
Owner

Enet4 commented Jul 21, 2024

Just leaving a note that per the plans for the upcoming generic object API (#524), it will be possible to retrieve Source Application Entity Title and other attributes in the meta file group using the same methods as the ones for retrieving attributes from the main data set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-object Crate: dicom-object
Projects
None yet
Development

No branches or pull requests

2 participants