-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvtkCircuitReaderMesh.h
142 lines (117 loc) · 4.29 KB
/
vtkCircuitReaderMesh.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkCircuitReaderMesh.cxx,v $
Copyright (c) Sebastien Lasserre, Blue Brain Project
All rights reserved.
=========================================================================*/
#ifndef __vtkCircuitReaderMesh_h
#define __vtkCircuitReaderMesh_h
#include "vtkCircuitReaderBase.h"
#include "vtkSmartPointer.h"
#include "vtkUnsignedIntArray.h"
#define VTK_WRAPPING_CXX
#include "vtkClientServerStream.h"
#include <string>
#include <vector>
class vtkDataArraySelection;
class vtkMultiProcessController;
class vtkFloatArray;
class vtkMutableDirectedGraph;
class vtkMeshPartitionFilter;
class vtkUnstructuredGrid;
class vtkBoundsExtentTranslator;
//
// BBP-SDK
//
#include "BBP/Targets/Target.h"
#include "BBP/Targets/Targets.h"
#include "BBP/Datasets/compartmentReportFrame.h"
#include "BBP/Readers/compartmentReportReader.h"
#include "BBP/Experiment.h"
//
#undef vtkGetMacro
#undef vtkSetMacro
//
#define vtkGetMacro(name,type) \
virtual type Get##name () { \
return this->name; \
}
#define vtkSetMacro(name,type) \
virtual void Set##name (type _arg) \
{ \
if (this->name != _arg) \
{ \
this->name = _arg; \
this->Modified(); \
} \
}
//
class VTK_EXPORT vtkCircuitReaderMesh : public vtkCircuitReaderBase
{
public:
static vtkCircuitReaderMesh *New();
vtkTypeMacro(vtkCircuitReaderMesh, vtkCircuitReaderBase);
void SetMaximumNumberOfNeurons(int n) {
if (this->MaximumNumberOfNeurons != n) {
this->MaximumNumberOfNeurons = n;
this->MeshParamsModifiedTime.Modified();
this->Modified();
}
}
vtkGetMacro(MaximumNumberOfNeurons,int);
void SetExportMorphologySkeleton(int n) {
if (this->ExportMorphologySkeleton != n) {
this->ExportMorphologySkeleton = n;
this->MeshParamsModifiedTime.Modified();
this->Modified();
}
}
vtkGetMacro(ExportMorphologySkeleton,int);
vtkBooleanMacro(ExportMorphologySkeleton,int);
void SetExportNeuronMesh(int n) {
if (this->ExportNeuronMesh != n) {
this->ExportNeuronMesh = n;
this->MeshParamsModifiedTime.Modified();
this->Modified();
}
}
vtkGetMacro(ExportNeuronMesh,int);
vtkBooleanMacro(ExportNeuronMesh,int);
// Description:
// hyperpolarized (voltage near -85 mV)
vtkSetMacro(HyperPolarizedVoltage,double);
vtkGetMacro(HyperPolarizedVoltage,double);
// Description:
// depolarized (voltage near -50 mV)
vtkSetMacro(DePolarizedVoltage,double);
vtkGetMacro(DePolarizedVoltage,double);
// Description:
// resting potential (voltage near -65 mV)
vtkSetMacro(RestingPotentialVoltage,double);
vtkGetMacro(RestingPotentialVoltage,double);
protected:
vtkCircuitReaderMesh();
~vtkCircuitReaderMesh();
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
// top level functions which generate meshes/scalars for the whole data
void GenerateNeuronMesh(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
void GenerateMorphologySkeleton(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
void CreateReportScalars(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
// generate mesh/scalars on a per neuron basis
void AddOneNeuronToMesh(bbp::Neuron *neuron, const bbp::Mesh *mesh, vtkIdType Ncount, vtkPoints *points, vtkIdType *cells, vtkFieldData *field, vtkIdType &offsetN, vtkIdType &offsetC);
void AddOneNeuronToMorphologySkeleton(bbp::Neuron *neuron, vtkIdType Ncount, vtkPoints *points, vtkIdType *cells, vtkFieldData *field, vtkIdType &offsetN, vtkIdType &offsetC);
vtkIdType AddReportScalarsToMorphologySkeleton(bbp::Neuron *neuron, vtkFloatArray *voltages, vtkIdType offsetN);
vtkIdType AddReportScalarsToNeuronMesh(bbp::Neuron *neuron, vtkFloatArray *voltages, vtkIdType offsetN);
int ExportMorphologySkeleton;
int ExportNeuronMesh;
int MaximumNumberOfNeurons;
double HyperPolarizedVoltage;
double DePolarizedVoltage;
double RestingPotentialVoltage;
vtkSmartPointer<vtkPolyData> CachedNeuronMesh;
vtkSmartPointer<vtkPolyData> CachedMorphologySkeleton;
private:
vtkCircuitReaderMesh(const vtkCircuitReaderMesh&);
void operator=(const vtkCircuitReaderMesh&);
};
#endif