Loading src/main_Generator.cpp +31 −6 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,15 @@ class timeVector: public std::vector<int> //use tipIndex() below to address filopodia branches //use tipIndex() below to address filopodia branches std::map<int,timeVector> tipOffsets; std::map<int,timeVector> tipOffsets; // // //this one, similar to the above, holds the entire time-lapse of tip coordinates class timeVectorC: public std::vector<Vector3F> { public: void Init(const size_t length=200) { this->insert(this->end(),length,Vector3F(-1.f)); } }; std::map<int,timeVectorC> tipCoords; // //use exclusively this one to address filopodia branches in tipOffsets above //use exclusively this one to address filopodia branches in tipOffsets above int tipIndex(const int filoID,const int branchID) int tipIndex(const int filoID,const int branchID) { return (filoID*100 +branchID); } { return (filoID*100 +branchID); } Loading Loading @@ -133,18 +142,29 @@ int main(int argc,char **argv) //report the tip trajectories //report the tip trajectories char fileName[1024]; char fileName[1024]; sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories.txt",argv[2],ID); sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_pxOffsets.txt",argv[2],ID); std::ofstream tFile(fileName); std::ofstream oFile(fileName); sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_umCoords.txt",argv[2],ID); std::ofstream cFile(fileName); std::map<int,timeVector>::const_iterator tipIter=tipOffsets.begin(); std::map<int,timeVector>::const_iterator tipIter=tipOffsets.begin(); while (tipIter != tipOffsets.end()) while (tipIter != tipOffsets.end()) { { tFile << tipIter->first << ":"; oFile << tipIter->first << ":"; cFile << tipIter->first << ":"; for (int t=0; t < i; ++t) for (int t=0; t < i; ++t) tFile << tipIter->second.at((unsigned)t) << ","; { tFile << "\n"; oFile << tipIter->second.at((unsigned)t) << ","; cFile << tipCoords[tipIter->first].at((unsigned)t).x << "," << tipCoords[tipIter->first].at((unsigned)t).y << "," << tipCoords[tipIter->first].at((unsigned)t).z << ";"; } oFile << "\n"; cFile << "\n"; ++tipIter; ++tipIter; } } tFile.close(); oFile.close(); cFile.close(); return(0); return(0); } } Loading Loading @@ -244,6 +264,7 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo,const bool keepT { { //we have found a new pair filoID+branchID //we have found a new pair filoID+branchID tipOffsets[idx].Init(); tipOffsets[idx].Init(); tipCoords[idx].Init(); } } tipOffsets[idx].at((unsigned)fileNo)=(signed)iterTips->second; tipOffsets[idx].at((unsigned)fileNo)=(signed)iterTips->second; Loading Loading @@ -465,6 +486,10 @@ int RenderMesh(const char* path,const int ID,int fileNo) const size_t y=size_t((realPos.y-yOff) *yRes); const size_t y=size_t((realPos.y-yOff) *yRes); const size_t z=size_t((realPos.z-zOff) *zRes); const size_t z=size_t((realPos.z-zOff) *zRes); tipIter->second.at((unsigned)fileNo)=(int)mask.GetIndex(x,y,z); tipIter->second.at((unsigned)fileNo)=(int)mask.GetIndex(x,y,z); //save also the micron coordinate at the corresponding place //into the coordinate structure tipCoords[tipIter->first].at((unsigned)fileNo)=realPos; } } ++tipIter; ++tipIter; } } Loading Loading
src/main_Generator.cpp +31 −6 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,15 @@ class timeVector: public std::vector<int> //use tipIndex() below to address filopodia branches //use tipIndex() below to address filopodia branches std::map<int,timeVector> tipOffsets; std::map<int,timeVector> tipOffsets; // // //this one, similar to the above, holds the entire time-lapse of tip coordinates class timeVectorC: public std::vector<Vector3F> { public: void Init(const size_t length=200) { this->insert(this->end(),length,Vector3F(-1.f)); } }; std::map<int,timeVectorC> tipCoords; // //use exclusively this one to address filopodia branches in tipOffsets above //use exclusively this one to address filopodia branches in tipOffsets above int tipIndex(const int filoID,const int branchID) int tipIndex(const int filoID,const int branchID) { return (filoID*100 +branchID); } { return (filoID*100 +branchID); } Loading Loading @@ -133,18 +142,29 @@ int main(int argc,char **argv) //report the tip trajectories //report the tip trajectories char fileName[1024]; char fileName[1024]; sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories.txt",argv[2],ID); sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_pxOffsets.txt",argv[2],ID); std::ofstream tFile(fileName); std::ofstream oFile(fileName); sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_umCoords.txt",argv[2],ID); std::ofstream cFile(fileName); std::map<int,timeVector>::const_iterator tipIter=tipOffsets.begin(); std::map<int,timeVector>::const_iterator tipIter=tipOffsets.begin(); while (tipIter != tipOffsets.end()) while (tipIter != tipOffsets.end()) { { tFile << tipIter->first << ":"; oFile << tipIter->first << ":"; cFile << tipIter->first << ":"; for (int t=0; t < i; ++t) for (int t=0; t < i; ++t) tFile << tipIter->second.at((unsigned)t) << ","; { tFile << "\n"; oFile << tipIter->second.at((unsigned)t) << ","; cFile << tipCoords[tipIter->first].at((unsigned)t).x << "," << tipCoords[tipIter->first].at((unsigned)t).y << "," << tipCoords[tipIter->first].at((unsigned)t).z << ";"; } oFile << "\n"; cFile << "\n"; ++tipIter; ++tipIter; } } tFile.close(); oFile.close(); cFile.close(); return(0); return(0); } } Loading Loading @@ -244,6 +264,7 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo,const bool keepT { { //we have found a new pair filoID+branchID //we have found a new pair filoID+branchID tipOffsets[idx].Init(); tipOffsets[idx].Init(); tipCoords[idx].Init(); } } tipOffsets[idx].at((unsigned)fileNo)=(signed)iterTips->second; tipOffsets[idx].at((unsigned)fileNo)=(signed)iterTips->second; Loading Loading @@ -465,6 +486,10 @@ int RenderMesh(const char* path,const int ID,int fileNo) const size_t y=size_t((realPos.y-yOff) *yRes); const size_t y=size_t((realPos.y-yOff) *yRes); const size_t z=size_t((realPos.z-zOff) *zRes); const size_t z=size_t((realPos.z-zOff) *zRes); tipIter->second.at((unsigned)fileNo)=(int)mask.GetIndex(x,y,z); tipIter->second.at((unsigned)fileNo)=(int)mask.GetIndex(x,y,z); //save also the micron coordinate at the corresponding place //into the coordinate structure tipCoords[tipIter->first].at((unsigned)fileNo)=realPos; } } ++tipIter; ++tipIter; } } Loading