Discussion:
[Gwyddion-users] Copy fit results to clipboard
Müller, Patrick (INT)
2017-03-17 13:22:29 UTC
Permalink
Dear all,

I often use the "Fit function" tool to evaluate the shape of the structures on my samples quantitatively, e.g. by fitting a Gaussian. It would be very useful, if you could copy the fit results (the values of the fitted parameters) somehow to the clipboard. This way you could copy it to some other application for further processing without the need to save each and every profile as text file, do the fit in the other software and so on...

Is there a way to do this? Something like an additional button or a keyboard hook for ctrl+c?

Thanks,
Patrick
Müller, Patrick (INT)
2017-03-17 13:24:56 UTC
Permalink
Dear all,

I often use the "Fit function" tool to evaluate the shape of the structures on my samples quantitatively, e.g. by fitting a Gaussian. It would be very useful, if you could copy the fit results (the values of the fitted parameters) somehow to the clipboard. This way you could copy it to some other application for further processing without the need to save each and every profile as text file, do the fit in the other software and so on...

Is there a way to do this? Something like an additional button or a keyboard hook for ctrl+c?

Thanks,
Patrick
David Nečas (Yeti)
2017-03-17 21:23:13 UTC
Permalink
On Fri, Mar 17, 2017 at 01:22:29PM +0000, Müller, Patrick (INT) wrote:
> I often use the "Fit function" tool to evaluate the shape of the
> structures on my samples quantitatively, e.g. by fitting a Gaussian.
> It would be very useful, if you could copy the fit results (the values
> of the fitted parameters) somehow to the clipboard. This way you could
> copy it to some other application for further processing without the
> need to save each and every profile as text file, do the fit in the
> other software and so on...
>
> Is there a way to do this? Something like an additional button or a
> keyboard hook for ctrl+c?

The fit results can be saved to a text file using the Save button.
So you certainly do not have to do the fitting in other software.

But I agree the fitting dialogues should have also Copy-to-clipboard
buttons, similarly to statistical quantities, distances, etc. Ctrl-C
probably would not be the best idea (among other problems, it
simultaneously needs to to its usual thing for all the various text
boxes in the window).

Regards,

Yeti
Müller, Patrick (INT)
2017-03-17 22:47:07 UTC
Permalink
I agree with ctrl-c being a bit problematic. ‎I tried modifying the source code and managed to get a "copy" button in there next to the other buttons. I also gave it "C" as shortcut, so you can now use Alt+C to copy the fit parameter results into the clipboard. I think this is quite convenient. If you are interested in incorporating this into the official source, I can send you the source code snippet.

Originalnachricht
Von: David Nečas (Yeti)
Gesendet: Freitag, 17. März 2017 22:23
An: Gwyddion use discussion
Antwort an: Gwyddion use discussion
Betreff: Re: [Gwyddion-users] Copy fit results to clipboard


On Fri, Mar 17, 2017 at 01:22:29PM +0000, Müller, Patrick (INT) wrote:
> I often use the "Fit function" tool to evaluate the shape of the
> structures on my samples quantitatively, e.g. by fitting a Gaussian.
> It would be very useful, if you could copy the fit results (the values
> of the fitted parameters) somehow to the clipboard. This way you could
> copy it to some other application for further processing without the
> need to save each and every profile as text file, do the fit in the
> other software and so on...
>
> Is there a way to do this? Something like an additional button or a
> keyboard hook for ctrl+c?

The fit results can be saved to a text file using the Save button.
So you certainly do not have to do the fitting in other software.

But I agree the fitting dialogues should have also Copy-to-clipboard
buttons, similarly to statistical quantities, distances, etc. Ctrl-C
probably would not be the best idea (among other problems, it
simultaneously needs to to its usual thing for all the various text
boxes in the window).

Regards,

Yeti


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gwyddion-users mailing list
Gwyddion-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
David Nečas (Yeti)
2017-03-18 08:47:56 UTC
Permalink
On Fri, Mar 17, 2017 at 10:47:07PM +0000, Müller, Patrick (INT) wrote:
> I tried modifying the source code and managed to get a "copy" button
> in there next to the other buttons. I also gave it "C" as shortcut, so
> you can now use Alt+C to copy the fit parameter results into the
> clipboard. I think this is quite convenient. If you are interested in
> incorporating this into the official source, I can send you the source
> code snippet.

Doesn't Alt-C already press Cancel? Anyway, please send the patch, I
will probably incorporate the functionality in one form or another...

Regards,

Yeti
Müller, Patrick (INT)
2017-03-18 11:05:01 UTC
Permalink
Hi,

here ist the file (it's based on Gwyddion 2.44, but I think the fit window hasn't changed in the recent versions).
Basically I just added the lines
47
283-284
560-568

You were right, I mixed it up: alt-c was not possible, so I used alt-y as keyboard shortcut. It just copys the fit parameters as row vector, padded with a tab (for easy pasting in any spreadsheet-like software). There is a small glitch which I haven't fixed: There is also a "\t" padded after the last value. By removing the last character of the string before copying it to the clipboard this can be resolved.

I would be happy to see these changes in the next Gwyddion releases. It's really a great piece of software!

Best,
Patrick

-----UrsprÃŒngliche Nachricht-----
Von: David Nečas (Yeti) [mailto:***@gwyddion.net]
Gesendet: Samstag, 18. MÀrz 2017 09:48
An: Gwyddion use discussion
Betreff: Re: [Gwyddion-users] Copy fit results to clipboard

On Fri, Mar 17, 2017 at 10:47:07PM +0000, MÃŒller, Patrick (INT) wrote:
> I tried modifying the source code and managed to get a "copy" button
> in there next to the other buttons. I also gave it "C" as shortcut, so
> you can now use Alt+C to copy the fit parameter results into the
> clipboard. I think this is quite convenient. If you are interested in
> incorporating this into the official source, I can send you the source
> code snippet.

Doesn't Alt-C already press Cancel? Anyway, please send the patch, I will probably incorporate the functionality in one form or another...

Regards,

Yeti


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
Gwyddion-users mailing list
Gwyddion-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
Loading...