Lin
Back to Psych 221 Projects 2013
Background
Original photon calculator utility suggestion
Build a program, perhaps based on the ISET library, that calculates the spectral irradiance at the sensor from the scene radiance and a specification of the optics. Doing this for diffraction-limited optics, specifying only the f/#, is sufficient.
The utility should be backed by a wiki page that illustrates all of the steps in doing that calculation. This project should produce an educational and useful calculator.
- Doing an implementation that can run on a browser on the Internet is best.
- Doing a straight Matlab implementation with a nice GUI is also good.
- Implementing the ISET (Matlab) routines as a Python calculator has value, as well.
Submitted project background
The program will (hopefully) run in a browser, be able to take in lens transmission as a function of wavelength (or be able to choose from presets of lenses, such as that of the human eye, thin lens glass, and camera lenses, though I can only find data for a Nikon 55mm as of now), and an f/# and lens magnification / distances.
The calculation will also take into account cosine-fourth fall-off and irradiance blurring from diffraction. The program will get scene radiance from the two sample image scenes from ISET, and if possible, I'd like to make more scene radiance files (but it sounds like that requires special equipment) and lens transmission data (also, more special equipment, like a spectroradiometric measurer).
An article with graphics describing the calculations will be made.
Evolving project goals
An early draft of the project was completed and brought in to Professor Wandell for suggestions.
I also was interested in asking Professor Wandell how ISET/VSET was able to produce scene radiance from simple jpg files. The project in that state used VSET in order to calculate scene radiance from a jpg and an illuminant, and would then continue on to calculate irradiance incident on a sensor using the irradiance formula
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle E = \frac{\pi}{1+4(f\#)^2(1+\left|m\right|)^2} TL}
And furthermore apply cos-4th fall off / vignetting calculations of
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle E_{off-axis} = E_{on-axis} \cos^4 \phi}
The plan was also to work on an algorithm for spatial blurring (assuming operation is diffraction-limited) of
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle OTF = \begin{cases} \frac{2}{\pi} \left[ \arccos(\rho)-(\rho\sqrt(1-\rho^2)) \right ] & \mbox{for } \rho \leq 1 \\ 0 & \mbox{for } \rho \geq 1 \end{cases}}
And then to implement the VSET radiance calculations purely into Java, so the web application would be fully self-sufficient (i.e. not need VSET).
Professor Wandell listened patiently and then asked about how the application was structured: it was a layer of Javascript/HTML/CSS presented to the web browser, Java on the backend on the server, and VSET/Matlab was patiently running next to Java---a part I was getting ready to excise out, in order to finish the project. Professor Wandell suggested a different approach, instead, however---it would instead be a much more interesting teaching tool to continue with a VSET backend and to allow users to run different tutorials beyond just a photon calculator.
And so I worked to build a better photon calculator (now liberally including optics/sensor calculations from VSET) and to organize my code to better expose VSET/Matlab functions to the end-user in the web browser. The hope is to not only produce a good photon calculator tutorial for a good Psych 221 project, but to also lay the groundwork for anybody interested in vision science to build similar web tutorials quickly and easily!
Methods
Measuring retinotopic maps
Retinotopic maps were obtained in 5 subjects using Population Receptive Field mapping methods Dumoulin and Wandell (2008). These data were collected for another research project in the Wandell lab. We re-analyzed the data for this project, as described below.
MR Analysis
The MR data was analyzed using mrVista software tools.
Results - What you found
Retinotopic models in group-averaged data on the MNI template brain
Some text. Some analysis. Some figures. Maybe some equations.
Equations
If you want to use equations, you can use the same formats that are use on wikipedia.
See wikimedia help on formulas for help.
This example of equation use is copied and pasted from wikipedia's article on the DFT.
The sequence of N complex numbers x0, ..., xN−1 is transformed into the sequence of N complex numbers X0, ..., XN−1 by the DFT according to the formula:
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle X_k = \sum_{n=0}^{N-1} x_n e^{-\frac{2 \pi i}{N} k n} \quad \quad k = 0, \dots, N-1}
where i is the imaginary unit and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle e^{\frac{2 \pi i}{N}}} is a primitive N'th root of unity. (This expression can also be written in terms of a DFT matrix; when scaled appropriately it becomes a unitary matrix and the Xk can thus be viewed as coefficients of x in an orthonormal basis.)
The transform is sometimes denoted by the symbol Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{F}} , as in Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{X} = \mathcal{F} \left \{ \mathbf{x} \right \} } or Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{F} \left ( \mathbf{x} \right )} or Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{F} \mathbf{x}} .
The inverse discrete Fourier transform (IDFT) is given by
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x_n = \frac{1}{N} \sum_{k=0}^{N-1} X_k e^{\frac{2\pi i}{N} k n} \quad \quad n = 0,\dots,N-1.}
Limitations
- The server controls (and shares) one Matlab session among all current users. There are solutions (using HttpSession in Java for example), but implementation requires some thought.
- When re-deploying the project (for another user or onto another server, for example), Matlab paths are hard-coded and need to be changed appropriately (depending on operating system and computer setup).
Conclusions
Here is where you say what your results mean.
References
Software
Appendix I - Code and Data
Code
My code is hosted on GitHub, as per Professor Wandell's suggestions (minus vset, which should be in the starting directory and announced in Matlab with isetPath()).
Data
zip file with filter data and some simple Matlab scripts; should go in Matlab starting directory