Adding a Wizard to projectmanager

The projectmanager wizards are just JSON files specified in the spr.json or tomo.json files. To add a wizard to a program represented in the projectmanager workflow tree, just add in the the WIZARD key value pair.
For example, to add a wizard to e2ctf.py we would change:

   1     "ICON": "ctf", 
   2     "TABLE": "EMCTFcorrectedParticlesTable(withmodal=False,multiselect=True)", 
   3     "NAME": "CTF", 
   4     "CHILDREN": [
   5       {
   6         "ICON": "ctf", 
   7         "PROGRAM": "e2ctf.py",
   8         "MODE": "autofit",
   9         "WIKIPAGE": "http://blake.bcm.tmc.edu/emanwiki/EMAN2/Programs/e2ctf",
  10         "NAME": "Automated Fitting -e2ctf", 
  11         "NOTELEVEL": "1",
  12         "CHILDREN": []
  13       },

To:

   1     "ICON": "ctf", 
   2     "TABLE": "EMCTFcorrectedParticlesTable(withmodal=False,multiselect=True)", 
   3     "NAME": "CTF", 
   4     "CHILDREN": [
   5       {
   6         "ICON": "ctf", 
   7         "PROGRAM": "e2ctf.py",
   8         "MODE": "autofit",
   9         "WIKIPAGE": "http://blake.bcm.tmc.edu/emanwiki/EMAN2/Programs/e2ctf",
  10         "NAME": "Automated Fitting -e2ctf", 
  11         "NOTELEVEL": "1",
  12         "WIZARD":"/lib/pmconfig/ctfauto.json",
  13         "CHILDREN": []
  14       },

Note that the wizard file, ctfauto.json, is in the directory lib/pmconfig, and that the relative path is given. This path is the path AFTER the build. If you are working with source code, the wizard JSON file should be in /libEM/pmconfig, but after building and installation it will be in /lib/pmconfig.

Writing the wizard

The Wizard file is a JSON file containing list of dicts. In addition to standard JSON syntax, you can add comments using /* */ and //.

Each dict represents one wizard page and the pages are iterated through until the last one is reached, at which point the wizard closes. Before the wizard pages to the next page, the values entering in the wizard page are checked for errors. If an error is found a description will be listed in the projectmanger status textbox and you will not be allowed to proceed until the error is corrected. Each dict should have three key value pairs:

Below is an example of the e2ctfauto.json wizard file:

   1 /* JSON file to make the particle import wizard */
   2 [
   3   {
   4     "TITLE":"e2ctf autofit Wizard",
   5     "INST":"This Wizard is to Help users from e2ctf in autofit mode. This program does the following: First it compute the foreground and background power. Background is defined as a circular region outside the particles. Next Fg-Bg sepctra are computed and used for fitting. First defocus is fit via least squares, then defcous and B factor are fit via simplex multidimensional miniziation using either a precomputed structure factor or the GroEL struccutre factors at high resolution domains. Finally all parameteres are refined using the simplex algorithm",
   6     "WIDGETS":[]
   7   },
   8   {
   9     "TITLE":"Select particle files",
  10     "INST":"Select particle stacks to use for CTF auto fitting",
  11     "WIDGETS":[
  12       "particles"
  13     ]
  14   },
  15   {
  16     "TITLE":"Microscope paramaters",
  17     "INST":"List the microscope parameters used during data collection to paramatize the CTF equation ",
  18     "WIDGETS":[
  19       "apix",
  20       "voltage",
  21       "cs"
  22     ]
  23   },
  24   {
  25     "TITLE":"CTF parameters",
  26     "INST":"List the amplitude contrast(using set to 10), and the oversampling(this can improve fitting of marginal data). Typically oversampling of 2 is fine.",
  27     "WIDGETS":[
  28       "ac",
  29       "oversamp"
  30     ]
  31   },
  32   {
  33     "TITLE":"CTF processing options",
  34     "INST":"To highpass the SNR, check 'autohp'. To disable smoothing of the background power curve, check 'nosmooth'. You almost always want to do this though. To use defcous from any previous fitting with e2ctf.py as a hint, check 'cudefocushint'.",
  35     "WIDGETS":[
  36       "autohp",
  37       "nosmooth",
  38       "curdefocushint"
  39     ]
  40   },
  41   {
  42     "TITLE":"Structure factor processing",
  43     "INST":"To compute structure factors directly after CTF autofitting, check 'computesf'. You almost never want to do this, as it's best to compute strucutre factors on only the best particle stacks. Initially the high resolution domains of the GroEL structure factors are used during CTF determination, however if 'sf' is set to auto, previously determined strucutre factors for this molecule are used if available(otherwise GroEL is used. To force GroEL use set 'sf' to none",
  44     "WIDGETS":[
  45       "computesf",
  46       "sf"
  47     ]
  48   }
  49 ]

Eman2AddingWizard (last edited 2012-04-30 16:17:25 by JohnFlanagan)