コード例 #1
0
ファイル: default_tasks.py プロジェクト: rmatsuda/invesalius3
 def __bind_events(self):
     self.fold_panel.Bind(fpb.EVT_CAPTIONBAR, self.OnFoldPressCaption)
     Publisher.subscribe(self.OnEnableState, "Enable state project")
     Publisher.subscribe(self.OnOverwrite, 'Create surface from index')
     Publisher.subscribe(self.OnFoldSurface, 'Fold surface task')
     Publisher.subscribe(self.OnFoldExport, 'Fold export task')
     Publisher.subscribe(self.SetNavigationMode, "Set navigation mode")
コード例 #2
0
 def __bind_events(self):
     Publisher.subscribe(self._FoldSurface,
                              'Fold surface task')
     Publisher.subscribe(self._FoldSurface,
                              'Fold surface page')
     Publisher.subscribe(self._FoldMeasure,
                              'Fold measure task')
     Publisher.subscribe(self._FoldMask,
                              'Fold mask task')
     Publisher.subscribe(self._FoldMask,
                              'Fold mask page')
コード例 #3
0
    def __bind_evt(self):

        self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.RightButton, self.tree_node)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected,
                  self.tree_node)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected,
                  self.tree_node)
        self.Bind(wx.EVT_BUTTON, self.OnButtonAdd, self.btn_add)
        self.Bind(wx.EVT_BUTTON, self.OnButtonRemove, self.btn_remove)
        self.Bind(wx.EVT_BUTTON, self.OnButtonCheck, self.btn_check)

        self.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.EndEdition, self.tree_node)

        Publisher.subscribe(self.CheckItemDict, "Check item dict")
        Publisher.subscribe(self.GetHostsList, "Get NodesPanel host list")
コード例 #4
0
    def __bind_events(self):
        Publisher.subscribe(self.CheckWindowLevelOther,
                            'Check window and level other')
        Publisher.subscribe(self.FirstItemSelect,
                            'Select first item from slice menu')
        Publisher.subscribe(self._close, 'Close project data')

        Publisher.subscribe(self._check_projection_menu,
                            'Check projection menu')
コード例 #5
0
ファイル: app.py プロジェクト: rmatsuda/invesalius3
def main(connection=None):
    """
    Start InVesalius.

    Parameters:
        connection: An object to communicate with the outside world.
          In theory, can be any object supports certain function calls.
          See invesalius.net.neuronavigation_api for a comprehensive
          description of how the object is used.

          Note that if InVesalius is started in the usual way by running
          app.py, the connection object defaults to None. To enable this
          functionality, InVesalius needs to be started by calling the main
          function directly with a proper connection object.
    """
    init()

    args = parse_command_line()

    session = ses.Session()
    session.debug = args.debug

    if args.debug:
        Publisher.subscribe(print_events, Publisher.ALL_TOPICS)

    if args.remote_host is not None:
        from invesalius.net.remote_control import RemoteControl

        remote_control = RemoteControl(args.remote_host)
        remote_control.connect()

    if args.use_pedal:
        from invesalius.net.pedal_connection import PedalConnection

        PedalConnection().start()

    from invesalius.net.neuronavigation_api import NeuronavigationApi

    NeuronavigationApi(connection)

    if args.no_gui:
        non_gui_startup(args)
    else:
        application = InVesalius(0)
        application.MainLoop()
コード例 #6
0
 def __bind_pubsub(self):
     Publisher.subscribe(self.ShowBitmapByPosition,
                         'Set bitmap in preview panel')
     Publisher.subscribe(self.UpdateMaxValueSliderBar,
                         'Update max of slidebar in single preview image')
     Publisher.subscribe(self.ShowBlackSlice,
                         'Show black slice in single preview image')
コード例 #7
0
ファイル: data_notebook.py プロジェクト: rmatsuda/invesalius3
    def __init_evt(self):
        Publisher.subscribe(self.AddSurface, 'Update surface info in GUI')
        Publisher.subscribe(self.EditSurfaceTransparency,
                            'Set surface transparency')
        Publisher.subscribe(self.EditSurfaceColour, 'Set surface colour')
        Publisher.subscribe(self.OnCloseProject, 'Close project data')
        Publisher.subscribe(self.OnHideSurface, 'Hide surface items')

        Publisher.subscribe(self.OnShowSingle, 'Show single surface')
        Publisher.subscribe(self.OnShowMultiple, 'Show multiple surfaces')
