Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell_anonymize.py
More file actions
Latest commit
45 lines (37 loc) · 1.03 KB
/
Copy pathshell_anonymize.py
File metadata and controls
45 lines (37 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
__author__='bison'
importsys
importos
importshutil
importcore
fromLadenUndSpeichernWLimportladenWL2aslW
sourceDir=''
destDir=''
iflen(sys.argv) !=3:
print'Arguments have to be: "source_path" "dest_path"'
exit(1)
#sourceDir = '/home/bison/Dokumente/test/001_Anatomie_UK_Patient_1/DVT UK Patient 1'
#destDir = '/home/bison/Dokumente/test/tmp'
else:
sourceDir=sys.argv[1]
destDir=sys.argv[2]
files=core.getFilesFromDir(sourceDir)
ifnotfiles:
print'no DICOM files found!'
exit(1)
wl=lW.WhiteList()
categorys=wl.categoryListFiles('lists')
holdingTags= []
forwhiteListincategorys['tags_to_hold']:
holdingTags.append(wl.mainReadWhiteList('lists/tags_to_hold/'+whiteList+'.txt'))
printholdingTags
forfinfiles:
baseName=os.path.basename(f)
dstFile=os.path.join(destDir, baseName)
printf
#print dstFile
#print 10*'*'
core.anonymize_byWhitelist(holdingTags, f, dstFile)
#print f
#baseName = os.path.basename(f)
#shutil.copy(f, os.path.join(destDir, baseName))
#core.anonymize_byWhitelist()