00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _NEURO_MESH_H
00011 #define _NEURO_MESH_H
00012
00031 class NeuroMesh: public MeshCompt
00032 {
00033 public:
00034 NeuroMesh();
00035 NeuroMesh( const NeuroMesh& other );
00036 ~NeuroMesh();
00037 NeuroMesh& operator=( const NeuroMesh& other );
00039
00041
00046 void updateCoords();
00047
00049
00051
00061 void setSubTreePath( const Eref& e, string path );
00062 string getSubTreePath( const Eref& e ) const;
00063
00069 void setSubTree( const Eref& e, vector< ObjId > compartments );
00070 vector< ObjId > getSubTree( const Eref& e ) const;
00071
00076 void transmitSpineInfo( const Eref& e );
00077
00078
00085 void setSeparateSpines( bool v );
00086 bool getSeparateSpines() const;
00087
00088 unsigned int getNumSegments() const;
00089 unsigned int getNumDiffCompts() const;
00090
00091 void setDiffLength( double v );
00092 double getDiffLength() const;
00093
00094 void setGeometryPolicy( string v );
00095 string getGeometryPolicy() const;
00096
00097 unsigned int innerGetDimensions() const;
00098
00099 vector< Id > getElecComptList() const;
00100 vector< Id > getElecComptMap() const;
00101 vector< unsigned int > getStartVoxelInCompt() const;
00102 vector< unsigned int > getEndVoxelInCompt() const;
00103 vector< int > getSpineVoxelOnDendVoxel() const;
00104 vector< unsigned int > getDendVoxelsOnCompartment( ObjId compt ) const;
00105 vector< unsigned int > getSpineVoxelsOnCompartment( ObjId compt ) const;
00106
00107 vector< unsigned int > getParentVoxel() const;
00108 const vector< double >& vGetVoxelVolume() const;
00109 const vector< double >& vGetVoxelMidpoint() const;
00110 const vector< double >& getVoxelArea() const;
00111 const vector< double >& getVoxelLength() const;
00112
00114
00116
00118 unsigned int getMeshType( unsigned int fid ) const;
00120 unsigned int getMeshDimensions( unsigned int fid ) const;
00122 double getMeshEntryVolume( unsigned int fid ) const;
00124 vector< double > getCoordinates( unsigned int fid ) const;
00126 vector< double > getDiffusionArea( unsigned int fid ) const;
00128 vector< double > getDiffusionScaling( unsigned int fid ) const;
00130 double extendedMeshEntryVolume( unsigned int fid ) const;
00131
00133
00136 unsigned int innerGetNumEntries() const;
00138 void innerSetNumEntries( unsigned int n );
00139
00145 double vGetEntireVolume() const;
00146
00156 bool vSetVolumeNotRates( double volume );
00157
00159
00161
00163 void innerBuildDefaultMesh( const Eref& e,
00164 double size, unsigned int numEntries );
00165
00166 void innerHandleRequestMeshStats(
00167 const Eref& e,
00168 const SrcFinfo2< unsigned int, vector< double > >*
00169 meshStatsFinfo
00170 );
00171
00172 void innerHandleNodeInfo(
00173 const Eref& e,
00174 unsigned int numNodes, unsigned int numThreads );
00175
00176
00177
00183 double getAdx( unsigned int curr, unsigned int& parentFid ) const;
00184
00186 void buildStencil();
00187
00189
00191
00192 void matchMeshEntries( const ChemCompt* other,
00193 vector< VoxelJunction > & ret ) const;
00194
00195 void matchCubeMeshEntries( const ChemCompt* other,
00196 vector< VoxelJunction > & ret ) const;
00197
00198 void matchNeuroMeshEntries( const ChemCompt* other,
00199 vector< VoxelJunction > & ret ) const;
00200
00209 double nearest( double x, double y, double z,
00210 unsigned int& index ) const;
00211
00212 void indexToSpace( unsigned int index,
00213 double& x, double& y, double& z ) const;
00214
00215
00217
00219
00224 void insertSingleDummy( unsigned int parent, unsigned int self,
00225 double x, double y, double z );
00226
00230 void insertDummyNodes();
00231
00233 Id putSomaAtStart( Id origSoma, unsigned int maxDiaIndex );
00234
00239 void buildNodeTree( const map< Id, unsigned int >& comptMap );
00240
00248 bool filterSpines( Id compt );
00253 void updateShaftParents();
00254
00256
00257
00258 const vector< NeuroNode >& getNodes() const;
00259
00261 static const Cinfo* initCinfo();
00262
00263 private:
00270 vector< NeuroNode > nodes_;
00271
00277 string subTreePath_;
00278
00287 vector< unsigned int > nodeIndex_;
00288
00294 vector< double > vs_;
00295
00300 vector< double > area_;
00301
00303 vector< double > length_;
00304
00305
00306 double diffLength_;
00307
00314 bool separateSpines_;
00315
00316 string geometryPolicy_;
00317
00323 double surfaceGranularity_;
00324
00329 vector< Id > shaft_;
00330 vector< Id > head_;
00331 vector< unsigned int > parent_;
00332
00336 vector< unsigned int > parentVoxel_;
00337 };
00338
00339
00340 #endif // _NEURO_MESH_H