コード例 #8
0
ファイル: data_notebook.py プロジェクト: rmatsuda/invesalius3
    def __bind_events(self):
        Publisher.subscribe(self.AddMask, 'Add mask')
        Publisher.subscribe(self.EditMaskThreshold,
                            'Set mask threshold in notebook')
        Publisher.subscribe(self.EditMaskColour,
                            'Change mask colour in notebook')

        Publisher.subscribe(self.OnChangeCurrentMask, 'Change mask selected')
        Publisher.subscribe(self.__hide_current_mask, 'Hide current mask')
        Publisher.subscribe(self.__show_current_mask, 'Show current mask')
        Publisher.subscribe(self.OnCloseProject, 'Close project data')
コード例 #9
0
ファイル: data_notebook.py プロジェクト: rmatsuda/invesalius3
 def __init_evt(self):
     Publisher.subscribe(self.AddItem_, 'Update measurement info in GUI')
     Publisher.subscribe(self.EditItemColour, 'Set measurement colour')
     Publisher.subscribe(self.OnCloseProject, 'Close project data')
     Publisher.subscribe(self.OnShowSingle, 'Show single measurement')
     Publisher.subscribe(self.OnShowMultiple, 'Show multiple measurements')
     Publisher.subscribe(self.OnLoadData, 'Load measurement dict')
     Publisher.subscribe(self.OnRemoveGUIMeasure, 'Remove GUI measurement')
コード例 #10
0
 def __bind_events(self):
     Publisher.subscribe(self.CoilAtTarget, 'Coil at target')
     Publisher.subscribe(self.UpdateSerialPort, 'Update serial port')
コード例 #11
0
 def __bind_pubsub_evt(self):
     Publisher.subscribe(self.SelectSeries, 'Select series in import panel')
コード例 #12
0
 def __bind_pubsub_evt(self):
     #Publisher.subscribe(self.SelectSeries, 'Select series in import panel')
     Publisher.subscribe(self.Populate, 'Populate tree')
     Publisher.subscribe(self.SetHostsList, 'Set FindPanel hosts list')
コード例 #13
0
 def __bind_events(self):
     Publisher.subscribe(self.UpdateThresholdModes,
                         'Update threshold limits list')
コード例 #14
0
ファイル: default_tasks.py プロジェクト: rmatsuda/invesalius3
 def __bind_events(self):
     Publisher.subscribe(self.OnEnableState, "Enable state project")
コード例 #15
0
def use_cmd_optargs(options, args):
    # If debug argument...
    if options.debug:
        Publisher.subscribe(print_events, Publisher.ALL_TOPICS)
        session = ses.Session()
        session.debug = 1

    # If import DICOM argument...
    if options.dicom_dir:
        import_dir = options.dicom_dir
        Publisher.sendMessage('Import directory',
                              directory=import_dir,
                              use_gui=not options.no_gui)

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

        check_for_export(options)

        return True
    elif options.import_folder:
        Publisher.sendMessage('Import folder', folder=options.import_folder)
        if options.save:
            Publisher.sendMessage('Save project',
                                  filepath=os.path.abspath(options.save))
            exit(0)
        check_for_export(options)

    elif options.import_all:
        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,
                                      use_gui=not options.no_gui)
                check_for_export(options,
                                 suffix=group.title,
                                 remove_surfaces=False)
                Publisher.sendMessage('Remove masks', mask_indexes=(0, ))
        return True

    # Check if there is a file path somewhere in what the user wrote
    # In case there is, try opening as it was a inv3
    else:
        for arg in reversed(args):

            file = utils.decode(arg, FS_ENCODE)
            if os.path.isfile(file):
                path = os.path.abspath(file)
                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', filepath=path)
                check_for_export(options)
                return True

    return False
