From b66bbf3f7efcddbfc6a2cbad4ac5cad5ac615240 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Mon, 27 Feb 2017 16:41:35 -0600 Subject: [PATCH] added some details to image_stack for Shihao - may not be used --- stim/grids/image_stack.h | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/stim/grids/image_stack.h b/stim/grids/image_stack.h index d8b7a8a..e43d1c6 100644 --- a/stim/grids/image_stack.h +++ b/stim/grids/image_stack.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace stim{ @@ -166,6 +167,15 @@ public: return ptr[z * R[0] * R[1] * R[2] + y * R[0] * R[1] + x * R[0] + c]; } + /// Returns the world-space position at an index point (i, j, k) + vec3 p(size_t i, size_t j, size_t k){ + vec3 result; + result[0] = (F)i * S[0]; + result[1] = (F)j * S[1]; + result[2] = (F)j * S[2]; + return result; + } + 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); } -- libgit2 0.21.4