Commit 9af4cec46ce0921fa81cd1dfb9040c43178ca9c7
1 parent
b278e13c
Exists in
master
and in
6 other branches
ENH: Add skip slice option
Showing
1 changed file
with
9 additions
and
5 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -381,22 +381,26 @@ class Controller(): |
381 | 381 | |
382 | 382 | def OnOpenDicomGroup(self, pubsub_evt): |
383 | 383 | group, interval = pubsub_evt.data |
384 | - imagedata, dicom = self.OpenDicomGroup(group, gui=True) | |
384 | + imagedata, dicom = self.OpenDicomGroup(group, interval, gui=True) | |
385 | 385 | self.CreateDicomProject(imagedata, dicom) |
386 | 386 | self.LoadProject() |
387 | 387 | ps.Publisher().sendMessage("Enable state project", True) |
388 | 388 | |
389 | - def OpenDicomGroup(self, dicom_group, gui=True): | |
389 | + def OpenDicomGroup(self, dicom_group, interval, gui=True): | |
390 | 390 | |
391 | 391 | # Retrieve general DICOM headers |
392 | 392 | dicom = dicom_group.GetDicomSample() |
393 | 393 | |
394 | 394 | # Create imagedata |
395 | - filelist = dicom_group.GetFilenameList() | |
395 | + interval += 1 | |
396 | + filelist = dicom_group.GetFilenameList()[::interval] | |
396 | 397 | if not filelist: |
397 | 398 | print ">Not used the IPPSorter" |
398 | - filelist = [i.image.file for i in dicom_group.GetHandSortedList()] | |
399 | - zspacing = dicom_group.zspacing | |
399 | + filelist = [i.image.file for i in dicom_group.GetHandSortedList()[::interval]] | |
400 | + | |
401 | + | |
402 | + | |
403 | + zspacing = dicom_group.zspacing * interval | |
400 | 404 | size = dicom.image.size |
401 | 405 | bits = dicom.image.bits_allocad |
402 | 406 | ... | ... |