00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef READCELL_H
00010 #define READCELL_H
00011 enum ParseStage { COMMENT, DATA, SCRIPT };
00012
00024 class ReadCell
00025 {
00026 public:
00027
00028 ReadCell();
00029
00030 Id read(
00031 const string& filename,
00032 const string& cellname,
00033 Id parent );
00034
00035 static void addChannelMessage( Id chan );
00036 private:
00037 bool innerRead( ifstream& fin );
00038 bool readData( const string& line );
00039 bool readScript( const string& line );
00040 Id buildCompartment(
00041 const string& name,
00042 const string& parent,
00043 double x0, double y0, double z0,
00044 double x, double y, double z,
00045 double d,
00046 double& length,
00047 vector< string >& argv );
00048 bool buildChannels(
00049 Id compt,
00050 vector< string >& argv,
00051 double diameter,
00052 double length);
00053 Id startGraftCell( const string& cellPath );
00054 Id findChannel( const string& name );
00055 Id addChannel(
00056 Id compt,
00057 Id chan,
00058 double value,
00059 double dia,
00060 double length );
00061 bool addCanonicalChannel(
00062 Id compt,
00063 Id chan,
00064 double value,
00065 double dia,
00066 double length );
00067 bool addSpikeGen(
00068 Id compt,
00069 Id chan,
00070 double value,
00071 double dia,
00072 double length );
00073 bool addCaConc(
00074 Id compt,
00075 Id chan,
00076 double value,
00077 double dia,
00078 double length );
00079 bool addNernst(
00080 Id compt,
00081 Id chan,
00082 double value );
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 void countProtos();
00100
00101
00102 string fileName_;
00103 unsigned int lineNum_;
00104
00105 double RM_;
00106 double CM_;
00107 double RA_;
00108 double EREST_ACT_;
00109 double ELEAK_;
00110 double dendrDiam;
00111 double aveLength;
00112 double spineSurf;
00113 double spineDens;
00114 double spineFreq;
00115 double membFactor;
00116 bool erestFlag_;
00117 bool eleakFlag_;
00118
00119 Id cell_;
00120 Id currCell_;
00121 Id lastCompt_;
00122 Id protoCompt_;
00123
00124 unsigned int numCompartments_;
00125 unsigned int numChannels_;
00126 unsigned int numOthers_;
00127
00128 unsigned int numProtoCompts_;
00129 unsigned int numProtoChans_;
00130 unsigned int numProtoOthers_;
00131
00136 bool graftFlag_;
00137 bool polarFlag_;
00138 bool relativeCoordsFlag_;
00139 bool doubleEndpointFlag_;
00140 bool symmetricFlag_;
00141
00142 map< string, Id > chanProtos_;
00143
00144 Shell* shell_;
00145 };
00146 #endif