mne-tools/mne-python — pull request #427 by dengemann (2013-02-02 20:04:19+00:00)
Title: WIP: neater internals for run_ica + support for additional rejection nodes 

- reduced redundand code by emplyong a named tuple + loop
- added support for more flexible detection critera. Now target as well
as non-target scroes take indices or thershold. The kind of detection
is inferred from type
- additional nodes can be added vie a list of tuples

@agramfort this is a least-square-maximum-KISS fit of the ideas i've dropped in #386.
I hope the changes are self-explaining. Otherwise I'll add an example. Depending on how you like this we may think about making the entire run_ica API tuple / dict based to a) save some space b) allow for re-running detection without re-running ICA.

Another possibility would be to drop ica from run_ica and rename it to run() which would become a method

then one could say ica = ICA(**params).run()

run would then save the ica if desired so that decomposing and detection could be separated. run would not start the decomposition if ica is already decomposed but only run the detection workflow.
Makes sense?