00001 /*!@file Script/NeuroScript.C */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00005 // by the University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Script/NeuroScript.C $ 00035 // $Id: NeuroScript.C 11876 2009-10-22 15:53:06Z icore $ 00036 // 00037 00038 #ifndef SCRIPT_NEUROSCRIPT_C_DEFINED 00039 #define SCRIPT_NEUROSCRIPT_C_DEFINED 00040 00041 #include "Script/NeuroScript.H" 00042 00043 #include "Media/FrameSeries.H" 00044 #include "Neuro/AttentionGuidanceMap.H" 00045 #include "Neuro/Brain.H" 00046 #include "Neuro/GistEstimator.H" 00047 #include "Neuro/InferoTemporal.H" 00048 #include "Neuro/Retina.H" 00049 #include "Neuro/EyeHeadController.H" 00050 #include "Neuro/NeuroSimEvents.H" 00051 #include "Neuro/SaliencyMap.H" 00052 #include "Neuro/ShapeEstimator.H" 00053 #include "Neuro/SimulationViewer.H" 00054 #include "Neuro/StdBrain.H" 00055 #include "Neuro/TaskRelevanceMap.H" 00056 #include "Neuro/VisualCortex.H" 00057 #include "Neuro/WinnerTakeAll.H" 00058 #include "Script/ImageScript.H" // for tcl<->Image conversions 00059 #include "Script/MediaScript.H" // for tcl<->SimTime conversions 00060 #include "Script/ModelScript.H" // for registerComponentCreator() 00061 #include "tcl/objpkg.h" 00062 #include "tcl/list.h" 00063 #include "tcl/pkg.h" 00064 00065 namespace 00066 { 00067 tcl::list brainEvolve(nub::soft_ref<Brain> brain, 00068 nub::soft_ref<SimEventQueue> q) 00069 { 00070 const SimStatus status = q->evolve(); // note: this should come last... 00071 bool covertshift = false; 00072 if (SeC<SimEventWTAwinner> e = q->check<SimEventWTAwinner>(0)) 00073 covertshift = true; 00074 00075 tcl::list result; 00076 result.append(q->now()); 00077 result.append(covertshift); 00078 result.append(SIM_BREAK == status); 00079 00080 return result; 00081 } 00082 } 00083 00084 extern "C" 00085 int Brain_Init(Tcl_Interp* interp) 00086 { 00087 GVX_PKG_CREATE(pkg, interp, "Brain", "4.$Revision: 1$"); 00088 pkg->inherit_pkg("Modelcomponent"); 00089 tcl::def_basic_type_cmds<Brain>(pkg, SRC_POS); 00090 00091 registerComponentCreator<Brain>(); 00092 00093 pkg->def("evolve", "objref seq", &brainEvolve, SRC_POS); 00094 00095 // pkg->def("saveResults", "objref ofs", &Brain::saveResults, SRC_POS); 00096 00097 GVX_PKG_RETURN(pkg); 00098 } 00099 00100 00101 extern "C" 00102 int Stdbrain_Init(Tcl_Interp* interp) 00103 { 00104 GVX_PKG_CREATE(pkg, interp, "StdBrain", "4.$Revision: 1$"); 00105 pkg->inherit_pkg("Brain"); 00106 tcl::def_basic_type_cmds<StdBrain>(pkg, SRC_POS); 00107 00108 registerComponentCreator<StdBrain>(); 00109 00110 GVX_PKG_RETURN(pkg); 00111 } 00112 00113 extern "C" 00114 int Winnertakeall_Init(Tcl_Interp* interp) 00115 { 00116 GVX_PKG_CREATE(pkg, interp, "WinnerTakeAll", "4.$Revision: 1$"); 00117 pkg->inherit_pkg("Modelcomponent"); 00118 tcl::def_basic_type_cmds<WinnerTakeAll>(pkg, SRC_POS); 00119 00120 GVX_PKG_RETURN(pkg); 00121 } 00122 00123 extern "C" 00124 int Winnertakeallstd_Init(Tcl_Interp* interp) 00125 { 00126 GVX_PKG_CREATE(pkg, interp, "WinnerTakeAllStd", "4.$Revision: 1$"); 00127 pkg->inherit_pkg("Winnertakeall"); 00128 tcl::def_basic_type_cmds<WinnerTakeAllStd>(pkg, SRC_POS); 00129 00130 GVX_PKG_RETURN(pkg); 00131 } 00132 00133 // ###################################################################### 00134 /* So things look consistent in everyone's emacs... */ 00135 /* Local Variables: */ 00136 /* indent-tabs-mode: nil */ 00137 /* End: */ 00138 00139 #endif // SCRIPT_NEUROSCRIPT_C_DEFINED