<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>mmintershow</title> <link href="../tbxdok.css" rel="stylesheet"> </head> <body> <table class="topNav"> <tr> <td class="index"> [<a href="../morph/mminterot.html"><tt>mminterot</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmse2interval.html"><tt>mmse2interval</tt></a>] </td> <td class="title">Intervals (hit-or-miss templates)</td> </tr> </table> <h1>mmintershow <br> <span class="subtitle">Visualize an interval. </span> </h1> <div class="synopsis"> <H2>Synopsis</H2> <div class="H2"> <div class="prototype">s = <span class="fun">mmintershow</span>( <span class="par">Iab</span> ) </div> <p>Implemented in <b>Python.</b> </p> <div class="input"> <H3>Input</H3> <div class="H3"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><span class="par">Iab</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmInterval.html">Interval</a></span></td> </tr> </tbody> </table> </div> </div> <div class="output"> <H3>Output</H3> <div class="H3"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><span class="par">s</span></td> <td class="def"><span class="type"><a href="../mmtypes/mmString.html">String</a></span><p>( representation of the interval).</p></td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="descr"> <H2>Description</H2> <div class="H2"> <p> <span class="fun">mmintershow</span> creates a representation for an interval using 0, 1 and . ( don't care). </p> </div> </div> <div class="examples"> <H2>Examples</H2> <div class="H2"> <p> <div class="example"> <div class="listing"> <pre class="user">>>> print mmintershow(mmhomothin())</pre> <pre class="computer">0 0 0 . 1 . 1 1 1</pre> </div> </div> </p> </div> </div> <div class="sourcecode"> <H2>Source Code</H2> <div class="H2"> <pre class="listing"> def mmintershow(Iab): from Numeric import array, product, reshape, choose from string import join assert (type(Iab) is tuple) and (len(Iab) == 2),'not proper fortmat of hit-or-miss template' A,Bc = Iab S = mmseunion(A,Bc) Z = mmintersec(S,0) n = product(S.shape) one = reshape(array(n*'1','c'),S.shape) zero = reshape(array(n*'0','c'),S.shape) x = reshape(array(n*'.','c'),S.shape) saux = choose( S + mmseunion(Z,A), ( x, zero, one)) s = '' for i in range(saux.shape[0]): s=s+(join(list(saux[i]))+' \n') return s </pre> </div> </div> <div class="seealso"> <H2>See also</H2> <div class="H2"> <table class="deflist"> <tbody valign="baseline"> <tr> <td class="term"><a href="../morph/mmfreedom.html">mmfreedom</a></td> <td class="def">Control automatic data type conversion.</td> </tr> <tr> <td class="term"><a href="../morph/mmendpoints.html">mmendpoints</a></td> <td class="def">Interval to detect end-points.</td> </tr> <tr> <td class="term"><a href="../morph/mmhomothick.html">mmhomothick</a></td> <td class="def">Interval for homotopic thickening.</td> </tr> <tr> <td class="term"><a href="../morph/mmhomothin.html">mmhomothin</a></td> <td class="def">Interval for homotopic thinning.</td> </tr> <tr> <td class="term"><a href="../morph/mmse2hmt.html">mmse2hmt</a></td> <td class="def">Create a Hit-or-Miss Template (or interval) from a pair of structuring elements.</td> </tr> </tbody> </table> </div> </div> <center> <table class="botNav"> <tr> <td class="index"> [<a href="../morph/mminterot.html"><tt>mminterot</tt></a>] [<a href="index.html">Up</a>] [<a href="../morph/mmse2interval.html"><tt>mmse2interval</tt></a>] </td> <td rowspan="2" class="xhtml"><a href="http://www.python.org"><img width="55" alt="Python" height="22" src="../PythonPoweredSmall.gif"></a></td> </tr> <tr> <td class="copyright">Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.</td> </tr> </table> </center> </body> </html>