{"id":225,"date":"2010-07-19T20:40:39","date_gmt":"2010-07-19T20:40:39","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=225"},"modified":"2015-09-08T12:55:46","modified_gmt":"2015-09-08T12:55:46","slug":"is-there-a-graphical-user-interface-to-madagascar","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2010\/07\/19\/is-there-a-graphical-user-interface-to-madagascar\/","title":{"rendered":"Is there a Graphical User Interface to Madagascar?"},"content":{"rendered":"<p>A hardcore <tt>Madagascar<\/tt> user does not need anything more than a friendly editor (to edit <tt>SConstruct<\/tt> files) and the good old command line (to run <tt>scons<\/tt> commands). However, sometimes it is necessary to provide simplified GUIs (Graphical User Interfaces) for inexperienced users. Creating GUIs in Python is quite simple. An example is provided in <a href=\"\/RSF\/book\/rsf\/rsf\/gui.html\">rsf\/rsf\/gui<\/a>. In this example, we obtain a compressed approximation of a piecewise-regular signal with by a wavelet transform. The figure using default parameters is shown below: <\/p>\n<p><img decoding=\"async\" src=\"\/RSF\/book\/rsf\/rsf\/gui\/Fig\/wavelet.png\" alt=\"\" title=\"\" \/> <\/p>\n<p>There are two main parameters in this experiment: the type of the wavelet transform (<tt>type=<\/tt> parameter in <a href=\"\/RSF\/sfdwt.html\">sfdwt<\/a>) and the thresholding percentile (<tt>pclip=<\/tt> parameter in <a href=\"\/RSF\/sfthreshold\">sfthreshold<\/a>). The first step is to expose these parameters to CLI (Command Line Interface) by using <tt>ARGUMENTS.get<\/tt> construct in <tt>SConstruct<\/tt>:<\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre ><code class=\"python\"># Wavelet transform type \ntype = ARGUMENTS.get('type','b') \n# Thresholding percentile \npclip = int(ARGUMENTS.get('pclip',50))\n<\/code><\/pre><\/div>\n<p>Now one can select parameters on the command line by launching something like <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre ><code>scons type=b pclip=50 view\n<\/code><\/pre><\/div>\n<p>Next, we build the GUI by using one of the Python interfaces. The <a href=\"https:\/\/github.com\/ahay\/src\/blob\/master\/book\/rsf\/rsf\/gui\/gui.py\">gui.py<\/a> script provides an interface using <a href=\"http:\/\/wiki.python.org\/moin\/TkInter\">Tkinter<\/a>, the most standard Python GUI package. It allows the user to select the parameter values graphically. Clicking the <em>Run<\/em> button would then launch <tt>scons<\/tt> with the selected parameters in the background. <\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2015\/08\/GUI.png\" alt=\"\" title=\"\" \/> <\/p>\n<p>An alternative, both simple and powerful GUI package is <a href=\"http:\/\/code.enthought.com\/projects\/traits\/\">Traits<\/a> from Enthought Inc. An example Traits-based interface interface is provided by <a href=\"https:\/\/github.com\/ahay\/src\/blob\/master\/book\/rsf\/rsf\/gui\/gui-traits.py\">gui-traits.py<\/a>. <\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2015\/08\/GUI-traits.png\" alt=\"\" title=\"\" \/> <\/p>\n<p>For full-featured GUIs exposing all program parameters, one can use the Madagascar interface to <a href=\"http:\/\/www.henrythorson.com\/interface.htm\">TKSU<\/a> or <a href=\"http:\/\/www.opendtect.org\/rel4\/doc\/User\/base\/chapter7.3_madagascar.htm\">OpendTect<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A hardcore Madagascar user does not need anything more than a friendly editor (to edit SConstruct files) and the good old command line (to run scons commands). However, sometimes it is necessary to provide simplified GUIs (Graphical User Interfaces) for inexperienced users. Creating GUIs in Python is quite simple. An example is provided in rsf\/rsf\/gui. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"local","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-faq"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":3,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":22451,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions\/22451"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}