Multi-Peak Fitting 2

I am trying out Multi-Peak Fitting 2 in IGOR 6.10 beta.
I am working sequentially through tens of histograms and I would like to store the results together in one table or notebook. The 'Standard Parameters, Tab-Delimited' button in the Results window saves the results of one fit but then overwrites them with the results of the next fit (I am fitting histograms of the same name that I am tabbing through in NeuroMatic).

Can the "MPF2_TabDelimitedResultsBtnProc" be altered easily to make it append the results to the output rather than overwriting them?

Thanks
mf wrote:
Can the "MPF2_TabDelimitedResultsBtnProc" be altered easily to make it append the results to the output rather than overwriting them?


I suppose it could. But right now, each time you do a fit with Multi-peak Fit 2, then use the Standard Parameters, Tab-Delimited button, you get a separate notebook with unique name for each fit project. To combine, copy and paste works well and avoid adding complexity to the Multipeak Fit 2 interface.

Oh, wait...
mf wrote:
The 'Standard Parameters, Tab-Delimited' button in the Results window saves the results of one fit but then overwrites them with the results of the next fit (I am fitting histograms of the same name that I am tabbing through in NeuroMatic).


I'm not sure how you achieved that. If you go back to the Start Multi-peak Fit panel and select new data and you select New Graph in the Use Graph menu, then you should get a separate, uniquely-named notebook for each fit. That's what I would recommend doing.

How are you getting Multi-peak Fit 2 to overwrite?

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hello John

Thanks for the feedabck, I was trying to avoid the copy-and-paste route...

As to getting Multi-peak Fit 2 to overwrite, I am fitting histograms generated with the Histogram function then loaded into NeuroMatic and displayed in a window where the trace is always named 'RecordA0' - I set the Multi-peak fit to use RecordA0 the contents of which changes each time I tab forward through the histrograms in NeuroMatic. Does this make sense? See attached screen grab.

Mark

---
Professor Mark Farrant
Department of Neuroscience, Physiology & Pharmacology
UCL (University College London)
Medical Sciences Building
Gower Street, LONDON WC1E 6BT UK

johnweeks wrote:
mf wrote:
Can the "MPF2_TabDelimitedResultsBtnProc" be altered easily to make it append the results to the output rather than overwriting them?


I suppose it could. But right now, each time you do a fit with Multi-peak Fit 2, then use the Standard Parameters, Tab-Delimited button, you get a separate notebook with unique name for each fit project. To combine, copy and paste works well and avoid adding complexity to the Multipeak Fit 2 interface.

Oh, wait...
mf wrote:
The 'Standard Parameters, Tab-Delimited' button in the Results window saves the results of one fit but then overwrites them with the results of the next fit (I am fitting histograms of the same name that I am tabbing through in NeuroMatic).


I'm not sure how you achieved that. If you go back to the Start Multi-peak Fit panel and select new data and you select New Graph in the Use Graph menu, then you should get a separate, uniquely-named notebook for each fit. That's what I would recommend doing.

How are you getting Multi-peak Fit 2 to overwrite?

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com

grab.jpg
For those paying attention, and with any knowledge of NeuroMatic, that should be 'DisplayA0' not 'RecordA0'

Mark

---
Professor Mark Farrant
Department of Neuroscience, Physiology & Pharmacology
UCL (University College London)
Medical Sciences Building
Gower Street, LONDON WC1E 6BT UK
mf wrote:
Thanks for the feedabck, I was trying to avoid the copy-and-paste route...

As to getting Multi-peak Fit 2 to overwrite, I am fitting histograms generated with the Histogram function then loaded into NeuroMatic and displayed in a window where the trace is always named 'RecordA0' - I set the Multi-peak fit to use RecordA0 the contents of which changes each time I tab forward through the histrograms in NeuroMatic. Does this make sense? See attached screen grab.


I see. I don't know Neuromatic very well, but it sounds like the graph in Neuromatic is overwriting a wave with new data for each data set. So Multi-peak Fit 2 thinks it's always the same wave and same graph, so it interprets it as the same fit set.

I will put appending to a results notebook on the to-do list for Multi-peak Fit 2.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks John

I went ahead and altered Multi-peak Fitting 2.0.ipf to allow appending to the plain text output notebook:

String nb = "MultipeakSet"+num2str(setNumber)+"_TD"
    if (WinType(nb) == 5)
        DoWindow/F $nb        //Channged from /K so as not to kill the notebook
    else                    // added else, so will create if not existing
        NewNotebook/F=0/K=1/N=$nb
    endif


and simply commented out all the output I did not require.

I'm sure you can come up with a more elegant selectable option down the line.

BTW I like this second version of Multi-peak Fitting much better than the first - more intuitive and much nicer on the eye.

Mark
mf wrote:
Thanks John

I went ahead and altered Multi-peak Fitting 2.0.ipf to allow appending to the plain text output notebook:

String nb = "MultipeakSet"+num2str(setNumber)+"_TD"
    if (WinType(nb) == 5)
        DoWindow/F $nb        //Channged from /K so as not to kill the notebook
    else                    // added else, so will create if not existing
        NewNotebook/F=0/K=1/N=$nb
    endif


and simply commented out all the output I did not require.

I'm sure you can come up with a more elegant selectable option down the line.

You are a very enterprising person! The code for Multi-peak Fit 2 is pretty daunting.

mf wrote:
BTW I like this second version of Multi-peak Fitting much better than the first - more intuitive and much nicer on the eye.

Thank you. The first was first written many years ago when styles were different and Igor much less capable.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I am interested in the source code of the PeakFunctions2.xop, I would like to add more peak functions and using the source code would help very much. Although I am not sure if the source code for this XOP is freely available ...

Additionally I think I might have found a serious bug in the MultiPeak2 package:
looking at the line containing FuncFit, i.e.
FuncFit/Q=1/N=(doUpdates == 0 ? 1 : 0)/M=2 {string=MPstruct.FuncListString} yw[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd] /X=xw[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd]/W=MPstruct.weightWave[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd]/I=1/W=MPstruct.maskWave[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd] /AD=(doAutoDest)/AR=(doAutoResid)/A=1/NWOK;AbortOnRTE

the parameter for the Mask wave /W=MPstruct.maskWave[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd] is wrong. It should read /M=MPstruct.maskWave[MPstruct.XPointRangeBegin, MPstruct.XPointRangeEnd]. Correct me if I am wrong.

In any case thank you for any replies!

Gregor