コード例 #16
0
    def __bind_events(self):
        Publisher.subscribe(self.AddNewActor, 'Create surface')
        Publisher.subscribe(self.SetActorTransparency,
                                 'Set surface transparency')
        Publisher.subscribe(self.SetActorColour,
                                 'Set surface colour')

        Publisher.subscribe(self.OnChangeSurfaceName, 'Change surface name')
        Publisher.subscribe(self.OnShowSurface, 'Show surface')
        Publisher.subscribe(self.OnExportSurface,'Export surface to file')
        Publisher.subscribe(self.OnLoadSurfaceDict, 'Load surface dict')
        Publisher.subscribe(self.OnCloseProject, 'Close project data')
        Publisher.subscribe(self.OnSelectSurface, 'Change surface selected')
        #----
        Publisher.subscribe(self.OnSplitSurface, 'Split surface')
        Publisher.subscribe(self.OnLargestSurface,
                                'Create surface from largest region')
        Publisher.subscribe(self.OnSeedSurface, "Create surface from seeds")

        Publisher.subscribe(self.OnDuplicate, "Duplicate surfaces")
        Publisher.subscribe(self.OnRemove,"Remove surfaces")
        Publisher.subscribe(self.UpdateSurfaceInterpolation, 'Update Surface Interpolation')

        Publisher.subscribe(self.OnImportSurfaceFile, 'Import surface file')

        Publisher.subscribe(self.UpdateConvert2InvFlag, 'Update convert2inv flag')

        Publisher.subscribe(self.CreateSurfaceFromPolydata, 'Create surface from polydata')
コード例 #17
0
 def __init__(self):
     Publisher.subscribe(self.CancelLoad, "Cancel bitmap load")
コード例 #18
0
 def __bind_evt(self):
     Publisher.subscribe(self.ShowDicomSeries, 'Load dicom preview')
     Publisher.subscribe(self.SetDicomSeries,
                         'Load group into import panel')
     Publisher.subscribe(self.SetPatientSeries,
                         'Load patient into import panel')
コード例 #19
0
ファイル: preferences.py プロジェクト: rmatsuda/invesalius3
 def __bind_events(self):
     Publisher.subscribe(self.LoadPreferences, "Load Preferences")
コード例 #20
0
ファイル: volume.py プロジェクト: rmatsuda/invesalius3
 def __bind_events(self):
     Publisher.subscribe(self.Reset, 'Reset Cut Plane')
     Publisher.subscribe(self.Enable, 'Enable Cut Plane')
     Publisher.subscribe(self.Disable, 'Disable Cut Plane')
コード例 #21
0
 def __bind_events(self):
     Publisher.subscribe(self.OnUpdateNavigationStatus, 'Navigation status')
コード例 #22
0
 def __bind_evt(self):
     Publisher.subscribe(self.SetHostsList, 'Set FindPanel hosts list')
     #Publisher.subscribe(self.ShowDicomSeries, 'Load dicom preview')
     #Publisher.subscribe(self.SetDicomSeries, 'Load group into import panel')
     #Publisher.subscribe(self.SetPatientSeries, 'Load patient into import panel')
     pass
コード例 #23
0
ファイル: control.py プロジェクト: rmatsuda/invesalius3
    def __bind_events(self):
        Publisher.subscribe(self.OnImportMedicalImages, 'Import directory')
        Publisher.subscribe(self.OnImportGroup, 'Import group')
        Publisher.subscribe(self.OnImportFolder, 'Import folder')
        Publisher.subscribe(self.OnShowDialogImportDirectory,
                            'Show import directory dialog')
        Publisher.subscribe(self.OnShowDialogImportOtherFiles,
                            'Show import other files dialog')
        Publisher.subscribe(self.OnShowDialogOpenProject,
                            'Show open project dialog')

        Publisher.subscribe(self.OnShowDialogSaveProject, 'Show save dialog')

        Publisher.subscribe(self.LoadRaycastingPreset,
                            'Load raycasting preset')
        Publisher.subscribe(self.SaveRaycastingPreset,
                            'Save raycasting preset')
        Publisher.subscribe(self.OnOpenDicomGroup, 'Open DICOM group')
        Publisher.subscribe(self.OnOpenBitmapFiles, 'Open bitmap files')
        Publisher.subscribe(self.OnOpenOtherFiles, 'Open other files')
        Publisher.subscribe(self.Progress, "Update dicom load")
        Publisher.subscribe(self.Progress, "Update bitmap load")
        Publisher.subscribe(self.OnLoadImportPanel, "End dicom load")
        Publisher.subscribe(self.OnLoadImportBitmapPanel, "End bitmap load")
        Publisher.subscribe(self.OnCancelImport, 'Cancel DICOM load')
        Publisher.subscribe(self.OnCancelImportBitmap, 'Cancel bitmap load')

        Publisher.subscribe(self.OnShowDialogCloseProject, 'Close Project')
        Publisher.subscribe(self.OnOpenProject, 'Open project')
        Publisher.subscribe(self.OnOpenRecentProject, 'Open recent project')
        Publisher.subscribe(self.OnShowBitmapFile, 'Show bitmap dialog')

        Publisher.subscribe(self.ShowBooleanOpDialog, 'Show boolean dialog')

        Publisher.subscribe(self.ApplyReorientation, 'Apply reorientation')

        Publisher.subscribe(self.SetBitmapSpacing, 'Set bitmap spacing')

        Publisher.subscribe(self.OnSaveProject, 'Save project')

        Publisher.subscribe(self.create_project_from_matrix,
                            'Create project from matrix')

        Publisher.subscribe(self.show_mask_preview, 'Show mask preview')

        Publisher.subscribe(self.enable_mask_preview, 'Enable mask 3D preview')
        Publisher.subscribe(self.disable_mask_preview,
                            'Disable mask 3D preview')
        Publisher.subscribe(self.update_mask_preview, 'Update mask 3D preview')
