Skip to content

How can I get the value of a tag each dicom files in get_identifiers? #220

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

Closed
NirutaDhimal opened this issue Sep 24, 2022 · 9 comments
Closed

Comments

@NirutaDhimal
Copy link

NirutaDhimal commented Sep 24, 2022

How can I get the value of a tag of each dicom files in get_identifiers?

@vsoch
Copy link
Member

vsoch commented Sep 24, 2022

That function returns a dictionary that has all fields -> values. https://pydicom.github.io/deid/examples/func-replace/

@NirutaDhimal
Copy link
Author

Hi, can you please specify which function? The above link took me to examples section

@vsoch
Copy link
Member

vsoch commented Sep 28, 2022

Look on that page at:

items = get_identifiers(dicom_files, expand_sequences=True)

and see the example output below it. Try running it on your own to see the same.

@NirutaDhimal
Copy link
Author

Thanks

@vsoch
Copy link
Member

vsoch commented Sep 28, 2022

Sure thing! Closing, ping again if you need.

@vsoch vsoch closed this as completed Sep 28, 2022
@NirutaDhimal
Copy link
Author

NirutaDhimal commented Sep 28, 2022

I tried to implement
items = get_identifiers(dicom_files, expand_sequences=True)
but I am getting error
newerr1
newerr2
@vsoch Can you help here? What am I doing wrong?
I also checked deid documentation but I couldn't find any expand_sequences argument. https://deid.readthedocs.io/en/latest/source/deid.dicom.html?highlight=get_identifiers#deid.dicom.header.get_identifiers

@vsoch
Copy link
Member

vsoch commented Sep 28, 2022

Sorry about that must be a typo - the function has strip_sequences and not expand_sequences!

strip_sequences=False,

@vsoch
Copy link
Member

vsoch commented Sep 28, 2022

And actually, it's a bug! It should be there - it was erroneously removed. I'll get a PR in to fix it asap!

@vsoch
Copy link
Member

vsoch commented Sep 28, 2022

ok it's fixed! If you are using the older version the default for expand_sequences (internal to the function) is True, so safe to just move it from the above. Thanks for catching the error!

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

No branches or pull requests

2 participants