diff --git a/grids/image_stack.h b/grids/image_stack.h index 498719d..a03a9f2 100644 --- a/grids/image_stack.h +++ b/grids/image_stack.h @@ -58,6 +58,17 @@ public: } } + void save_image(std::string file_name, unsigned int i){ + + //create an image + stim::image I; + + //retrieve the interlaced data from the image - store it in the grid + I.set_interleaved(&ptr[ i * R[0] * R[1] * R[2] ], R[1], R[2], R[0]); + + I.save(file_name); + } + void save_images(std::string file_mask){ stim::filename file_path(file_mask); @@ -71,22 +82,11 @@ public: //create a list of file names std::vector file_list = stim::wildcards::increment(file_path.str(), 0, R[3]-1, 1); - for(int i=0; i I; - - //retrieve the interlaced data from the image - store it in the grid - I.set_interleaved(&ptr[ i * R[0] * R[1] * R[2] ], R[1], R[2], R[0]); - - I.save(file_list[i]); - - - std::cout<