コード例 #24
0
 def __bind_events(self):
     Publisher.subscribe(self._Exit, 'Exit')
コード例 #25
0
ファイル: volume.py プロジェクト: rmatsuda/invesalius3
    def __bind_events(self):
        Publisher.subscribe(self.OnHideVolume, 'Hide raycasting volume')
        Publisher.subscribe(self.OnUpdatePreset, 'Update raycasting preset')
        Publisher.subscribe(self.OnSetCurve, 'Set raycasting curve')
        Publisher.subscribe(self.OnSetWindowLevel, 'Set raycasting wwwl')
        Publisher.subscribe(self.Refresh, 'Set raycasting refresh')
        Publisher.subscribe(self.OnSetRelativeWindowLevel,
                            'Set raycasting relative window and level')
        Publisher.subscribe(self.OnEnableTool, 'Enable raycasting tool')
        Publisher.subscribe(self.OnCloseProject, 'Close project data')
        Publisher.subscribe(self.ChangeBackgroundColour,
                            'Change volume viewer background colour')

        Publisher.subscribe(self.ResetRayCasting, 'Reset Raycasting')

        Publisher.subscribe(self.OnFlipVolume, 'Flip volume')
コード例 #26
0
 def __bind_events(self):
     Publisher.subscribe(self.ShowRaycastingWidget,
                         'Show raycasting widget')
     Publisher.subscribe(self.HideRaycastingWidget,
                         'Hide raycasting widget')
     Publisher.subscribe(self.OnSetRaycastPreset,
                         'Update raycasting preset')
     Publisher.subscribe(self.RefreshPoints,
                         'Refresh raycasting widget points')
     Publisher.subscribe(self.LoadHistogram, 'Load histogram')
     Publisher.subscribe(self._Exit, 'Exit')
コード例 #27
0
 def _bind_pubsubevt(self):
     Publisher.subscribe(self.ShowBitmapPreview, "Load import bitmap panel")
     Publisher.subscribe(self.GetSelectedImages, "Selected Import Images")
コード例 #28
0
 def __bind_events(self):
     Publisher.subscribe(self.ChangeButtonColour,
                         'Change volume viewer gui colour')
     Publisher.subscribe(self.DisablePreset, 'Close project data')
     Publisher.subscribe(self.Uncheck, 'Uncheck image plane menu')
     Publisher.subscribe(self.DisableVolumeCutMenu,
                         'Disable volume cut menu')
     Publisher.subscribe(self.StatusTargetSelected, 'Target selected')
     Publisher.subscribe(self.StatusObjTracker, 'Status target button')
     Publisher.subscribe(self.ActiveTarget, 'Active target button')
     Publisher.subscribe(self.DeactiveTarget, 'Deactive target button')
コード例 #29
0
 def __bind_evt(self):
     Publisher.subscribe(self.SetBitmapFiles,
                         'Load bitmap into import panel')
コード例 #30
0
 def __init__(self):
     Publisher.subscribe(self.CancelLoad, "Cancel DICOM load")