Compare View

switch
from
...
to
 
Commits (2)
stim/grids/image_stack.h
... ... @@ -38,6 +38,20 @@ public:
38 38 return R[1] * R[2] * R[3]; //return the number of spatial samples
39 39 }
40 40  
  41 + // get the number of pixels in each dimension
  42 + size_t nc() {
  43 + return R[0];
  44 + }
  45 + size_t nx() {
  46 + return R[1];
  47 + }
  48 + size_t ny() {
  49 + return R[2];
  50 + }
  51 + size_t nz() {
  52 + return R[3];
  53 + }
  54 +
41 55 /// Returns the number of color channels
42 56 size_t channels(){
43 57 return R[0];
... ... @@ -187,6 +201,10 @@ public:
187 201 for (unsigned i = 0; i < R[0] * R[1] * R[2]; i++)
188 202 ptr[i + k * R[0] * R[1] * R[2]] = Ptr[i];
189 203 }
  204 + void copy(T* Ptr) {
  205 + ptr = Ptr;
  206 + }
  207 +
190 208  
191 209 void read(std::string file, unsigned int X, unsigned int Y, unsigned int Z, unsigned int C = 1, unsigned int header = 0){
192 210 read(file, stim::vec<unsigned long>(C, X, Y, Z), header);
... ...
stim/math/matrix.h
... ... @@ -408,7 +408,7 @@ public:
408 408  
409 409 //save the data as a CSV file
410 410 void csv(std::string filename) const {
411   - ofstream basisfile(filename.c_str());
  411 + std::ofstream basisfile(filename.c_str());
412 412 basisfile << csv();
413 413 basisfile.close();
414 414 }
... ... @@ -436,7 +436,7 @@ public:
436 436 }
437 437  
438 438 void raw(std::string filename) {
439   - ofstream out(filename, std::ios::binary);
  439 + std::ofstream out(filename, std::ios::binary);
440 440 if (out) {
441 441 out.write((char*)data(), rows() * cols() * sizeof(T));
442 442 out.close();
... ...
stim/visualization/camera.h
... ... @@ -72,7 +72,6 @@ public:
72 72 delta = focus;
73 73  
74 74 focus -= delta;
75   - std::cout << focus << std::endl;
76 75  
77 76 Dolly(d*delta);
78 77 }
... ...
stim/visualization/colormap.h
... ... @@ -33,6 +33,30 @@ static float BREWERCP[BREWER_CTRL_PTS*4] = {0.192157f, 0.211765f, 0.584314f, 1.
33 33 0.843137f, 0.188235f, 0.152941f, 1.0f,
34 34 0.647059f, 0.0f, 0.14902f, 1.0f};
35 35  
  36 +//static float BREWERCP[BREWER_CTRL_PTS * 4] = { 0.192157f, 0.584314f, 0.211765f, 1.0f,
  37 +// 0.270588f, 0.705882f, 0.458824f, 1.0f,
  38 +// 0.454902f, 0.819608f, 0.678431f, 1.0f,
  39 +// 0.670588f, 0.913725f, 0.85098f, 1.0f,
  40 +// 0.878431f, 0.972549f, 0.952941f, 1.0f,
  41 +// 1.0f, 0.74902f, 1.0f, 1.0f,
  42 +// 0.996078f, 0.878431f, 0.564706f, 1.0f,
  43 +// 0.992157f, 0.682353f, 0.380392f, 1.0f,
  44 +// 0.956863f, 0.427451f, 0.262745f, 1.0f,
  45 +// 0.843137f, 0.188235f, 0.152941f, 1.0f,
  46 +// 0.647059f, 0.0f, 0.14902f, 1.0f };
  47 +
  48 +//static float BREWERCP[BREWER_CTRL_PTS * 4] = { 0.0f, 0.407843f, 0.215686f, 1.0f,
  49 +// 0.101960f, 0.596078f, 0.313725f, 1.0f,
  50 +// 0.4f, 0.741176f, 0.388235f, 1.0f,
  51 +// 0.650980f, 0.850980f, 0.415686f, 1.0f,
  52 +// 0.850980f, 0.937254f, 0.545098f, 1.0f,
  53 +// 1.0f, 1.0f, 0.749019f, 1.0f,
  54 +// 0.996078f, 0.878431f, 0.545098f, 1.0f,
  55 +// 0.992156f, 0.682352f, 0.380392f, 1.0f,
  56 +// 0.956862f, 0.427450f, 0.262745f, 1.0f,
  57 +// 0.843137f, 0.188235f, 0.152941f, 1.0f,
  58 +// 0.647058f, 0.0f, 0.149019f, 1.0f };
  59 +
36 60  
37 61 #ifdef __CUDACC__
38 62 texture<float4, cudaTextureType1D> cudaTexBrewer;
... ...
stim/visualization/gl_network.h
... ... @@ -167,9 +167,9 @@ public:
167 167 stim::circle<T> C1 = E[e].circ(p - 1);
168 168 stim::circle<T> C2 = E[e].circ(p);
169 169 r1 = E[e].r(p - 1);
170   - r2 = E[e].r(p);
171   - C1.set_R(2 * r1); // re-scale the circle to the same
172   - C2.set_R(2 * r2);
  170 + r2 = E[e].r(p);
  171 + C1.set_R(r1); // re-scale the circle to the same
  172 + C2.set_R(r2);
173 173 std::vector< stim::vec3<T> > Cp1 = C1.glpoints(20);// get 20 points on the circle plane
174 174 std::vector< stim::vec3<T> > Cp2 = C2.glpoints(20);
175 175 glBegin(GL_QUAD_STRIP);
... ... @@ -191,7 +191,7 @@ public:
191 191 break;
192 192 }
193 193 }
194   - renderBall(V[n][0], V[n][1], V[n][2], 2 * r1, 20);
  194 + renderBall(V[n][0], V[n][1], V[n][2], r1, 20);
195 195 }
196 196 glEndList(); // end the display list
197 197 }
... ...
stim/visualization/obj.h
... ... @@ -694,6 +694,10 @@ public:
694 694 return V.size();
695 695 }
696 696  
  697 + unsigned int numVT() {
  698 + return VT.size();
  699 + }
  700 +
697 701 /// Retrieve the vertex stored in index i
698 702 /// @param vi is the desired vertex index
699 703 stim::vec<T> getV(unsigned int vi){
... ...