-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.h
More file actions
executable file
·74 lines (64 loc) · 3.32 KB
/
utils.h
File metadata and controls
executable file
·74 lines (64 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef UTILS_H
#define UTILS_H
#include <QCoreApplication>
#include <QDir>
#include <set>
#include "neuron_editing/neuron_format_converter.h"
#include "include/hiredis/hiredis.h"
#include "fstream"
#include "sstream"
const int neuron_type_color[21][3] = {
{255, 255, 255}, // white, 0-undefined
{20, 20, 20 }, // black, 1-soma
{200, 20, 0 }, // red, 2-axon
{0, 20, 200}, // blue, 3-dendrite
{200, 0, 200}, // purple, 4-apical dendrite
//the following is Hanchuan's extended color. 090331
{0, 200, 200}, // cyan, 5
{220, 200, 0 }, // yellow, 6
{0, 200, 20 }, // green, 7
{188, 94, 37 }, // coffee, 8
{180, 200, 120}, // asparagus, 9
{250, 100, 120}, // salmon, 10
{120, 200, 200}, // ice, 11
{100, 120, 200}, // orchid, 12
//the following is Hanchuan's further extended color. 111003
{255, 128, 168}, // 13
{128, 255, 168}, // 14
{128, 168, 255}, // 15
{168, 255, 128}, // 16
{255, 168, 128}, // 17
{168, 128, 255}, // 18
{0, 0, 0}, //19 //totally black. PHC, 2012-02-15
//the following (20-275) is used for matlab heat map. 120209 by WYN
{0,0,131}, //20
};
void dirCheck(QString dirBaseName);
QStringList getSwcInBlock(const QString msg,const V_NeuronSWC_list& testVNL);
QStringList getApoInBlock(const QString msg,const QList <CellAPO>& wholePoint);
vector<V_NeuronSWC>::iterator findseg(vector<V_NeuronSWC>::iterator begin,vector<V_NeuronSWC>::iterator end,const V_NeuronSWC seg);
NeuronTree convertMsg2NT(QStringList pointlist,int client,int user, int isMany, int mode=0);
double distance(const CellAPO &m1,const CellAPO &m2);
double distance(const double x1, const double x2, const double y1, const double y2, const double z1, const double z2);
double getSegLength(V_NeuronSWC &seg);
double getPartOfSegLength(V_NeuronSWC &seg, int index);
double getPartOfSegLength(V_NeuronSWC &seg, int index1, int index2);
int findnearest(const CellAPO &m,const QList<CellAPO> &markers);
void init();
void stringToXYZ(string xyz, float& x, float& y, float& z);
void getSegmentsForOthersDetect(V_NeuronSWC_list& last1MinSegments, V_NeuronSWC_list& segmentsForOthersDetect, V_NeuronSWC_list segments);
void getSegmentsForMissingDetect(V_NeuronSWC_list& last3MinSegments, V_NeuronSWC_list& segmentsForMissingDetect, V_NeuronSWC_list segments);
void reverseSeg(V_NeuronSWC& seg);
int getPointInSegIndex(string point, V_NeuronSWC& seg);
map<string, set<size_t>> getWholeGrid2SegIDMap(V_NeuronSWC_list inputSegments);
int isOverlapOfTwoSegs(QTextStream& logOut, V_NeuronSWC& seg1, V_NeuronSWC& seg2);
QStringList V_NeuronSWCToSendMSG(V_NeuronSWC seg);
RGB8 getColorFromType(int type);
set<int> getQCMarkerNearBy(vector<V_NeuronSWC> &segs, const QList<CellAPO> &markers);
void mergeresultFiles(const string& folderPath);
void mergeResultCSVFiles(const string& folderPath, const string& outputPath);
void mergeResultCSVFilesAll(const QStringList& allPaths, const string& outputPath);
void mergeErrorResultCSVFilesAll(const QStringList& allPaths, const string& outputPath);
std::vector<std::string> splitCSVLine(const std::string& line);
QStringList getAllTargetPaths(QString rootPath, QStringList filters);
#endif // UTILS_H