$Id: TODO 424 2008-04-15 11:08:42Z wojdyr $

Help is needed:

- C++ coding: see the list of ideas at the end of this file
- documentation: convert the manual from DocBook to reStructuredText
- graphics: make PNG icons for toolbar. XPM format (now in use) doesn't support
  alpha channel, and the toolbar doesn't look good.


---------- TODO list and tentative development plan  ----------------

* powder diffraction "add-on" - Pawley fitting 

* minimum wx version will be raised to 2.8
  - wxAboutBox will be used instead of AboutDlg

--------------> 0.9

* [BUG] parsing problems: "a=a" => OK   "a=ab" => Syntax error

* FFT (forward and backward) data transformation,
  convolution and deconvolution of two datasets
  (implement both using code from Kiss FFT library)

* GUI: refactor MainPlot - mouse event handling based on subscriptions,
       a clean interface to XOR-drawing 

* GUI: should (and where) windows size & position be stored?

* (GUI) plot horizontal/vertical lines (X/Y | pos=2.34 | 100% | title="50steps")
     can be used to show theoretical peak positions in XRD
     (or to make stress-strain curves in MD with marked simulation restarts)

* (GUI) stopping fitting interactively (when user doesn't want to wait longer);
  "stop" bitmap button? in right left corner? 

* convert manual from DocBook to reStructuredText

* data import: possibility to use xylib column/block name as title

* allow gzipped data files and .fit scripts (if build with zlib)

* configure.ac: 
  --enable-samples-install  Install samples as documentation 
    (to .../share/doc/fityk/samples/, only *.fit and *.dat files)

* magic default parameters: if $default__name is defined: when functions 
  with parameter `name' are "guessed", this parameter is set to $default__name

--------------> 

* add alpha channel to toolbar icons

* (GUI) single dialog for configuring main plot (and also aux. plots) (?)
  - now in Configure axes / peak labels fonts are changed (but shouldn't) 
    even if Apply is not pressed 
  - option to change the width of the sum line (and other lines)
  - ? changing data point size and line separately for each dataset,

* unused variables should not slow down fitting

------------------ 

* fitting with box-constrained parameters

* GUI, enhancements for the script editor: 
       - "info ...> file" marked differently than not redirected info 
       - paths of files to be read should be checked 
       - ? search'n'replace button

* user defined functions:
      - more sophisticated simplifications of expressions and CSE(!)
      - calculating limits, width, area, etc. for UDF(!)

* EMG function: how to calculate it? Now there are some problems with
  this function. There must be smarter way to implement it...
  perhaps using gsl_sf_log_erfc or exp(x*x)*erfc(x) from
  http://www.netlib.org/specfun/erf

* improve Voigt function (cut-tails, better approx.) 
  eg. http://portal.acm.org/citation.cfm?doid=77626.77629

* info -- more information about error, confidence limits, etc.
  graphical interface Fit > Info

* GUI: it should be possible to constrain two parameters of two peak 
     (using mouse), at least to make them equal.

* GUI: menu Functions:
  Functions > Peak-Find Info -> animation
  Functions > Multidata P-F Info -> window with list of parameters (Xview-like)

* Function: check_parameters_out_of_domain() ?  
             eg. in Pearson shape > 0.5 , shape < 1e9
	     called from fitting iteration?
	     what if parameter is out-of-domain? change? disable function?
	                                          change and freeze?
	     set fit-fix-parameters-times = 5
	    simple-var bounds?
	    ? $$simple = ~{min2(max2($simple, -1e9), 1e9)}

* GUI: Data Editor - left/right/top/bottom - magic keywords: user would be
       asked to select point/range/rectangle in plot

* cmd/GUI: plot peak-groups: ==> plot (%a+%b+%c)  

* add a new function category: sigmoids/steps (now function can be guessed as
  "peak" and "linear"). (GUI): drawing drafts for the new category.

* ? automatically freeze peaks in disactivated range

* (GUI) vertical scaling using mouse on main plot near to left edge of the plot 

* automatic background substraction - what are good algorithms?

* more sophisticated algorithms for peak detection

* fitting: GA fitting options, 
  a way to "shake" parameters for L-M

* fitting:
	simulated annealing (it can replace LM shake_before option)
	perhaps also BFGS, conjugate gradients methods

* fitting: it should be separated even more from the rest of the program.
  Perhaps it fitting functions should be in extern library (COOOL,
  GAUL, WNLIB, netlib, OOL.sf.net, levmar, GSL and 3rd-party extensions to GSL,
  scitbx::lbfgs)
  are there any other such libraries? 
  I haven't investigated the possibility of using mentioned libs yet. 
  Links: 
  http://coool.mines.edu/ 
  http://gaul.sourceforge.net/, 
  http://www.willnaylor.com/wnlib.html
  http://sal.jyu.fi/B/3/index.shtml, http://coin-or.org
  http://www-unix.mcs.anl.gov/otc/Guide/faq/nonlinear-programming-faq.html 
  http://www.ics.forth.gr/~lourakis/levmar/

* fitting: robust fit - other error distributions then Gaussian, 
  eg. Lorenzian...; so called 'maximum-likelihood method' -- using Poisson
  error distribution.

* investigate LLVM - can it be used for faster calculation of 
  user-defined functions?

* [BUG] (GUI) (MS Win) <br> does not work in vertical peak labels 

* ? exporting formulae in MathML (when option formula-export-style == mathml)

* [BUG]: program crashes (MS Win 9x) when data contains NaN (as a result
  of asin(x) x>1) and "Zoom all" is called.

-------  Anticipated upgrades  -----------

* when Boost::Spirit 2 is released, parsers will be rewritten and 
  libfityk will be made thread-safe (removing all `AL' and all static class 
  members and global variables)

* when wxWidgets 3.x will be available in major Linux distributions:
  - open-file dialog (with preview) will use XyBrowser
  - file dialogs will be changed to take adventage of custom controls:
      * Choose log file: add "log also output" checkbox
      * Data > Export will be done in one step
      * "Export formula" dialog will have formula-export-style option
  - button '(un)lock' on variables pane (wxToggleBitmapButton)
  - use wxDataViewCtrl instead of wxGrid in  data editor
  - use wxDataViewCtrl for the lists at the sidebar,
    refactor ListWithColors::populate(), add sorting by clicking on column 
    header (use case: sort functions by centers)
  - use wxToggleBitmapButton buttons on sidebar>functions (buttons that make 
    hwhm and shape equal for all functions)

-------  Ideas for people, who would like to contribute:  -----------

- write a function to calculate a Voigt/Faddeeva function, based on one 
  (or more) of papers published about it. I mean here an approximation more 
  exact that the standard Humlicek one. GSL would probably also accept
  such a function in C.
  http://sources.redhat.com/ml/gsl-discuss/2004-q4/msg00061.html

- see the note about EMG function above

- if you have some expertise in nonlinear optimization methods, it's possible
  to do what Gnu Scientific Library seems to plan: put a few least-squares
  fitting methods with similar interface into one library. 
  It can be part of fityk, a separate library or a part of GSL.

- Add alpha channel to toolbar icons. Fityk icons are usually modified GTK 
  stock icons. Alpha-channel was removed when converting to xpm format.
  Now I see icons with alpha-channel look much better (like menu icons,
  visible in GTK version only), but making the icons again takes time...

- (wxWidgets): On the sidebar FancyRealCtrl is used for changing parameters:
  http://wxforum.shadonet.com/viewtopic.php?t=13471
  It would be better to use a custom (3D?) control instead of wxSlider,
  perhaps similar to controls used in Google Earth for zoom and tilt.

- anything else

---------------------------------------------------------------------
