diff --git a/stim/grids/image_stack.h b/stim/grids/image_stack.h index c256d66..5a6fccd 100644 --- a/stim/grids/image_stack.h +++ b/stim/grids/image_stack.h @@ -38,6 +38,20 @@ public: return R[1] * R[2] * R[3]; //return the number of spatial samples } + // get the number of pixels in each dimension + size_t nc() { + return R[0]; + } + size_t nx() { + return R[1]; + } + size_t ny() { + return R[2]; + } + size_t nz() { + return R[3]; + } + /// Returns the number of color channels size_t channels(){ return R[0]; @@ -187,6 +201,10 @@ public: for (unsigned i = 0; i < R[0] * R[1] * R[2]; i++) ptr[i + k * R[0] * R[1] * R[2]] = Ptr[i]; } + void copy(T* Ptr) { + ptr = Ptr; + } + void read(std::string file, unsigned int X, unsigned int Y, unsigned int Z, unsigned int C = 1, unsigned int header = 0){ read(file, stim::vec(C, X, Y, Z), header); diff --git a/stim/visualization/colormap.h b/stim/visualization/colormap.h index 6b3b4b4..15cc151 100644 --- a/stim/visualization/colormap.h +++ b/stim/visualization/colormap.h @@ -33,6 +33,30 @@ static float BREWERCP[BREWER_CTRL_PTS*4] = {0.192157f, 0.211765f, 0.584314f, 1. 0.843137f, 0.188235f, 0.152941f, 1.0f, 0.647059f, 0.0f, 0.14902f, 1.0f}; +//static float BREWERCP[BREWER_CTRL_PTS * 4] = { 0.192157f, 0.584314f, 0.211765f, 1.0f, +// 0.270588f, 0.705882f, 0.458824f, 1.0f, +// 0.454902f, 0.819608f, 0.678431f, 1.0f, +// 0.670588f, 0.913725f, 0.85098f, 1.0f, +// 0.878431f, 0.972549f, 0.952941f, 1.0f, +// 1.0f, 0.74902f, 1.0f, 1.0f, +// 0.996078f, 0.878431f, 0.564706f, 1.0f, +// 0.992157f, 0.682353f, 0.380392f, 1.0f, +// 0.956863f, 0.427451f, 0.262745f, 1.0f, +// 0.843137f, 0.188235f, 0.152941f, 1.0f, +// 0.647059f, 0.0f, 0.14902f, 1.0f }; + +//static float BREWERCP[BREWER_CTRL_PTS * 4] = { 0.0f, 0.407843f, 0.215686f, 1.0f, +// 0.101960f, 0.596078f, 0.313725f, 1.0f, +// 0.4f, 0.741176f, 0.388235f, 1.0f, +// 0.650980f, 0.850980f, 0.415686f, 1.0f, +// 0.850980f, 0.937254f, 0.545098f, 1.0f, +// 1.0f, 1.0f, 0.749019f, 1.0f, +// 0.996078f, 0.878431f, 0.545098f, 1.0f, +// 0.992156f, 0.682352f, 0.380392f, 1.0f, +// 0.956862f, 0.427450f, 0.262745f, 1.0f, +// 0.843137f, 0.188235f, 0.152941f, 1.0f, +// 0.647058f, 0.0f, 0.149019f, 1.0f }; + #ifdef __CUDACC__ texture cudaTexBrewer; diff --git a/stim/visualization/gl_network.h b/stim/visualization/gl_network.h index dbbeceb..8761c58 100644 --- a/stim/visualization/gl_network.h +++ b/stim/visualization/gl_network.h @@ -167,9 +167,9 @@ public: stim::circle C1 = E[e].circ(p - 1); stim::circle C2 = E[e].circ(p); r1 = E[e].r(p - 1); - r2 = E[e].r(p); - C1.set_R(2 * r1); // re-scale the circle to the same - C2.set_R(2 * r2); + r2 = E[e].r(p); + C1.set_R(r1); // re-scale the circle to the same + C2.set_R(r2); std::vector< stim::vec3 > Cp1 = C1.glpoints(20);// get 20 points on the circle plane std::vector< stim::vec3 > Cp2 = C2.glpoints(20); glBegin(GL_QUAD_STRIP); @@ -191,7 +191,7 @@ public: break; } } - renderBall(V[n][0], V[n][1], V[n][2], 2 * r1, 20); + renderBall(V[n][0], V[n][1], V[n][2], r1, 20); } glEndList(); // end the display list } diff --git a/stim/visualization/obj.h b/stim/visualization/obj.h index 74aaf3d..044836d 100644 --- a/stim/visualization/obj.h +++ b/stim/visualization/obj.h @@ -694,6 +694,10 @@ public: return V.size(); } + unsigned int numVT() { + return VT.size(); + } + /// Retrieve the vertex stored in index i /// @param vi is the desired vertex index stim::vec getV(unsigned int vi){ -- libgit2 0.21.4