Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Previous revision
mgl:overview [2020/03/03 11:02]
mgl:overview [2023/11/14 16:48] (current)
justin [A quick overview]
Line 13: Line 13:
  
 Mgl is a suite of mex/m files for displaying visual psychophysics stimuli and writing experimental programs in Matlab. Mgl is a suite of mex/m files for displaying visual psychophysics stimuli and writing experimental programs in Matlab.
-Runs on Mac OS X and is compatible with latest versions of the Mac OS (Catalina ​as of 3/2020). There is an [[:mgl:mglmetal|alpha (proof of principle) version]] that is compatible with Metal.+Runs on Mac OS X and is compatible with latest versions of the Mac OS (Ventura ​as of this writing 8/11/2023). It is based on [[https://​developer.apple.com/​documentation/​metal|Metal]],​ Apple'​s low-level graphics card libarary. See [[:mgl:pubs|here]] for a list of publications ​that have used mgl and how to cite use of mgl in your manuscript!
 ====== ​ A quick overview ​ ====== ====== ​ A quick overview ​ ======
  
-mgl is a set of matlab functions for displaying full screen visual stimuli from matlab. It is based on OpenGL functions, but abstracts these into more simple functions that can be used to code various kinds of visual stimuli. It can be used on Mac OS X systems ​(a Windows [[mgl:​beta|beta]] exists which can open/close screen and display but is not ready for serious use and an older but usable version ([[mgl:​download#​older_versions_of_mgl|1.5]]) exists for Linux. Neither windows nor linux versions are recommended for anyone who is not comfortable programming in C and building out existing functionality into a fully compatible version)+mgl is a set of matlab functions for displaying full screen visual stimuli from matlab. It is based on Apple Metal with simple functions that can be used to code various kinds of visual stimuli. It can be used on Mac OS X systems ​only
  
   * mgl contains a set of higher-level [[mgl:​taskReference|routines]] for helping you write stimulus programs which takes care of parameter randomization,​ timing of trials, synching with MRI scanners, collection of eye data etc.   * mgl contains a set of higher-level [[mgl:​taskReference|routines]] for helping you write stimulus programs which takes care of parameter randomization,​ timing of trials, synching with MRI scanners, collection of eye data etc.
Line 29: Line 29:
   * You can get accurate [[:​mgl:​functionReferenceKeyboardAndMouse|keyboard and mouse]] event information.   * You can get accurate [[:​mgl:​functionReferenceKeyboardAndMouse|keyboard and mouse]] event information.
   * You can play [[:​mgl:​functionReferenceSound|sounds]].   * You can play [[:​mgl:​functionReferenceSound|sounds]].
-  * You can play quicktime [[:​mgl:​functionReferenceMovie|movies]]. 
   * You can [[:​mgl:​functionReferenceScreen#​mglswitchdisplayswitch_between_multiple_monitors|control multiple screens]] for example to control stereo displays.   * You can [[:​mgl:​functionReferenceScreen#​mglswitchdisplayswitch_between_multiple_monitors|control multiple screens]] for example to control stereo displays.
   * mgl is 64-bit compliant.   * mgl is 64-bit compliant.
Line 55: Line 54:
 </​code>​ </​code>​
  
-When finishedwith displaying the stimuli, you simply close the screen:+When finished with displaying the stimuli, you simply close the screen:
  
   mglClose;   mglClose;
  
-====== ​ Design philosophy ​ ====== 
- 
-A couple of things that distinguish MGL from other packages for doing psychophysics experiments using Matlab. 
- 
-1) **Simple standalone functions**. We were aiming to make the code as simple as possible, so that we and others could extend functionality as easily as possible. So a major design goal was to keep each function as atomic and simple as possible - every function is one C/MEX file that has OS specific code clearly separated out, typically as a separate function. Something like the philosophy behind UNIX where kitchen sink type functions are frowned upon. This was so that it would be easy to hack in the future and for others. New functionality typically gets added as a separate function so we don't risk breaking existing code. Functions are simple so that they are easier to maintain against OS upgrades (the back end of MGL was rewritten a few years ago using objective-C so that we could be 64-bit compliant). ​ 
- 
-2) **Task library**. We have a low-level library for displaying stimuli and accessing hardware as well as a [[:​mgl:​TaskReferenceOverview|task library]] which sits on top of that. The task library simplifies writing experiments since it takes care of timing, trials, synching with digital pulses, interfacing with eye-trackers etc. Each new experiment simply implements callback functions that handle how to draw the screen, what to do when a subject responds etc. This makes it quick to write new experiments and makes sure that problems fixed for one experiment are solved for all experiments. ​