Commit a633461fb1cbe683bcf197793508115bb5a92aed
1 parent
95859bf7
Exists in
master
and in
68 other branches
FIX: It was missing a file in my last commit
Showing
1 changed file
with
2 additions
and
14 deletions
Show diff stats
invesalius/reader/dicom_reader.py
... | ... | @@ -16,27 +16,19 @@ |
16 | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | 17 | # detalhes. |
18 | 18 | #-------------------------------------------------------------------------- |
19 | -import glob | |
20 | -import math | |
21 | 19 | import os |
22 | 20 | import Queue |
23 | -import tempfile | |
24 | 21 | import threading |
25 | 22 | |
26 | 23 | from multiprocessing import cpu_count |
27 | 24 | |
28 | 25 | import vtk |
29 | -import vtkgdcm | |
30 | 26 | import gdcm |
31 | -import wx | |
32 | 27 | import wx.lib.pubsub as ps |
33 | 28 | |
34 | -from vtk.util.colors import yellow | |
35 | - | |
36 | 29 | import constants as const |
37 | 30 | import dicom |
38 | 31 | import dicom_grouper |
39 | -import data.imagedata_utils as iu | |
40 | 32 | import session |
41 | 33 | |
42 | 34 | def ReadDicomGroup(dir_): |
... | ... | @@ -79,16 +71,14 @@ def SortFiles(filelist, dicom): |
79 | 71 | return filelist |
80 | 72 | |
81 | 73 | class LoadDicom(threading.Thread): |
82 | - def __init__(self, grouper, tempdir, q, l): | |
74 | + def __init__(self, grouper, q, l): | |
83 | 75 | threading.Thread.__init__(self) |
84 | 76 | self.grouper = grouper |
85 | - self.tempdir = tempdir | |
86 | 77 | self.q = q |
87 | 78 | self.l = l |
88 | 79 | def run(self): |
89 | 80 | grouper = self.grouper |
90 | 81 | q = self.q |
91 | - tempdir = self.tempdir | |
92 | 82 | while 1: |
93 | 83 | filepath = q.get() |
94 | 84 | print "thread %s consumed %s" % (self.getName(), filepath) |
... | ... | @@ -101,7 +91,6 @@ class LoadDicom(threading.Thread): |
101 | 91 | dcm.SetParser(parser) |
102 | 92 | grouper.AddFile(dcm) |
103 | 93 | self.l.release() |
104 | - dcm.image.SetTempDir(tempdir) | |
105 | 94 | |
106 | 95 | |
107 | 96 | def yGetDicomGroups(directory, recursive=True, gui=True): |
... | ... | @@ -109,7 +98,6 @@ def yGetDicomGroups(directory, recursive=True, gui=True): |
109 | 98 | Return all full paths to DICOM files inside given directory. |
110 | 99 | """ |
111 | 100 | nfiles = 0 |
112 | - tempdir = tempfile.mkdtemp() | |
113 | 101 | # Find total number of files |
114 | 102 | if recursive: |
115 | 103 | for dirpath, dirnames, filenames in os.walk(directory): |
... | ... | @@ -124,7 +112,7 @@ def yGetDicomGroups(directory, recursive=True, gui=True): |
124 | 112 | l = threading.Lock() |
125 | 113 | threads = [] |
126 | 114 | for i in xrange(cpu_count()): |
127 | - t = LoadDicom(grouper, tempdir, q, l) | |
115 | + t = LoadDicom(grouper, q, l) | |
128 | 116 | t.start() |
129 | 117 | threads.append(t) |
130 | 118 | # Retrieve only DICOM files, splited into groups | ... | ... |