Retinal Model: Static Eye, X Cells, Different Spatial Scales

This is a model of the retina.  The current assumptions are that the eye is perfectly still and that the x cells, the only current cells modeled, can be characterized by DOG functions.  The output will be generated at 4 spatial scales, in order, automatically, with each successive scale with a peak spatial frequency at 1/2 of the previous cell array (that is, 1 octive lower).

To start using this model, input any 8bit bitmapped image.  The size is limited by the power of your computer and your patience in waiting for output.  Give the path for the image.  But first load this matrix manipulation function.

<< LinearAlgebra`MatrixManipulation`

Input Your image

inpic = 
        Import["c:\zbs\html\content\Vision\Model\mathematic/1pixelline.bmp\
"];
retarray = inpic[[1, 1] ]; 
    Print["Dimensions of Input Array ",  Dimensions[retarray]]; 
    bigdim = Dimensions[retarray];

Show[inpic];

Print[Max[retarray]]
Print[Min[retarray]]

Set the baseline parameter for the ganglion cell

se  =  2; si = 6;

Run the model and go get lunch.

\(\(Do[ses\  = \ se*2\^\((st - 1)\); sis = si*2\^\((st - 1)\); 
        width = 3*sis; 
        ganglion = 
          Table[\(\((sis/ses)\)\/\(\((ses)\)*\@\(2*Pi\)\)\) 
                  Exp[\(-\(\((\((i - width)\)\^2 + \((j - width)\)\^2)\)\/\((2*ses\^2)\)\)\)] - \(1\/\(\((sis)\)*\@\(2*Pi\)\)\) 
                  Exp[\(-\(\((\((i - width)\)\^2 + \((j - width)\)\^2)\)\/\((2*\((sis)\)\^2)\)\)\)] // N, {i, 2*width + 1}, {j, 
              2*width + 1}]; 
        upi = IntegerPart[\((bigdim[\([1]\)] - \((2*width + 1)\))\)/5]; 
        upj = IntegerPart[\((bigdim[\([2]\)] - \((2*width + 1)\))\)/5]; 
        Q = \((1/\((width)\))\); 
        OutputArray = 
          Table[Q*Apply[Plus, 
                Apply[Plus, 
                  ganglion*
                    SubMatrix[
                      retarray, {\((i - 1)\)*5 + 1, \((j - 1)\)*5 + 
                          1}, {2*width + 1, 2*width + 1}]]], {i, 1, upi}, {j, 
              1, upj}]; 
        If[st == 1, scale1 = OutputArray, 
          If[st == 2, scale2 = OutputArray, 
            scale3 = 
              OutputArray]]; 
Print["Output of the Retina at Excitatory SD ", ses, " and Inhibitory SD ", sis]; 
        Show[GraphicsArray[{SurfaceGraphics[OutputArray, \ 
                Lighting -> False, PlotRange -> {\(-125\), 125}], 
              SurfaceGraphics[OutputArray, 
                ViewPoint\  -> \ {0, 0, 1000}, Mesh -> False, 
                Lighting -> False, 
                PlotRange -> {\(-125\), 125}]}]];, {st, 
          3}];\)\)

Print[Min[scale1]]; Print[Max[scale1]]
Print[Min[scale2]]; Print[Max[scale2]]
Print[Min[scale3]] ; 
    Print[Max[scale3]]