Commit fd6f8eae7a736841804f7e5a6ac21e633ff8a5fa

Authored by Paulo Henrique Junqueira Amorim
1 parent 32adc68e

FIX: Bug in the cancel load of the files

Showing 1 changed file with 6 additions and 3 deletions   Show diff stats
invesalius/gui/import_panel.py
@@ -137,6 +137,8 @@ class TextPanel(wx.Panel): @@ -137,6 +137,8 @@ class TextPanel(wx.Panel):
137 137
138 first = 0 138 first = 0
139 for patient in patient_list: 139 for patient in patient_list:
  140 + if not isinstance(patient, dcm.PatientGroup):
  141 + return None
140 ngroups = patient.ngroups 142 ngroups = patient.ngroups
141 dicom = patient.GetDicomSample() 143 dicom = patient.GetDicomSample()
142 title = dicom.patient.name + " (%d series)"%(ngroups) 144 title = dicom.patient.name + " (%d series)"%(ngroups)
@@ -307,9 +309,10 @@ class SeriesPanel(wx.Panel): @@ -307,9 +309,10 @@ class SeriesPanel(wx.Panel):
307 309
308 def ShowDicomSeries(self, pubsub_evt): 310 def ShowDicomSeries(self, pubsub_evt):
309 patient = pubsub_evt.data 311 patient = pubsub_evt.data
310 - self.serie_preview.SetPatientGroups(patient)  
311 - self.dicom_preview.SetPatientGroups(patient)  
312 - 312 + if isinstance(patient, dcm.PatientGroup):
  313 + self.serie_preview.SetPatientGroups(patient)
  314 + self.dicom_preview.SetPatientGroups(patient)
  315 +
313 316
314 317
315 class SlicePanel(wx.Panel): 318 class SlicePanel(wx.Panel):