
The Guide to Psychophysics Programming with JAVA Huseyin Boyaci September 28, 2006 Contents 1 Introduction 5 1.1 Why Java? . 5 1.2 What Java offers to the Psychophysicist . 5 1.3 Comparison to other tools, particularly to Psychtoolbox . 8 1.3.1 Advantages . 8 1.3.2 Disadvantages (mispercieved and real) . 9 1.3.3 So, which one to choose? . 10 1.4 How to use the Guide . 10 1.4.1 The Guide as a programming book . 10 1.4.2 The Guide as a manual to the tools developed . 11 1.4.3 List of classes and methods built in the Guide . 11 1.5 Setting up the Java platform . 14 1.5.1 MS Windows . 14 1.5.2 Mac OS X . 14 1.5.3 Linux - Fedora Core 5 (FC5) . 14 1.6 Getting the source code for the Guide . 15 1.7 Development environments . 16 1.7.1 Using command-line tools . 16 1.7.2 Using Eclipse, an Integrated Development Environment (IDE) . 16 1.7.3 Using with Matlab . 19 1.7.4 Using with Mathematica . 19 1.8 Further readings . 20 2 Hello Psychophysicist 21 2.1 Full Screen Exclusive Mode (FSEM) . 25 2.2 Active Rendering and Double Buffering . 27 2.3 Displaying Image and Text . 27 2.4 Hiding and showing the cursor . 31 2.5 Terminating FSEM . 32 3 Introduction to threads 36 3.1 Constructing concurrently running threads . 36 3.2 Summary . 39 4 Accurate timing 41 4.1 Sources of timing inaccuracies . 41 4.1.1 Precision (resolution) of timer utilities in core Java . 41 4.1.2 Thread.sleep() inaccuracies . 42 4.1.3 Stimulus display time and display refresh synchronization . 44 4.1.4 Other factors . 45 2 Contents 4.2 Accurate timing in animations . 45 4.2.1 Achromatic grating . 48 4.2.2 Exception Handling in Java . 48 4.3 Other timing methods . 48 4.4 Summary . 48 5 Threaded Animations: Moving balls (I) 49 5.1 More threads . 49 5.1.1 Bouncing balls with many threads . 49 6 Getting observer response 50 6.1 Event handling mechanism in Java . 50 6.2 Writing your own specialized event handler . 52 6.3 A built-in thread safe event handler for the FullScreen class . 60 6.3.1 Examples using built-in methods . 69 6.4 Summary . 74 6.4.1 On using the FullScreen methods . 74 6.4.2 On writing your own specialized event handler . 75 7 Geometrical shapes with Java Imaging model 76 8 Color look up tables 77 8.1 What is a look-up table? Why do you need an inverse look-up operation? . 77 8.1.1 Preparing the look-up table . 77 8.2 Inverse operation: finding out which pixel gives the desired luminance . 79 8.2.1 A class to perform inverse look-up operation . 82 8.3 Example: (inverse) Look-up operation on an image . 92 8.4 Experiment: Cornsweet illusion . 94 8.5 Look up operation in Standard Java Libraries . 106 8.6 Summary . 107 8.6.1 Using CLUT8 . 107 8.6.2 Using Standard Java . 107 9 Fine tune your strategies to eliminate artifacts 108 10 Managing the Display 109 10.1 Multiple Displays . 109 10.2 Screen characteristics . 110 10.3 Stereo display systems . 113 10.4 Examples . 121 10.5 Summary . 124 11 Applets, normal window applications, packaging and sharing your work 125 11.1 NormalWindow class . 125 11.1.1 Constructor . 126 11.1.2 storing the entire screen in a BufferedImage . 126 11.1.3 Double Buffering and active/passive rendering in NormalWindow . 126 11.2 HelloPsychophysicist, normal window . 130 11.3 Java Applets . 132 3 Contents 11.4 HelloPsychophysicist, as an applet . 132 11.5 HelloPsychophysicist, a normal window as a pop-up in applet . 135 11.6 Deploying applets . 136 11.6.1 Packaging resources for Applets . 137 11.7 Preparing self running .jar files . 137 11.8 Applications deployed with Java Web Start (JWS) . 138 11.9 Summary . 139 12 Java Sound 141 13 Java3D and JOGL etc. 142 14 Networked Experiments 143 15 fMRI Experiments 144 16 Bits++ 145 16.1 Why do you need 14 bits? . 145 16.2 Communicating the bits++ look up table . 150 16.3 BitsPP class . 150 16.4 A Fake BitsPP class . 161 16.5 Examples . 164 17 Essential Numerical Analysis 170 17.1 Statistical description of data: Mean, variance etc. 170 17.2 Special functions . 170 17.3 Function minimization . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages20 Page
-
File Size-