Skip to content

BF+TST: Skip over missing CSA header elem instead of raising. #393

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

Merged
merged 3 commits into from
Mar 6, 2016

Conversation

moloney
Copy link
Contributor

@moloney moloney commented Dec 18, 2015

Allows us to load data where the PrivateCreator is present but
the element containing the header info is not. Ran into this with
anonymized data.

@moloney
Copy link
Contributor Author

moloney commented Dec 21, 2015

The failure on 2.6 is from this pydicom bug which is now fixed in master. Should I mark it as a known failure?

@matthew-brett
Copy link
Member

Marking as knownfailure just for Python 2.6 seems good.

We can drop Python 2.6 soon, if it makes it easier, we could drop it now?

# Assume tag exists
tag = dcm_data[(0x29, element_no)]
try:
tag = dcm_data[(0x29, element_no)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moloney Can you add a comment about when this would fail, and why None is an OK value to return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note about why it may fail. The docstring includes info about returning None.

@matthew-brett
Copy link
Member

Brendan - can I help with this one?

@matthew-brett
Copy link
Member

Brendan - what news? Do you have time to take a look?

moloney added 3 commits March 2, 2016 18:54
Allows us to load data where the PrivateCreator is present but
the element containing the header info is not. Ran into this with
anonymized data.
Include a comment about why the tag might be missing.
Move pydicom import back to top level of module since we need its
version info for skipping the test, plus this removes duplicate
logic for importing 'pydicom' vs 'dicom'. Updated
test_csa_header_read to use the top level import as well.
@matthew-brett
Copy link
Member

Great - thanks for finishing this one up. Ben - any more comments before I merge?

@matthew-brett
Copy link
Member

Thanks - Brendan - merging as is, Ben feel free to follow up here with comments if you have them, we'll address them with a new PR.

matthew-brett added a commit that referenced this pull request Mar 6, 2016
BF+TST: Skip over missing CSA header elem instead of raising.

Allows us to load data where the PrivateCreator is present but
the element containing the header info is not. Ran into this with
anonymized data.
@matthew-brett matthew-brett merged commit 3f873a7 into nipy:master Mar 6, 2016
grlee77 pushed a commit to grlee77/nibabel that referenced this pull request Mar 15, 2016
BF+TST: Skip over missing CSA header elem instead of raising.

Allows us to load data where the PrivateCreator is present but
the element containing the header info is not. Ran into this with
anonymized data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants