[iaunique] [Up] Functions

iatype
Print the source code of a function.

Synopsis

iatype( obj )

Implemented in Python.

Input

obj mmVOID.

Object name.

Examples

>>> iatype(iacos)
def iacos(s, t, theta, phi):
    """
        - Purpose
            Create a cossenoidal image.
        - Synopsis
            f = iacos(s, t, theta, phi)
        - Input
            s:     Gray-scale (uint8 or uint16) or binary image (logical).
                   size: [rows cols].
            t:     Gray-scale (uint8 or uint16) or binary image (logical).
                   Period: in pixels.
            theta: spatial direction of the wave, in radians. 0 is a wave on
                   the horizontal direction.
            phi:   Double. Phase
        - Output
            f: Gray-scale (uint8 or uint16) or binary image (logical).
        - Description
            Generate a cosenosoid image of size s with amplitude 1, period
            T, phase phi and wave direction of theta. The output image is a
            double array.
        - Examples
            #
            import Numeric
            f = iacos([128,256], 100, Numeric.pi/4, 0)
            iashow(ianormalize(f, [0,255]))
    """
    from Numeric import cos, sin, pi
    cols, rows = s[1], s[0]
    x, y = iameshgrid(range(cols),range(rows))
    freq = 1./t
    fcols = freq * cos(theta)
    frows = freq * sin(theta)
    f = cos(2*pi*(fcols*x + frows*y) + phi)
    return f

Source Code

def iatype(obj):
    import inspect
    print inspect.getsource(obj)
    return
    
[iaunique] [Up] http://www.python.org