Esempio n. 1
0
  def display(self,path):
    import wx
    from rstbx.viewer.frame import XrayFrame

    app   = wx.App(0)
    frame = XrayFrame(None, -1, "X-ray image display", size=(1200,1080))
    frame.SetSize((1024,780))
    frame.load_image(path)
    frame.Show()
    app.MainLoop()
Esempio n. 2
0
  def display(self,path):
    import wx
    from rstbx.viewer.frame import XrayFrame

    app   = wx.App(0)
    frame = XrayFrame(None, -1, "X-ray image display", size=(1200,1080))
    frame.SetSize((1024,780))
    frame.load_image(path)
    frame.Show()
    app.MainLoop()
Esempio n. 3
0
def run (args) :
  app = wx.App(0)
  wx.SystemOptions.SetOptionInt("osx.openfiledialog.always-show-types", 1)
  frame = XrayFrame(None, -1, "X-ray image display", size=(800,720))
  if (len(args) == 1 and os.path.basename(args[0]) == "DISTL_pickle") :
    assert os.path.isfile(args[0])
    frame.load_distl_output(args[0])
  elif (len(args) > 0) :
    for file_name in args:
      assert os.path.isfile(file_name)
      frame.add_file_name_or_data(file_name)
    frame.load_image(args[0])
  frame.Show()
  app.MainLoop()
Esempio n. 4
0
def run(args):
  app = wx.App(0)
  wx.SystemOptions.SetOption("osx.openfiledialog.always-show-types", "1")
  frame = XrayFrame(None, -1, "X-ray image display", size=(800,720))
  if (len(args) == 1 and os.path.basename(args[0]) == "DISTL_pickle"):
    assert os.path.isfile(args[0])
    frame.load_distl_output(args[0])
  elif (len(args) > 0):
    for file_name in args:
      assert os.path.isfile(file_name)
      frame.add_file_name_or_data(file_name)
    frame.load_image(args[0])
  frame.Show()
  app.MainLoop()
Esempio n. 5
0
def run_one_index(path, *arguments, **kwargs):

    assert arguments[0].find("target=") == 0
    target = arguments[0].split("=")[1]

    from xfel.phil_preferences import load_cxi_phil
    if "--nodisplay" in arguments[1:]:
        display = False
        arguments = list(arguments)
        arguments.remove("--nodisplay")
    else:
        display = True

    args = [
        "indexing.data=%s" % path,
        "beam_search_scope=0.5",
        "lepage_max_delta = 3.0",
        "spots_pickle = None",
        "subgroups_pickle = None",
        "refinements_pickle = None",
        "rmsd_tolerance = 5.0",
        "mosflm_rmsd_tolerance = 5.0",
        "difflimit_sigma_cutoff=2.0",
        #"indexing.verbose_cv=True",
        "indexing.open_wx_viewer=%s" % display
    ] + list(arguments[1:])

    horizons_phil = load_cxi_phil(target, args)

    info = run_one_index_core(horizons_phil)
    info.Files = info.organizer.Files
    info.phil_params = info.horizons_phil

    # The spotfinder view within cxi.index is an anachronism; no useful purpose anymore
    # therefore remove this option within cxi.index:
    return
    work = wrapper_of_callback(info)

    if kwargs.get("display", False):
        import wx
        from rstbx.viewer import display
        from rstbx.viewer.frame import XrayFrame
        display.user_callback = work.user_callback

        app = wx.App(0)
        frame = XrayFrame(None, -1, "X-ray image display", size=(1200, 1080))
        frame.SetSize((1024, 780))
        frame.load_image(path)
        frame.Show()
        app.MainLoop()
Esempio n. 6
0
def run_one_index(path, *arguments, **kwargs):

  assert arguments[0].find("target=")==0
  target = arguments[0].split("=")[1]

  from xfel.phil_preferences import load_cxi_phil
  if "--nodisplay" in arguments[1:]:
    display = False
    arguments = list(arguments)
    arguments.remove("--nodisplay")
  else:
    display = True

  args = ["indexing.data=%s"%path,
          "beam_search_scope=0.5",
          "lepage_max_delta = 3.0",
          "spots_pickle = None",
          "subgroups_pickle = None",
          "refinements_pickle = None",
          "rmsd_tolerance = 5.0",
          "mosflm_rmsd_tolerance = 5.0",
          "difflimit_sigma_cutoff=2.0",
          #"indexing.verbose_cv=True",
          "indexing.open_wx_viewer=%s"%display
          ] + list(arguments[1:])

  horizons_phil = load_cxi_phil(target, args)

  info = run_one_index_core(horizons_phil)
  info.Files = info.organizer.Files
  info.phil_params = info.horizons_phil

  # The spotfinder view within cxi.index is an anachronism; no useful purpose anymore
  # therefore remove this option within cxi.index:
  return
  work = wrapper_of_callback(info)

  if kwargs.get("display",False):
      import wx
      from rstbx.viewer       import display
      from rstbx.viewer.frame import XrayFrame
      display.user_callback = work.user_callback

      app   = wx.App(0)
      frame = XrayFrame(None, -1, "X-ray image display", size=(1200,1080))
      frame.SetSize((1024,780))
      frame.load_image(path)
      frame.Show()
      app.MainLoop()