TarzaNN
TarzaNN neural network simulator
C:/Users/albertlr/projects/TarzaNN/TarzaNN/InputFeaturePlane.h
Go to the documentation of this file.
00001 /****************************************************************************
00002  **
00003  ** Copyright C 2002-2012 Laboratory for Active and Attentive Vision (LAAV), Department of Computer Science and Engineering, York University, Toronto, ON, Canada.
00004  ** All rights reserved.
00005  **
00006  ** This file is part of the TarzaNN Neural Network Simulator.
00007  **
00008  ** This file may be distributed and/or modified under the terms of the
00009  ** GNU General Public License version 2 as published by the Free Software
00010  ** Foundation and appearing in the file LICENSE.GPL included in the
00011  ** packaging of this file.
00012  **
00013  ** See http://www.tarzann.org/gpl/ for GPL licensing information.
00014  **
00015  ** Contact info@tarzann.org if any conditions of this licensing are
00016  ** not clear to you.
00017  **
00018  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00019  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00020  **
00021  ****************************************************************************/
00022 
00023 #ifndef INPUTFEATUREPLANE_H_INCLUDED
00024 #define INPUTFEATUREPLANE_H_INCLUDED
00025 
00026 #include  <qimage.h>
00027 
00028 #include "nowarn.h"
00029 #include "common.h"
00030 #include <stdlib.h>
00031 
00032 #include "OutputImage.h"
00033 #include "InputFeaturePlaneAbstract.h"
00034 
00043 enum {TASK_TYPE_NULL, TASK_FEATURES, TASK_SPATIAL, TASK_MIXED, TASK_TYPE_LAST}; 
00045 enum {TASK_CODE_NULL, TASK_CENTER, TASK_LEFT, TASK_RIGHT, TASK_UP, TASK_DOWN, TASK_UP_LEFT, TASK_UP_RIGHT, TASK_DOWN_LEFT, TASK_DOWN_RIGHT, TASK_CODE_LAST}; 
00046 
00047 
00049 class InputFeaturePlane : public InputFeaturePlaneAbstract {
00050         friend class FeaturePlaneFactory;
00051         friend class Network;
00052 public:
00053     ~InputFeaturePlane();
00054     void run();
00055     
00056 protected:
00058     //    InputFeaturePlane( Network* net, int l){
00059     //        loadInputFeaturePlane("input/test.pgm", false, 0, 0);
00060     //        net->_featurePlaneList.push_back(this);
00061     //        fpType = FP_INPUT;
00062     //    };
00063         
00074         InputFeaturePlane( Network* net, int l, const char* filename, QString* name, bool isWTA, bool visible, bool scale, float min, float max, NotifyStrategyAbstract* notify, int taskType=TASK_TYPE_NULL, const char* taskFilename=NULL, int taskCode=TASK_CODE_NULL);
00075         void inhibitReturn();
00076         void applyGatingControl(Matrix* theGatingControl);
00077         void applyIOR(Matrix* iorMap);
00078     
00079     bool scale;
00080         float min, max;
00081     
00082     static int codeCoordinates[TASK_CODE_LAST][4];
00083     
00084 private:
00085     void loadInputFeaturePlane(const char *filename, bool scale, float min, float max, QImage* saved=NULL);
00086     void generateSpatialMaskInput(int startX, int startY, int endX, int endY);
00087     void setupHistory(QImage* tempImage);
00088     
00089     const char* filename;
00090     const char* taskFilename;
00091 
00092     int taskType;
00093     int taskCode;
00094     
00095     void runFeaturesTask();
00096     void runSpatialTask();
00097     void runMixedTask();
00098     
00099 };
00100 #endif //INPUTFEATUREPLANE_H_INCLUDED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines