annotate Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py @ 4002:02e61695cd83

style
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jun 2020 10:58:36 +0200
parents 76b3228f99b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/usr/bin/python
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 import os
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 import subprocess
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 SOURCE = '/home/jodogne/Downloads/dcmtk-3.6.0/dcmwlm/data/wlistdb/OFFIS/'
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 TARGET = os.path.abspath(os.path.dirname(__file__))
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
3587
76b3228f99b0 Sort file lists
Bernhard M. Wiedemann <bernhard+hgcommit@lsmod.de>
parents: 1802
diff changeset
9 for f in sorted(os.listdir(SOURCE)):
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 ext = os.path.splitext(f)
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 if ext[1].lower() == '.dump':
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 subprocess.check_call([
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 'dump2dcm',
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 '-g',
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 '-q',
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 os.path.join(SOURCE, f),
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 os.path.join(TARGET, ext[0].lower() + '.wl'),
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 ])