Studies failed to import - non-ASCII characters in RDSR?

11 views
Skip to first unread message

SAMUEL MAFRA DOS SANTOS

unread,
Nov 22, 2025, 11:43:19 PM (13 days ago) Nov 22
to OpenREM

Dear all,

I am currently running a local installation of version 0.10.0 on Windows 10 to test its use in our institution.

The installation was successful. I used the RDSR test files and they were imported correctly (using the openrem_rdsr.py command), and I am able to view and manage the data.

However, when using our own RDSR files from fluoroscopy procedures performed on a Siemens Artis Zee, only a few of them are imported correctly. When trying to bulk import, I receive the following traceback:

Traceback (most recent call last):
  File "C:\Python27\Scripts\openrem_rdsr.py", line 24, in <module>
    rdsr(filename)
  File "C:\Python27\lib\site-packages\celery\local.py", line 188, in __call__
    return self._get_current_object()(*a, **kw)
  File "C:\Python27\lib\site-packages\celery\app\task.py", line 428, in __call__
    return self.run(*args, **kwargs)
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 1658, in rdsr
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 1513, in _rdsr2db
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 1349, in _generalstudymoduleattributes
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 1111, in _projectionxrayradiationdose
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 640, in _irradiationeventxraydata
  File "C:\Python27\lib\site-packages\openrem\remapp\extractors\rdsr.py", line 453, in _irradiationeventxraysourcedata
    source.ii_field_size = fromstring(source.irradiation_event_xray_data.comment).find('iiDiameter').get('SRData')
  File "C:\Python27\lib\site-packages\fusedxml\common.py", line 126, in fromstring
    parser.feed(text)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1657, in feed
    self._parser.Parse(data, 0)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 127: ordinal not in range(128)

From the traceback, it appears that the error occurs when OpenREM tries to parse the irradiation_event_xray_data.comment field inside the RDSR. It looks like this comment contains non-ASCII characters, which causes the crash.

Is there a known fix or patch for handling non-ASCII characters in RDSR comments?

I apologize if this issue has already been addressed before.

I am attaching two SR files: one example that imports correctly and one that does not.

I appreciate any help regarding this. Thank you very much.

Samuel Mafra

patient_not_imporitng.dcm
patient_importing.dcm

Ed McDonagh

unread,
Nov 25, 2025, 5:51:07 PM (10 days ago) Nov 25
to OpenREM
Dear Samuel

Both of these RDSRs import without a problem into the v1.0 beta release.

We are going to get the full released out very soon, so please test with that version instead as soon as it is available. 

Kind regards

Ed

--
You received this message because you are subscribed to the Google Groups "OpenREM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrem+u...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/openrem/0ee79f75-09ad-41da-b4d0-4ca4ca9e4296n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages