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

Make Certain Dataset Fields Optional #8

Closed
awtkns opened this issue Feb 23, 2021 · 0 comments · Fixed by #9
Closed

Make Certain Dataset Fields Optional #8

awtkns opened this issue Feb 23, 2021 · 0 comments · Fixed by #9

Comments

@awtkns
Copy link
Contributor

awtkns commented Feb 23, 2021

Opened from a comment on blog post.

PatientAge is optional information. It seems the utils requires PatientAge.

I have a CT dataset that has no PatientAge. The code would be crashed.

Traceback (most recent call last):
File “convert_nifti_segments_2_dicom.py”, line 6, in
rtstruct = RTStructBuilder.create_new(dicom_series_path=”./chest_CT”)
File “/home/gchen/anaconda3/lib/python3.8/site-packages/rt_utils/rtstruct_builder.py”, line 20, in create_new
ds = ds_helper.create_rtstruct_dataset(series_data)
File “/home/gchen/anaconda3/lib/python3.8/site-packages/rt_utils/ds_helper.py”, line 16, in create_rtstruct_dataset
add_patient_information(ds, series_data)
File “/home/gchen/anaconda3/lib/python3.8/site-packages/rt_utils/ds_helper.py”, line 84, in add_patient_information
ds.PatientAge = reference_ds.PatientAge
File “/home/gchen/anaconda3/lib/python3.8/site-packages/pydicom/dataset.py”, line 835, in __getattr__
return object.__getattribute__(self, name)
AttributeError: ‘FileDataset’ object has no attribute ‘PatientAge’

Is it possible to make PatientAge as an optional?

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 a pull request may close this issue.

1 participant