def _open_changed(self):
     """Handles the user clicking the 'Open...' button."""
     file_name = open_file(
         extensions=TextInfo(), filter='Python file (*.py)|*.py', id=demo_id
     )
     if file_name != '':
         self.file_name = file_name
Ejemplo n.º 2
0
 def _open_changed(self):
     """Handles the user clicking the 'Open...' button."""
     file_name = open_file(extensions=ImageInfo(),
                           filter=filters,
                           id=demo_id)
     if file_name != '':
         self.file_name = file_name
 def _open_changed(self):
     """ Handles the user clicking the 'Open...' button.
     """
     file_name = open_file(extensions=TextInfo(),
                           filter='Python file (*.py)|*.py',
                           id=demo_id)
     if file_name != '':
         self.file_name = file_name
 def _open_changed(self):
     """ Handles the user clicking the 'Open...' button.
     """
     file_name = open_file(extensions=ImageInfo(),
                           filter=filters,
                           id=demo_id)
     if file_name != '':
         self.file_name = file_name
Ejemplo n.º 5
0
def button_click(editor):
    if editor.use_dir:
        file_selected=open_directory(entries=20)
    else:
        file_selected=open_file(entries=20)
    if file_selected:
        editor.value=file_selected
    editor.ui.handler.reconstruct()
Ejemplo n.º 6
0
 def _open_changed(self):
     file_name = open_file()
     if file_name != '':
         f = open(file_name)
         for line in f:
             self.loaded_script += line
         self.model.script = self.loaded_script
         self.model.script_to_graph(self.model.script)
Ejemplo n.º 7
0
 def change_reference_volume(self):
     fpath = open_file(
         title="Choose Reverence Volume File",
         filter=["*.img", "*.hdr", "*.nii.gz", "*.nii"],
         file_name = self.save_path
                       )
     if fpath == "": return
     self.reference_volume = fpath
Ejemplo n.º 8
0
def button_click(editor):
    if editor.use_dir:
        file_selected = open_directory(entries=20)
    else:
        file_selected = open_file(entries=20)
    if file_selected:
        editor.value = file_selected
    editor.ui.handler.reconstruct()
Ejemplo n.º 9
0
 def add_ltpa_result(self):
     """ Adds streamlines to the working set"""
     fpath = open_file(title="Select Streamline File",
                       filter=["*.ltpa"],
                       file_name=os.path.expanduser("~"))
     if fpath == "": return
     try:
         lr = load_ltpa_results(fpath)
     except Exception, e:
         print "Unable to load", fpath, "because", e
         return
Ejemplo n.º 10
0
 def _open_data_file_event_fired(self):
     filename = open_file()
     if filename != "":
         try:
             f = open(filename)
             self.data_file = filename
             self._write_state(filename)
             self._load_all_data(f)
             f.close()
         except:
             pass
Ejemplo n.º 11
0
 def _open_changed(self):
     """ Handles the user clicking the 'Open...' button.
     """
     file_name = open_file()
     if file_name != '':
         self.file_name = file_name
         print("File selected: " + file_name)
         v, f = GetMesh(file_name)
         self.v = v
         self.f = f
         return ActorViewer().DoPlot(v, f)
Ejemplo n.º 12
0
 def add_ltpa_result(self):
     """ Adds streamlines to the working set"""
     fpath = open_file(title="Select Streamline File",
                    filter=["*.ltpa"],
         file_name = os.path.expanduser("~")
                    )
     if fpath == "": return
     try:
         lr = load_ltpa_results(fpath)
     except Exception,e:
         print "Unable to load", fpath, "because", e
         return
Ejemplo n.º 13
0
 def add_streamlines(self):
     """ Adds streamlines to the working set"""
     fpath = open_file(title="Select Streamline File",
                    filter=["*.txt","*.trk","*trk.gz","*.mat",
                            ],
         file_name = self.save_path
                    )
     if fpath == "": return
     try:
         tds = TrackDataset(fpath)
     except Exception,e:
         print "Unable to load", fpath, "because", e
         return
