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

Add take_element methods for InMemoryDicomObject #78

Closed
Enet4 opened this issue Oct 2, 2020 · 3 comments · Fixed by #79
Closed

Add take_element methods for InMemoryDicomObject #78

Enet4 opened this issue Oct 2, 2020 · 3 comments · Fixed by #79

Comments

@Enet4
Copy link
Owner

Enet4 commented Oct 2, 2020

Allow the user of dicom_object to take the element from the object, removing it in the process.

For in-memory objects, this can translate to less data copying.

    /// <document please>
    pub fn take_element(&mut self, tag: Tag) -> Result<InMemElement<D>> {
        todo!()
    }

    /// <document please>
    pub fn take_element_by_name(&mut self, name: &str) -> Result<InMemElement<D>> {
        let tag = self.lookup_name(name)?;
        self.take_element(tag)
    }
@pjsier
Copy link
Contributor

pjsier commented Oct 3, 2020

@Enet4 I'm interested in taking this on! To make sure I'm understanding, would it work to use the remove method of the entries BTreeMap?

@Enet4
Copy link
Owner Author

Enet4 commented Oct 3, 2020

@pjsier Yes, I believe that would be it for the implementation. 👍 A quality PR would also include documentation and a basic test (alongside the ones in the same module).

@pjsier
Copy link
Contributor

pjsier commented Oct 3, 2020

@Enet4 sounds great! I can work on that in the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants