code
stringlengths
3
6.57k
self.column_left.Add(logo_help_hbox, proportion=0, flag=wx.ALL, border=5)
self.get_description()
self.column_left.Add(html_desc_window, 0, wx.ALL, 5)
wx.TextCtrl(self, wx.ID_ANY, size=(100, 300)
self.column_right.Add(self.log_window, 1, wx.EXPAND|wx.ALL, 5)
self.main_row.Add(self.column_left, 0, wx.ALL, 10)
self.main_row.Add(self.column_center, 1, wx.ALL, 10)
self.main_row.Add(self.column_right, 1, wx.ALL, 10)
self.SetSizerAndFit(self.main_row)
log_to_window(self, msg, level=None)
self.log_window.AppendText("{}\n".format(msg)
self.log_window.AppendText("{}: {}\n".format(level, msg)
tutorial(self,event)
os.path.join(os.environ[self.SCT_DIR_ENV],self.SCT_TUTORIAL_PATH)
print('PDF path:', pdfpath)
format(pdfpath)
print('Command line:', cmd_line)
self.call_sct_command(cmd_line)
help_url(self, event)
webbrowser.open(url)
get_logo(self)
ConvertToBitmap()
png.GetWidth()
png.GetHeight()
get_description(self)
htmlw.SetPage(self.DESCRIPTION + self.DESCRIPTION_SCT)
htmlw.SetStandardFonts(size=10, normal_face="Noto Sans")
call_sct_command(self, command)
self.log_to_window("Running: {}".format(command)
ProgressDialog(frame)
progress_dialog.Show()
SCTCallThread(command, self.log_window)
thr.start()
app.pending()
thr.join(0.1)
wx.Yield()
thr.isAlive()
thr.sct_interrupt()
thr.join()
self.log_to_window("Command completed.", level="INFO")
progress_dialog.Destroy()
self.log_to_window("An error occurred", level="ERROR")
ErrorDialog(frame, msg=thr.stderr)
error_dialog.Show()
TabPanelPropSeg(SCTPanel)
__init__(self, parent)
super(TabPanelPropSeg, self)
__init__(parent=parent, id_=wx.ID_ANY)
TextBox(self, label="Input file")
wx.Button(self, id=wx.ID_ANY, label="Run")
button_run.Bind(wx.EVT_BUTTON, self.on_button_run)
self.column_center.Add(self.hbox_filein.hbox, 0, wx.EXPAND|wx.ALL, 5)
self.column_center.Add(self.rbox_contrast, 0, wx.ALL, 5)
self.column_center.Add(button_run, 0, wx.ALL, 5)
on_button_run(self, event)
self.hbox_filein.get_file_name()
self.log_to_window(msg, level="ERROR")
ErrorDialog(frame, msg=msg)
error_dialog.Show()
self.rbox_contrast.GetStringSelection()
os.path.basename(fname_input)
base_name.split(os.extsep, 1)
format(fname, fext)
format(fname_input, contrast)
self.call_sct_command(cmd_line)
Image(fname_out)
overlayList.append(image)
displayCtx.getOpts(image)
TabPanelSCSeg(SCTPanel)
pathologies (compression, MS, ALS, etc.)
__init__(self, parent)
super(TabPanelSCSeg, self)
__init__(parent=parent, id_=wx.ID_ANY)
TextBox(self, label="Input file")
wx.Button(self, id=wx.ID_ANY, label="Run")
button_run.Bind(wx.EVT_BUTTON, self.on_button_run)
self.column_center.Add(self.hbox_filein.hbox, 0, wx.EXPAND|wx.ALL, 5)
self.column_center.Add(self.rbox_contrast, 0, wx.ALL, 5)
self.column_center.Add(button_run, 0, wx.ALL, 5)
on_button_run(self, event)
self.hbox_filein.get_file_name()
self.log_to_window(msg, level="ERROR")
ErrorDialog(frame, msg=msg)
error_dialog.Show()
self.rbox_contrast.GetStringSelection()
os.path.basename(fname_input)
base_name.split(os.extsep, 1)
format(fname, fext)
format(fname_input, contrast)
self.call_sct_command(cmd_line)
Image(fname_out)
overlayList.append(image)
displayCtx.getOpts(image)
TabPanelGMSeg(SCTPanel)
subjects (3963 axial slices)
pathologies (compression, MS, ALS, etc.)
contrast (e.g., T2*-weighted image)
__init__(self, parent)
super(TabPanelGMSeg, self)
__init__(parent=parent, id_=wx.ID_ANY)