Light to Brain Model
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This simulation models the probability of the number of photons absorbed by rods within the retina. The threshold of human vision is characterized by the minimum number of photons required to elicit a visual effect in the brain. Photons must enter through the layers of the eye before probabilistically triggering the visual transduction pathway. Through modelling this pathway in NetLogo, a better understanding of the variables involved in this process can be obtained, allowing the simulation to be used as a teaching tool. Our model accounts for changes in vision underwater by enabling the user to manipulate depth which alters light intensity and pupil diameter.
Our model was based on the Hecht et al. (1942) experiment, where the threshold energies for vision of the human eye were determined.
Reference: Hecht, S., Shlaer, S. and Pirenne, M.H., 1942. Energy, Quanta, and Vision. Journal of General Physiology, 25(6), pp.819–840. https://doi.org/10.1085/jgp.25.6.819.
HOW IT WORKS
At each tick, the photons move forward and have a chance of being absorbed, depending on the layer of the eye they are situated in. When a photon gets absorbed by a rod, it turns the rod yellow, indicating it is stimulated. If the necessary number of rods are stimulated for a given burst of photons, there is a visual response.
HOW TO USE IT
Before clicking any buttons on the interface, adjust sliders as desired. Set the average number of photons sent per burst using the ‘avgphotons’ slider. Adjust the width of the light beam in millimetres using the ‘beamwidth’ slider. You can also adjust the pupil diameter in millimetres using the “Pupil’ slider, which can simulate how the eye responds to different light levels. The ‘n’ slider sets the minimum number of rods that must be stimulated for a visual response to occur. The eye will need to have n photons absorbed by the retina for the burst of light to be seen. For underwater mode exclusively, you can set the depth of the eye below sea level (in metres) using the ‘depth slider’ which will also adjust pupil size and the intensity of light that reaches the eye.
Once the sliders have been adjusted, push the ‘Setup’ button to set up the model which includes drawing the structure of the eye and generating starting photons. If you would like to simulate underwater vision, select the ‘Underwater’ button after ensuring the depth is set. This button automatically sets the average number of photons to be 1000 to represent a high amount of photons from sunlight at sea level. It also sets the absorption value of the water and the pupil diameter to match the chosen depth.
There are two different go procedure buttons on the interface: ‘Burst’ or ‘Repeat’. To run the model once, press the ‘Burst’ button. This sends a single burst of photons towards the retina, the number of which is determined by a Poisson distribution centred at the average photons set on the ‘avgphotons’ slider. If you want to run this procedure again, press ‘Setup’ first. To run the model for 10 cycles, press the ‘Repeat’ button. This will reset the simulation when ticks = 600 (the length of one cycle). It will clear all paths drawn by photons, stimulated rods and variables, while maintaining the plots to allow for the collection of data when resetting the world.
This simulation also has an experiment set up using the ‘BehaviorSpace’ tool that mimics the Hecht et al., 1942 paper. First press ‘Setup’ and then go to Tools>BehaviorSpace (shift + command + B). You can then run the experiment labelled ‘Hecht et al. (150 runs)’ which runs 10 cycles of ‘Burst’ with the experimental setup. We will run 10 cycles of ‘burst’ with the experimental setup. The average photon count will start at 20 and increase by 40 until 300 photons. The diameter of the pupil was set to 8 mm, to simulate the ‘complete dark adaption’ for at least 30 minutes in the dark before the experimenters started to record data. The beam of light was set to 10 mm to simulate a large enough band of light that will consistently allow all the photons to enter the pupil. To view full plotting on the interface graphs change ‘simultaneous runs in parallel’ to 1, rather than the suggested number by NetLogo. This experiment uses the experimental setup procedure differs slightly from the regular ‘setup’ since it ‘clears-drawing’ and ‘clear-turtles’ after each burst of light sent. Within the experiment, the number of average photons was represented by ‘avgphotons’.
You can tell if a signal has been sent if a lightning bolt appears on the right side of the screen. There will also be a message displayed in the output on the output monitor in the interface saying ‘Visual Response’ if a signal has been sent, or ‘No Visual Response’ if not enough rods were stimulated.
The monitors on the interface help quantify what is occurring in the simulation. The ‘Photons Absorbed’ monitor indicates the number of photons that are absorbed and will increase during one run of the simulation. The ‘Photons at Retina’ monitor updates once the photons enter the zoomed-in retinal window on the right-side of the interface with the number of photons present. ‘Rods Stimulated’ updates with the number of rods stimulated per burst sent. When ‘Repeat’ is selected, the ‘Cycles’ monitor updates with how many cycles are completed.
The ‘Photons vs Time’ plot displays the number of photons present with respect to time. When running ‘Repeat’, the plot continues to update with each run being represented in grey and a blue line traces out the average of the runs completed. The ‘Rods Stimulated vs Average Photons’ places a point at the number of rods stimulated for a given average number of photons at the end of each cycle.
THINGS TO NOTICE
‘Setup’ Button Notice how the ‘Photons Absorbed’ monitor changes as the beam moves across the interface. Why do some photons travel straight through the eye without refracting? Think about approximations that can apply to a lens.
Given how it behaves in the model, what do you think is the purpose of the retinal epithelium layer (the darkest blue rectangle in the zoomed in window on the right)?
Watch how the number of photons change with time on the ‘Photons vs Time’ graph.
What does the blue line on the graph trace out? Think about how it changes as the simulation repeats with the ‘Repeat’ button.
‘Underwater’ Setup Button Watch how the photons change direction as they enter different layers of the eye (ex. surrounding media, cornea, humours, lens). How does this vary between the regular setup and underwater setup?
How does the number of photons absorbed in the water media change with depth? Does this increase or decrease?
How do the goggles affect the incident beam of light?
Why would you need so many more initial photons for the underwater setup?
THINGS TO TRY
Test different depths with the slider in the ‘underwater’ mode. What do you notice? How does the pupil or absorption of photons change with depth?
Test different amounts of average photons. How does the number of photons emitted from the light source affect the production of a visual response?
Change the ‘n’ slider. How does adjusting the number of rods activated to produce a visual response, change the frequency of visual responses? How does it change the number of average photons that are required to be emitted?
EXTENDING THE MODEL
Add cones to create a more accurate retinal mosaic to account for colour vision.
Consider different wavelengths of light, by adding a slider to allow for the user to change the light conditions. Also, allow the refraction and absorption patterns to be changed by an adjustment in wavelength.
Try a different test patch on the retina, with respective rod and cone densities, that may have a lower or higher sensitivity to light.
Allow the user to change the angle of the light beam.
Account for the case where two photons simultaneously stimulate the same rods. As of right now, it counts this as two rods stimulated.
Try replacing the light beam with an object. This means the lens may have to change shape (different radii of curvature) depending on the object’s distance from the eye.
Account for how the pupil diameter changes with depth according to literature values.
RELATED MODELS
Models Referenced: * Radioactivity: “Decay” * “Plotting Example”
CREDITS AND REFERENCES
This Model was Inspired by the Journal Article: Hecht, S., Shlaer, S. and Pirenne, M.H., 1942. Energy, Quanta, and Vision. Journal of General Physiology, 25(6), pp.819–840. https://doi.org/10.1085/jgp.25.6.819.
NetLogo Simulation Citations: Wilensky, U., 1999. NetLogo (6.3.0). [computer program] Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. Available at: http://ccl.northwestern.edu/netlogo/.
For literature values, description of process, and full citation list: Full Model Documentation
HOW TO CITE
For use of this NetLogo model, we ask that you cite the publication following the below format.
To cite the 'Light to Brain' model specifically: Davidson-Lindfors, N. and Dykstra, J. (2023). NetLogo Light to Brain model. School of Interdisciplinary Science, McMaster University, Hamilton, ON.
To cite the NetLogo software: Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
Comments and Questions
; creating all variables used other than sliders that are present on interface globals[ StepSize ; how far photon moves with each tick rods-stimulated ; how many rods were stimulated by a burst of photons ystart ; starting y coordinate of yellow photons at the lefthand side of the screen ycell ; default y coordinate for retinal cells in zoomed in window yline ; starting y coordinate of green photons along white line cycles ; one cycle is one run of the simulation (i.e. one burst) number_photons ; the number of photons sent out per burst decays ; number of photons that have been absorbed in a cycle (gets updated continuously) CorneaDecay ; absorption value for cornea per pixel AqueousHumourDecay ; absorption value for aqueous humour per pixel VitreousHumourDecay ; absorption value for vitreous humour per pixel LensDecay ; absorption value for lens per pixel RetinaDecay ; absorption value for lens per pixel nwater ; absorption value for water per pixel with respect to depth irisMin ; magnitude of y coordinate of inside of iris (radius of pupil) bkgdcolor ; a number is assigned to represent a given background colour beamradius ; variable to convert beamwidth slider value (in mm) to pixels photoncount ; a list of the number of photons at each tick from 0 to 600 currentphotons ; variable used to create blue line on the photon vs time graph ; it is the average of the number of photons at a given tick value over the cycles that have occurred gphotons ; the number of green photons that have appeared in the zoomed in retinal panel on the right side of interface ] breed [photons photon] ; breed for turtles that act as photons to allow for easier breed [bolts bolt] ; breed for turtles shaped like lightning bolts that represent the signal that is sent when enough rods are stimulated ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; setup procedures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; regular simulation setup procedure. must be activated after sliders are changed and before any other button to setup clear-all ; set up standard background colour by filling entire interface with grey ask patches [ if pxcor <= max-pxcor [ set pcolor grey ] ] ; create white line to split interface ask patches with [pxcor = 100] [ set pcolor white ] ; the number of pixels a photon will move by on each tick set StepSize 1 ; set variables/lists to 0 and will later be given values set bkgdcolor 0 ; variable to check background colour: 0 if grey, 1 if blue set cycles 0 set gphotons 0 set decays 0 set rods-stimulated 0 set photoncount (n-values 601 [0]) ; set up list to have 601 entries of zero so they can be identified and replaced later ; set decay/absorption rates to match literature values (references outlined in info tab) set CorneaDecay 0.0084929 set AqueousHumourDecay 0.0013648 set VitreousHumourDecay 0.00050404 set LensDecay 0.0010123 set RetinaDecay 0.001358 set nwater 0.002 ; call set scale procedure that creates the scale bars setscale ; call procedures that draw the parts of the eye ; size and distances are scaled version of actual eye layer dimensions sclera VitreousHumour aqueoushumour lens cornea irisStructure retina ; add labels for temporal and nasal sides of the eye ask patch (-60) (175) [set plabel-color 9.9 set plabel "Temporal"] ask patch (-60) (-175) [set plabel-color 9.9 set plabel "Nasal"] ; write "loading ..." in output on interface which will later announce if a visual response has occurred output-write "Loading ..." reset-ticks ; call procedure that makes photons so there are photons when the simulation starts make-photons end ; procedure to create scale bars to setscale ; scale bar for left side of interface ; this scale was calculated to be 12 pixels/mm ask patches with [pxcor >= -290 and pxcor < (-290 + 120) and -180 >= pycor and pycor >= -190] [set pcolor 0] ; draw a 10 mm-long scale bar in the lower left corner ask patch (-215) (-170) [set plabel-color 0 set plabel "10 mm"] ; add the label for the scale bar ; scale bar for right side of interface (zoomed in retinal window) ; this scale was calculated to be 1 pixels/μm ask patches with [pxcor >= 288 and pxcor < (298) and (-190 + 40) >= pycor and pycor >= -190] [set pcolor 0] ; draw a 40 μm-long scale bar in the lower right corner ask patch (298) (-130) [set plabel-color 0 set plabel "40"] ; add the label for the scale bar ask patch (298) (-140) [set plabel-color 0 set plabel "μm"] end ; experimental setup procedure which is the same as standard setup but without calling "clear-all" first as that would clear all plot data on the interface to setupexp ; the following clear procedures are still necessary to reset the interface and variables for each run clear-drawing clear-turtles ; set up standard background colour by filling entire interface with grey ask patches [ if pxcor <= max-pxcor [ set pcolor grey ] ] ; create white line to split interface ask patches with [pxcor = 100] [ set pcolor white ] ; the number of pixels a photon will move by on each tick set StepSize 1 ; set variables/lists to 0 and will later be given values set bkgdcolor 0 ; variable to check background colour: 0 if grey, 1 if blue set cycles 0 set gphotons 0 set decays 0 set rods-stimulated 0 set photoncount (n-values 601 [0]) ; set up list to have 601 entries of zero so they can be identified and replaced later ; set decay/absorption rates to match literature values (references outlined in info tab) set CorneaDecay 0.0084929 set AqueousHumourDecay 0.0013648 set VitreousHumourDecay 0.00050404 set LensDecay 0.0010123 set RetinaDecay 0.001358 set nwater 0.002 ; call set scale procedure that creates the scale bars setscale ; call procedures that draw the parts of the eye. size and distances are scaled version of actual eye layer dimensions sclera VitreousHumour aqueoushumour lens cornea irisStructure retina ; add labels for temporal and nasal sides of the eye ask patch (-60) (175) [set plabel-color 9.9 set plabel "Temporal"] ask patch (-60) (-175) [set plabel-color 9.9 set plabel "Nasal"] ; write "loading ..." in output on interface which will later announce if a visual response has occurred output-write "Loading ..." reset-ticks ; call procedure that makes photons so there are photons when the simulation starts make-photons end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; draw eye layers & cells ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; procedure to draw cornea to Cornea ; draw cornea by filling in the region between a circle and ellipse ; the outer circle has the same radius of curvature as the cornea ; the inner ellipse is placed at the literature distance from the outer layer ask patches with [(pxcor + 144) ^ 2 + (pycor) ^ 2 < 8761 and (pxcor + 140 ) ^ 2 + (pycor / 1.05) ^ 2 > 8661] [ set pcolor pink ] end ; procedure to draw sclera to Sclera ; fill in region between concentric circles ; circle size was determined so that the distance between the cornea and the back of the sclera would be equivalent to 24 mm ask patches with [(pxcor + 80 ) ^ 2 + (pycor) ^ 2 < 20000 and (pxcor + 80 ) ^ 2 + (pycor) ^ 2 > 19000] [ set pcolor red ] ; call procedures to replace region of sclera with the retinal test patch RetinaPatch end ; procedure to create test patch region on retina to RetinaPatch ; fills in a region of the retina 2 pixels out from either side of a line that passes from the centre of the light beam through the centre of the lens (line of no refraction for photons) ; this region is the smaller depiction of the zoomed in window on the right-side of interface in which the number of rods stimulated will be recorded ask patches [ if pcolor = red and (((47 / 130)* pxcor + (31)) >= pycor and pycor >= ((47 / 130)* pxcor + 27) and pxcor >= 0) [set pcolor 94] ] end ; procedure to draw aqueous humour to AqueousHumour ; fill in region between cornea and lens with white (representing the humour) ask patches with [(pxcor + 140) ^ 2 + (pycor) ^ 2 < 8761 and -200 >= pxcor] [ set pcolor white ] end ; procedure to draw lens to Lens ; lens drawn as region contained by two circles with radii equivalent to the anterior and posterior radii of curvature of the lens ask patches with [(pxcor + 79) ^ 2 + (pycor) ^ 2 < 14400 and (pxcor + 211) ^ 2 + (pycor) ^ 2 < 5184] [ set pcolor 88 ] end ; procedure to draw vitreous humour to VitreousHumour ; fill in any grey region within the sclera with white (representing humour) ask patches with [(pxcor + 80 ) ^ 2 + (pycor) ^ 2 < 20000 and pcolor = grey] [ set pcolor white ] end ; procedure to draw iris and pupil structure to irisStructure ; first relate pupil slider to size of iris ; set the magnitude for the inner y coordinate of the iris to be the radius of the pupil in pixels set irisMin ((12 * (Pupil / 2))) ; create top half of iris ask patches with [(72 >= pycor and pycor >= irisMin and -200 >= pxcor and pxcor >= -203)] [ set pcolor 34 ] ; create bottom half of iris ask patches with [((- irisMin) >= pycor and pycor >= -72 and -200 >= pxcor and pxcor >= -203)] [ set pcolor 34 ] end ; procedure to draw retinal cells using rectangles to retina ; set default y coordinates for retinal cells set ycell 195 ask patches [ if ycell >= pycor and pycor >= -195 [ ; create retinal ganglion cells which are the lightest blue ones furthest to left ask patches with [190 >= pxcor and pxcor >= 175 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 98 ] ; create bipolar cells wihch are the next cells to the right of the retinal ganglion cells ask patches with [210 >= pxcor and pxcor >= 195 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 97 ] ; create rods which are the longer cells to the right of the bipolar cells ask patches with [265 >= pxcor and pxcor >= 215 and ycell >= pycor and pycor >= (ycell - 2)] [ set pcolor 96 ] ; create retinal pigment epithelium cells ; goes all the way across since they're densely packed and are the last layer which then absorbs scattered light ask patches with [280 >= pxcor and pxcor >= 270 and 200 >= pycor and pycor >= -200] [ set pcolor 95 ] ; decrease y values of the retinal ganglion cells, bipolar cells, and rods by 5 on each loop to create evenly spaced cells set ycell (ycell - 5) ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; underwater setup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; underwater setup procedure that alters the started setup to underwater clear-turtles clear-drawing set bkgdcolor 1 ; set this variable to 1 to indicate that the background is now blue set avgphotons 1000 ; assuming that 1000 photons are entering the water at sea level ; set background colour to be blue to represent water ask patches with [pcolor = grey and 100 > pxcor] [ set pcolor 105 ] ; call goggle procedures goggles ; reset the iris region to be white so it can be replaced by the appropriate pupil size ; for the given depth chosen on the slider prior to pressing the underwater button ask patches with [ 72 >= pycor and pycor >= -72 and -200 >= pxcor and pxcor >= -203] [ set pcolor white ] ; set pupil size to increase with depth (based on what is selected on slider) ; nwater values are also set according to literature values with respect to depth to simulate ; the decrease in light intensity as depth increases ; the size of the pupil increases with depth if 0 >= depth and depth > -2 [ set nwater 0 ; absorption values are based on the shallowest depth, in this case 0 m from sea level set pupil 2 irisStructure ] if -2 >= depth and depth > -4 [ set nwater 0.008355 set pupil 3 irisStructure ] if -4 >= depth and depth > -6 [ set nwater 0.01585 set pupil 4 irisStructure ] if -6 >= depth and depth > -8 [ set nwater 0.02332 set pupil 5 irisStructure ] if -8 >= depth and depth > -10 [ set nwater 0.0303 set pupil 6 irisStructure ] if -10 >= depth and depth > -12 [ set nwater 0.0394 set pupil 7 irisStructure ] if -12 >= depth and depth >= -14 [ set nwater 0.0461 set pupil 8 ; assuming the maximum dilation of the eye occurs at a depth between -12 m and -14 m irisStructure ] if -14 >= depth and depth >= -16 [ set nwater 0.0506 set pupil 8 irisStructure ] if -16 >= depth and depth >= -18 [ set nwater 0.6060 set pupil 8 irisStructure ] make-photons end ; draw goggles around eye to goggles ; create air pocket between goggle lens and eye ask patches with [ pcolor = 105 and 100 >= pxcor and pxcor >= -269 and 145 >= pycor and pycor >= -145] [ set pcolor grey ] ; lens of goggles ask patches with [ -267 >= pxcor and pxcor >= -271 and 145 >= pycor and pycor >= -145] [ set pcolor 89 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; make-photons ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; procedure to make intial photons to make-photons ; set the number of photons per burst with a Poisson distribution centred at the average photons chosen on the slider set number_photons (random-poisson avgphotons) create-photons Number_Photons [ ; translate mm to pixels and diameter of beam to radius set beamradius (0.5 * 12 * beamwidth) ; centre light beam around (-300, -564/23) which is the point on the line though the centre of the mens and to the retinal patch when x = -300 set ystart ((-564 / 23) - beamradius + random(2 * beamradius)) set shape "Arrow" set color 66 ; starting photons are green ; the starting y coordinate for the inital photons can be -564/23 +/- the beam radius setxy -300 ystart ; set up angle of beam (from up as 0°) if(bkgdcolor = 0) ; grey background (air) [ set heading 78 ; angle that causes centre of beam to pass through centre of lens and reach retina with no refraction ] if(bkgdcolor = 1) ; blue background (water) [ set heading 46 ; angle calculated using Snell's Law for refraction that occurs when light moves from air to water ] set size 15 pen-down ] reset-ticks end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; go procedures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to burst ask photons [ forward StepSize ; the photons move forward 1 pixel/tick ;;;;;;;; specifying the absorption values for each layer of the eye ;;;;;;;;; ; absorption and refraction at cornea if pcolor = pink [ facexy 55 48 ; focal point is just beyond retina absorbcornea ] ; absorption in humours if pcolor = white [absorbhumour] ; absorption and refraction at lens if pcolor = 88 [ ; call absorption absorblens ; if photons reach center of lens, refract if pxcor = -180 [ facexy 50 47 ; bend to focus light on retinal patch (correct cornea refraction) ] ] ; the iris is the structure that preventing photons from passing, except if they are within the pupil if pcolor = 34 [ set decays decays + 1 die ; when the photons hit the iris they die ] ; underwater media absorption for when underwater procedure activated by button if pcolor = 105 [waterabsorb] ; refraction at goggles if pcolor = 89 [ set heading 78 ; based on refraction values in air ] ;;;;;;;; absorption within right panel of the interface ;;;;;;;;;;;;;;;;;;;;;;;; ; absorption of photons by rods if 270 >= xcor and xcor >= 175 ; contains the entire area of the retina on the right panel of the interface [ absorbretina ] ;; if incident photon hits retinal test patch, moves to random y-coordinate at x = 105 in the retina if pcolor = 94 ; the colour of the retinal test patch [ set yline random-ycor ; provides variation along the y-axis of the retina pen-up set color 67 ; changes the photons to the colour green set size 10 set shape "circle" setxy 105 yline facexy 300 yline wait 0.03 ; create time delay between photon hitting patch and appearing in window, for cosmetic purposes pen-down ] if pcolor = 95 [die] ; absorbed by retinal epithelium layer if pcolor = red [die] ; absorbed by the sclera if pxcor = 100 [die] ; for initial photons that pass the eye, ensures they don't enter the retina ] ; if one of the patches changes to the yellow colour, all remaining blue rod pixels change to yellow ask patches [ if pcolor = 46 [ ask neighbors [ if pcolor = 96 [ set pcolor 46 ; changes final colour to yellow ] ] ] ] ; the following steps are called if the number of rods stimulated is at least equal to the number of photons needed to be ; absorbed by rods to elicit a visual response as chosen in the n slider if rods-stimulated >= n [ create-bolts 1 ; the presence of a bolt is a visual depiction of a light signal being sent to the brain [ set shape "lightning" set color 46 set size 75 setxy 140 0 ; the bolt forms to the left of the cells of the retina ] ] ; after all photons have died if any? photons = false [ ifelse rods-stimulated >= n [ ; if enough rods have been stimulated for a given burst, "visual response" is shown in the output monitor on interface clear-output output-write "Visual Response" ] [ ; if not enough rods have been stimulated for a given burst, "no visual response" is shown in the output monitor on interface clear-output output-write "No Visual Response" ] ] ; data for 'average' line of cycles in photons vs time graph ; photoncount updates the index with the current photons, in addition value of the array at that tick from past cycles ; photoncount is an array that indicates the total number of photons for a given time (tick) value set photoncount (replace-item ticks photoncount ((item ticks photoncount) + (count photons))) ; currentphotons is a running average of the photons at a given time (tick), across cycles set currentphotons ((item ticks photoncount) / (cycles + 1)) tick ; once the green photons enter the zoomed in retina window, but before the retina, gphotons is updated ; gphotons is used to calculate the number of photons that successfully entered the retinal patch if ticks = 390 [ set gphotons (count photons) ] if ticks = 600 [stop] ; a full cycles has been completed after 600 ticks end to rerun burst ; call the single go procedure (burst) ; allows 10x cycles each with 600 ticks to be run if ticks = 600 [ set cycles (cycles + 1) reset-ticks set gphotons 0 set decays 0 resetYellow ; reset the color and state of rods clear-drawing make-photons clear-output output-write "Loading ..." ] if cycles = 10 [stop] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; absorb ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; when within the pink-coloured cornea region, probabilistic absorption photons occurs to absorbcornea if random-float 1 < CorneaDecay ; calculated absorption/pixel for the cornea [ set decays decays + 1 ; allows for the number of absorbed ('decayed') photons to measured die ; these photons do not proceed towards the retina ] end ; when within the white-coloured aqueous and vitreous humour region, probabilistic absorption occurs to absorbhumour if -180 >= pxcor [ if random-float 1 < AqueousHumourDecay ; calculated absorption/pixel for aqueous humour [ set decays decays + 1 die ] ] if pxcor >= -180 [ if random-float 1 < VitreousHumourDecay ; calculated absorption/pixel for vitreous humour [ set decays decays + 1 die ] ] end ; when within the lens region, probabilistic absorption occurs to absorblens if random-float 1 < LensDecay ; calculated absorption/pixel for lens [ set decays decays + 1 die ] end ; account for the refractive index of water that surrounds the eye when underwater to waterabsorb if random-float 1 < nwater ; nwater changes based on depth, in "underwater setup" [ set decays decays + 1 die ] end ; when within the retina region, probabilistic absorption occurs to absorbretina if random-float 1 < RetinaDecay ; calculated absorption/pixel for the retina [ ; if in the blue rods, visually show activated rods with yellow ifelse pcolor = 96 [ set rods-stimulated (rods-stimulated + 1) ; shows that the rods have been stimulated if [pcolor] of patch-ahead 1 != 46 ; change pcolour, as long as the patch 1 ahead is not already yellow (activated) [ set pcolor 46 ; change pcolour to yellow to show activation ] die ] ; if not in the retina region, the same retina absorption rate will apply [ set decays decays + 1 die ] ] end ; used after each cycle to reset the patch colour and remove the lightning bolt to resetYellow ask patches [ if pcolor = 46 [ set pcolor 96 set rods-stimulated 0 ] ask bolts with [color = 46] [die] ] end ; ISCI 2A18 Enrichment Project 2023 ; More detailed information about model in the "Info" tab ; Authors: Jeremy Dykstra and Naya Davidson-Lindfors ; Supervisor: Dr. Cecile Fradin
There is only one version of this model, created about 2 years ago by Jeremy Dykstra.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Light to Brain Model.png | preview | Preview for 'Light to Brain Model' | about 2 years ago, by Jeremy Dykstra | Download |
This model does not have any ancestors.
This model does not have any descendants.