Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using kwargs protocol from pypubsub (args1 deprecated) closes #141 #143

Merged
merged 67 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
45f594a
changed parameters to pubsub_evt
tfmoraes Jul 11, 2018
b822184
Starting and load gui without problems
tfmoraes Jul 11, 2018
cd7edc9
DICOM reader progress
tfmoraes Jul 11, 2018
076db94
Showing import panel
tfmoraes Jul 11, 2018
f989cb1
Selecting and slicing in dicom import panel is working
tfmoraes Jul 12, 2018
baf570c
almost loading slices
tfmoraes Jul 12, 2018
86a8523
Opening and show dicom slices and slicing
tfmoraes Jul 12, 2018
ddd469d
Importing dicom from cmdline working again
tfmoraes Jul 13, 2018
62e6a82
Opening inv3 project from recent list
tfmoraes Jul 13, 2018
552d6f2
Opening inv3 project from cmdline
tfmoraes Jul 13, 2018
c6d2f1b
Opening analyze files
tfmoraes Jul 13, 2018
9038209
Opening bitmap files
tfmoraes Jul 13, 2018
3de0eb5
hiding and showing task panel working again
tfmoraes Jul 13, 2018
91d2acf
Close project working again
tfmoraes Jul 14, 2018
979e41d
Changing threshold working again
tfmoraes Jul 14, 2018
d388258
editor working again
tfmoraes Jul 14, 2018
9a52988
editor working again
tfmoraes Jul 14, 2018
84908e3
measurement working again
tfmoraes Jul 16, 2018
ea595e5
Exit working again
tfmoraes Jul 16, 2018
3ffc433
Creating surface from mask
tfmoraes Jul 16, 2018
754e466
Remove, copy and import surface working again
tfmoraes Jul 16, 2018
fc15e53
Clean mask working again
tfmoraes Jul 16, 2018
db6abe3
Export surface and pictures working again
tfmoraes Jul 16, 2018
56ab9c6
Remove and copy mask working again
tfmoraes Jul 17, 2018
4adc6b5
Change name and color from mask working again
tfmoraes Jul 17, 2018
0d5cead
change surface and measurement name working again
tfmoraes Jul 17, 2018
26a8e4c
change measurement visibility and remove measurement working again
tfmoraes Jul 17, 2018
2646529
change surface visibility working again
tfmoraes Jul 17, 2018
976688b
undo redo working again
tfmoraes Jul 17, 2018
c52cb88
raycasting working again
tfmoraes Jul 18, 2018
32b1501
raycasting working again
tfmoraes Jul 18, 2018
bf0df1e
slice planes working again
tfmoraes Jul 18, 2018
49db7af
Stereo mode working again
tfmoraes Jul 18, 2018
bcafcbf
ww&wl preset and pseudo colors working again
tfmoraes Jul 18, 2018
184321c
Projection (MIP) working again
tfmoraes Jul 18, 2018
289ed4b
watershed working again
tfmoraes Jul 19, 2018
79c8cdc
set interpolation working again
tfmoraes Jul 19, 2018
3356fb6
cross working again
tfmoraes Jul 19, 2018
bf271b0
Preferences working again
tfmoraes Jul 19, 2018
6c4625d
Reorientation tool working again
tfmoraes Jul 19, 2018
c8102cf
swap and flip slice and mask are working again
tfmoraes Jul 19, 2018
66a3c3b
mask boolean operations working again
tfmoraes Jul 20, 2018
9e8c89c
fill holes auto and manual working again
tfmoraes Jul 20, 2018
3008a82
remove and select parts working again
tfmoraes Jul 20, 2018
3b84525
crop mask working again
tfmoraes Jul 20, 2018
7770e33
menu to segmentation tools working again
tfmoraes Jul 20, 2018
206e866
Command line options working again
tfmoraes Jul 20, 2018
37f6ace
Entering in navigation mode working again
tfmoraes Jul 25, 2018
cf8f882
callibration with debug navigator working again
tfmoraes Jul 25, 2018
40ab571
neuronavigating
tfmoraes Jul 25, 2018
7afd404
deleting markers in navigator
tfmoraes Jul 25, 2018
695f3ed
navigator and surface things
tfmoraes Jul 26, 2018
103aa94
more thing in navigation
tfmoraes Jul 26, 2018
8479687
surface tools working again
tfmoraes Aug 1, 2018
fffdd9e
More measure pubsub
tfmoraes Aug 6, 2018
605f1e0
task_slice pubsub arg1 things
tfmoraes Aug 6, 2018
d9cedc0
import panel pubsub_evt things
tfmoraes Aug 6, 2018
9dbf17f
frame pubsub_evt things
tfmoraes Aug 6, 2018
8c2644e
frame pubsub_evt things
tfmoraes Aug 6, 2018
4682bc2
removed pubsub_evt from frame
tfmoraes Aug 9, 2018
f16e4da
removed pubsub_evt from dialog, default_viewers and task_surface
tfmoraes Aug 9, 2018
24deb03
Saving raycasting preset working again
tfmoraes Aug 9, 2018
993cb79
removed pubsub_evt from slice and viewer_slice
tfmoraes Aug 9, 2018
667e025
removed pubsub_evt from styles
tfmoraes Aug 13, 2018
3e5bf87
removed pubsub_evt from volume
tfmoraes Aug 13, 2018
6350b7f
removed pubsub_evt from volume and viewer_volume
tfmoraes Aug 13, 2018
395d325
the rest of code using pubsub_evt
tfmoraes Aug 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
except ImportError:
from wx import SplashScreen
#from wx.lib.pubsub import setupv1 #new wx
from wx.lib.pubsub import setuparg1# as psv1
# from wx.lib.pubsub import setuparg1# as psv1
#from wx.lib.pubsub import Publisher
#import wx.lib.pubsub as ps
from wx.lib.pubsub import pub as Publisher
Expand Down Expand Up @@ -117,7 +117,7 @@ def MacOpenFile(self, filename):
Open drag & drop files under darwin
"""
path = os.path.abspath(filename)
Publisher.sendMessage('Open project', path)
Publisher.sendMessage('Open project', filepath=path)

def Startup2(self):
self.control = self.splash.control
Expand Down Expand Up @@ -347,10 +347,10 @@ def use_cmd_optargs(options, args):
# If import DICOM argument...
if options.dicom_dir:
import_dir = options.dicom_dir
Publisher.sendMessage('Import directory', {'directory': import_dir, 'gui': not options.no_gui})
Publisher.sendMessage('Import directory', directory=import_dir, use_gui=not options.no_gui)

if options.save:
Publisher.sendMessage('Save project', os.path.abspath(options.save))
Publisher.sendMessage('Save project', filepath=os.path.abspath(options.save))
exit(0)

check_for_export(options)
Expand All @@ -360,9 +360,11 @@ def use_cmd_optargs(options, args):
import invesalius.reader.dicom_reader as dcm
for patient in dcm.GetDicomGroups(options.import_all):
for group in patient.GetGroups():
Publisher.sendMessage('Import group', {'group': group, 'gui': not options.no_gui})
Publisher.sendMessage('Import group',
group=group,
use_gui=not options.no_gui)
check_for_export(options, suffix=group.title, remove_surfaces=False)
Publisher.sendMessage('Remove masks', [0])
Publisher.sendMessage('Remove masks', mask_indexes=(0,))
return True

# Check if there is a file path somewhere in what the user wrote
Expand All @@ -373,14 +375,14 @@ def use_cmd_optargs(options, args):
file = utils.decode(arg, FS_ENCODE)
if os.path.isfile(file):
path = os.path.abspath(file)
Publisher.sendMessage('Open project', path)
Publisher.sendMessage('Open project', filepath=path)
check_for_export(options)
return True

file = utils.decode(arg, sys.stdin.encoding)
if os.path.isfile(file):
path = os.path.abspath(file)
Publisher.sendMessage('Open project', path)
Publisher.sendMessage('Open project', filepath=path)
check_for_export(options)
return True

Expand Down Expand Up @@ -428,7 +430,8 @@ def check_for_export(options, suffix='', remove_surfaces=False):
def export(path_, threshold_range, remove_surface=False):
import invesalius.constants as const

Publisher.sendMessage('Set threshold values', threshold_range)
Publisher.sendMessage('Set threshold values',
threshold_range=threshold_range)

surface_options = {
'method': {
Expand All @@ -443,17 +446,20 @@ def export(path_, threshold_range, remove_surface=False):
'overwrite': False,
}
}
Publisher.sendMessage('Create surface from index', surface_options)
Publisher.sendMessage('Export surface to file', (path_, const.FILETYPE_STL))
Publisher.sendMessage('Create surface from index',
surface_parameters=surface_options)
Publisher.sendMessage('Export surface to file',
filename=path_, filetype=const.FILETYPE_STL)
if remove_surface:
Publisher.sendMessage('Remove surfaces', [0])
Publisher.sendMessage('Remove surfaces',
surface_indexes=(0,))


def print_events(data):
def print_events(topic=Publisher.AUTO_TOPIC, **msg_data):
"""
Print pubsub messages
"""
utils.debug(data.topic)
utils.debug("%s\n\tParameters: %s" % (topic, msg_data))

def main():
"""
Expand Down
Loading