Issue #9 resolved

Enable import of *. dcm

Ed McDonagh
created an issue

Enhancement request from David Platten - would be nice to be able to write openrem_rdsr *.dcm to import a folder full of files at once

Comments (20)

  1. Jonathan Cole

    I've made a quick patch to fix this in the short term. I've put it in my fork. It allows a directory as an argument and processes all DCM files in that. A more elegant solution would be to allow a choice of file extension as an argument and optional processing of subdirectories, but this mitigates the issue for now.

  2. Ed McDonagh reporter

    Can you put in a pull request so I can see how that works. I'm hoping that the system will facilitate me taking that change without merging all your other changes.

  3. Ed McDonagh reporter

    A little googling suggests that this could actually work as David requested by simply assuming an array of strings will be passed. If used conventionally, the array will be one string long. If wildcards are used in the shell, then they will be expanded before openrem_rdsr.py sees it.

  4. Ed McDonagh reporter

    Modified the script portion of rdsr import to allow for mulitple arguments (files), or wildcard shell expansion such as *.dcm. Will need to be duplicated to the other import scripts. Refs #9.

    → <<cset 4b069c1f85fd>>

  5. Ed McDonagh reporter

    Fixes #9. Can now pass a list of dicom files to each of the rdsr, mg and ctphilips scripts. Typical syntax would be 'openrem_rdsr.py myfiles/*.dcm'. Will abandon other branch as it was too complicated for what was needed.

    → <<cset ea314ec35474>>

  6. Ed McDonagh reporter
    • changed status to open

    Reopening as the Windows cmd.exe shell doesn't do wildcard expansion, instead relying on the application to do it.

    Therefore passing *.dcm to openrem_rdsr.py will try and process the file *.dcm

  7. Ed McDonagh reporter

    Changed Windows path advise to match my install, added information about wildcard expansion for linux and that it doesn't currently work for the standard Windows shell (refs #9), changed styling of commands to be sourcecode.

    → <<cset 3fbb8a415746>>

  8. Ed McDonagh reporter

    Changing milestone from 0.4.0 to future for this re-opened issue due to Windows shells not expanding variables like linux and Windows powershells do.

  9. Ed McDonagh reporter

    Modified scripts to glob the filenames so that in Windows * wildcards will be expanded. Modified rdsr.py and ct_philips.py as they had a sys.exit if the study existed in the database, which then made the glob versions of the scripts stop. Should fix #9 again.

    → <<cset 57c06b5f7530>>

  10. Log in to comment