FNNDSC / FNNDSC/med2image

can not assume most of dicom fields are there

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
205
Forks
57
PR merge metrics
No merged PRs in 30d

Description

It is only safe to assume we have study, series, and sop uids...
we should make sure the other ones are available.

```
chris@chris:/neuro/users/chris/log $>cd /neuro/users/chris/data/MR_SERVICE_PATIENT_ID_1-1545/2015.03.20-055Y-20150320_0642-3021/097_HeadMatrix_H1P_H2P_H3P_H4P_Tra_sn-097_HeadMatrix_H1P_H2P_H3P_H4P_Tra_sn-35027; /net/tautona/neuro/labs/grantlab/users/chris/src/chrisreloaded/lib/med2image/med2image.py -i $(/bin/ls -1 *dcm | head -n 1) -o %inputFile%SeriesDescription%ProtocolName -t jpg -s m
Mon Mar 23 05:58:19 2015 chris med2image.py[11072]: Converting DICOM image.
Mon Mar 23 05:58:19 2015 chris med2image.py[11072]: PatientName: SERVICE PATIENT
Traceback (most recent call last):
File "/net/tautona/neuro/labs/grantlab/users/chris/src/chrisreloaded/lib/med2image/med2image.py", line 568, in
C_convert.run()
File "/net/tautona/neuro/labs/grantlab/users/chris/src/chrisreloaded/lib/med2image/med2image.py", line 250, in run
self._log('PatientAge: %s\n' % self._dcm.PatientAge)
File "/usr/lib/python2.7/dist-packages/dicom/dataset.py", line 248, in __getattr__
"'{0:s}'.".format(name))
AttributeError: Dataset does not have attribute 'PatientAge'.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lib/med2image/med2image.py at line 250, where the conversion run accesses PatientAge, and inspect the other DICOM fields used there. Reproduce the reported command with a DICOM file missing optional fields. Done means conversion no longer fails when fields beyond study, series, and SOP UIDs are absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.