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

added asl-support content in utils.py and dicoms.py files #713

Closed
wants to merge 1 commit into from

Conversation

pbbaba
Copy link

@pbbaba pbbaba commented Oct 9, 2023

No description provided.

@@ -109,6 +109,11 @@ def create_seqinfo(mw: dw.Wrapper, series_files: list[str], series_id: str) -> S
date=dcminfo.get("AcquisitionDate"),
series_uid=dcminfo.get("SeriesInstanceUID"),
time=dcminfo.get("AcquisitionTime"),
# ASL support
in_plane_phase_encoding_direction = dcminfo.get("InPlanePhaseEncodingDirection") if dcminfo.get("InPlanePhaseEncodingDirection") else None,
Copy link
Member

Choose a reason for hiding this comment

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

just

Suggested change
in_plane_phase_encoding_direction = dcminfo.get("InPlanePhaseEncodingDirection") if dcminfo.get("InPlanePhaseEncodingDirection") else None,
in_plane_phase_encoding_direction = dcminfo.get("InPlanePhaseEncodingDirection"),

and so on would be sufficient. But first please elaborate why these particular are necessary for ASL support?
Note: we do not really want to extend list of extracted fields to get unnecessarily long.

NB I should really look into finishing #581 some days soon to provide means for easy extraction of any metadata desired.

@pbbaba
Copy link
Author

pbbaba commented Oct 9, 2023

I added the if..else condition so as to avoid the code break if any dicom image does not contain these headers. It did break for 'Image Orientation Patient' tag.

I added these extra tags so as to make them accessible for naming the perf files during the BIDS conversion.

@yarikoptic
Copy link
Member

I added the if..else condition so as to avoid the code break if any dicom image does not contain these headers. It did break for 'Image Orientation Patient' tag.

.get("key") should work and default to None if there is no "key". So code should not break and if..else hence not needed

@yarikoptic
Copy link
Member

ping @pbbaba - do you have time to tune up the PR following the review?

@pbbaba pbbaba closed this Jan 23, 2024
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.

2 participants