Ejemplo n.º 14
0
 def _load_button_changed(self):
     f = open_file(file_name=os.getcwd(),
                   extensions=[FileInfo()],
                   filter=['*.nxs', '*.dat'])
     self.filename = f
     if f != '':
         name, ext = os.path.splitext(f)
         if ext == '.nxs':
             self.load_and_extract_nexus(f)
             while self.file_thread.isAlive():
                 time.sleep(1)
             self.form_experiment()
         elif ext == '.dat':
             self.load_and_extract_dat_file(f)
Ejemplo n.º 15
0
    def _open_changed(self):
        """ Handles the user clicking the 'Open...' button.
        """
        file_name = open_file()
        if file_name != '':
            self.file_name = file_name
            print("File selected: " + file_name)
            o = np.loadtxt(file_name)
            self.o = o
            #y = alignoverlay(self.v,self.f,o)
            #v = self.v
            #f = self.f
            #self.o = o

            return ActorViewer().alignoverlaydraw(o)
Ejemplo n.º 16
0
 def add_streamlines(self):
     """ Adds streamlines to the working set"""
     fpath = open_file(title="Select Streamline File",
                       filter=[
                           "*.txt",
                           "*.trk",
                           "*trk.gz",
                           "*.mat",
                       ],
                       file_name=self.save_path)
     if fpath == "": return
     try:
         tds = TrackDataset(fpath)
     except Exception, e:
         print "Unable to load", fpath, "because", e
         return
Ejemplo n.º 17
0
    def _open_changed(self):
        """ Handles the user clicking the 'Open...' button.
        """
        file_name = open_file()
        if file_name != '':
            self.file_name = file_name
            print("File selected: " + file_name)

            AALv, L = GetAAL()  # AAL sourcemodel
            A = np.loadtxt(file_name)  # load .edge file (90x90 matrix)
            xx, yy, vv = CtoN(A, AALv)
            ActorViewer.xx = xx  # Store
            ActorViewer.yy = yy
            ActorViewer.vv = vv
            ActorViewer.AALv = AALv

            return ActorViewer().PlotNet()
Ejemplo n.º 18
0
    def open_study(self, ui_info):

        if ui_info.object.dirty:
            # discard / save dialog

            answer = confirm(ui_info.ui.control, 'Study modified. Save it?',
                             title='Open study',
                             cancel=True,
                             default=YES)

            if answer == YES:
                self.save_study(ui_info)
            elif answer == CANCEL:
                return

        file_name = open_file(filter=['*.pst'],
                              extensions=[FileInfo(), TextInfo()])
        if file_name != '':
            ui_info.object.load(file_name)
            ui_info.object.file_path = file_name
            self._set_title_string(ui_info)
Ejemplo n.º 19
0
 def _open_changed(self):
     """ Handles the user clicking the 'Open...' button.
     """
     file_name = open_file()
     if file_name != '':
         self.file_name = file_name
Ejemplo n.º 20
0
 def change_reference_volume(self):
     fpath = open_file(title="Choose Reverence Volume File",
                       filter=["*.img", "*.hdr", "*.nii.gz", "*.nii"],
                       file_name=self.save_path)
     if fpath == "": return
     self.reference_volume = fpath
Ejemplo n.º 21
0
 def menu_open(self, info):
     file_name = get_outfile(folder_name='.mxn', file_name='')
     file_ = open_file(file_name=file_name)
     if file_:
         info.object.root = pickle.load(open(file_, 'rb'))
Ejemplo n.º 22
0
 def menu_open(self, info):
     file_name = get_outfile(folder_name='.bmcs', file_name='')
     file_ = open_file(file_name=file_name)
     if file_:
         info.object.root = pickle.load(open(file_, 'rb'))
Ejemplo n.º 23
0
 def _open_exdesign_fired(self):
     file_name = open_file(filter=['*.eds'],
                           extensions=[FileInfo(), TextInfo()])
     if file_name != '':
         self.exdesign_spec_file = file_name
Ejemplo n.º 24
0
 def open_to(self):
     file_name = open_file()
     if file_name != '':
         self.file_name = file_name
     self.load()
Ejemplo n.º 25
0
 def load(self, info):
     filename = open_file(title='Load')
     if filename is '':
         return
     else:
         info.object.load(filename)
Ejemplo n.º 26
0
 def _open_changed ( self ):
     """ Handles the user clicking the 'Open...' button.
     """
     file_name = open_file()
     if file_name != '':
         self.file_name = file_name