Commit effbb9a2aa1544431774c17b256fffff9cfdd9f2

Authored by tfmoraes
1 parent 0bdbe4a2

FIX: fixed opening by the command line. Related to #132

Showing 1 changed file with 7 additions and 10 deletions   Show diff stats
invesalius/control.py
@@ -107,8 +107,6 @@ class Controller(): @@ -107,8 +107,6 @@ class Controller():
107 107
108 # Import project 108 # Import project
109 dirpath = dialog.ShowImportDirDialog() 109 dirpath = dialog.ShowImportDirDialog()
110 - ###  
111 - print dirpath  
112 if dirpath and not os.listdir(dirpath): 110 if dirpath and not os.listdir(dirpath):
113 dialog.ImportEmptyDirectory(dirpath) 111 dialog.ImportEmptyDirectory(dirpath)
114 elif dirpath: 112 elif dirpath:
@@ -149,28 +147,27 @@ class Controller(): @@ -149,28 +147,27 @@ class Controller():
149 147
150 148
151 def ShowDialogCloseProject(self): 149 def ShowDialogCloseProject(self):
152 - print "ShowDialogCloseProject" 150 + utils.debug("ShowDialogCloseProject")
153 session = ses.Session() 151 session = ses.Session()
154 st = session.project_status 152 st = session.project_status
155 - print "* st", st  
156 if st == const.PROJ_CLOSE: 153 if st == const.PROJ_CLOSE:
157 return -1 154 return -1
158 filename = session.project_path[1] 155 filename = session.project_path[1]
159 if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE): 156 if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE):
160 answer = dialog.SaveChangesDialog(filename) 157 answer = dialog.SaveChangesDialog(filename)
161 if not answer: 158 if not answer:
162 - print "Close without changes" 159 + utils.debug("Close without changes")
163 self.CloseProject() 160 self.CloseProject()
164 ps.Publisher().sendMessage("Enable state project", False) 161 ps.Publisher().sendMessage("Enable state project", False)
165 ps.Publisher().sendMessage('Set project name') 162 ps.Publisher().sendMessage('Set project name')
166 elif answer == 1: 163 elif answer == 1:
167 self.ShowDialogSaveProject() 164 self.ShowDialogSaveProject()
168 - print "Save changes and close" 165 + utils.debug("Save changes and close")
169 self.CloseProject() 166 self.CloseProject()
170 ps.Publisher().sendMessage("Enable state project", False) 167 ps.Publisher().sendMessage("Enable state project", False)
171 ps.Publisher().sendMessage('Set project name') 168 ps.Publisher().sendMessage('Set project name')
172 elif answer == -1: 169 elif answer == -1:
173 - print "Cancel" 170 + utils.debug("Cancel")
174 else: 171 else:
175 self.CloseProject() 172 self.CloseProject()
176 ps.Publisher().sendMessage("Enable state project", False) 173 ps.Publisher().sendMessage("Enable state project", False)
@@ -301,7 +298,7 @@ class Controller(): @@ -301,7 +298,7 @@ class Controller():
301 298
302 if len(patients_groups): 299 if len(patients_groups):
303 group = dcm.SelectLargerDicomGroup(patients_groups) 300 group = dcm.SelectLargerDicomGroup(patients_groups)
304 - imagedata, dicom = self.OpenDicomGroup(group, gui=True) 301 + imagedata, dicom = self.OpenDicomGroup(group, 0, gui=True)
305 self.CreateDicomProject(imagedata, dicom) 302 self.CreateDicomProject(imagedata, dicom)
306 # OPTION 2: ANALYZE? 303 # OPTION 2: ANALYZE?
307 else: 304 else:
@@ -310,7 +307,7 @@ class Controller(): @@ -310,7 +307,7 @@ class Controller():
310 self.CreateAnalyzeProject(imagedata) 307 self.CreateAnalyzeProject(imagedata)
311 # OPTION 3: Nothing... 308 # OPTION 3: Nothing...
312 else: 309 else:
313 - print "No medical images found on given directory" 310 + utils.debug("No medical images found on given directory")
314 return 311 return
315 self.LoadProject() 312 self.LoadProject()
316 ps.Publisher().sendMessage("Enable state project", True) 313 ps.Publisher().sendMessage("Enable state project", True)
@@ -395,7 +392,7 @@ class Controller(): @@ -395,7 +392,7 @@ class Controller():
395 interval += 1 392 interval += 1
396 filelist = dicom_group.GetFilenameList()[::interval] 393 filelist = dicom_group.GetFilenameList()[::interval]
397 if not filelist: 394 if not filelist:
398 - print ">Not used the IPPSorter" 395 + utils.debug("Not used the IPPSorter")
399 filelist = [i.image.file for i in dicom_group.GetHandSortedList()[::interval]] 396 filelist = [i.image.file for i in dicom_group.GetHandSortedList()[::interval]]
400 397
401 398