From 6156690fca9488d4878172d506cb6ebc5627037e Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Tue, 9 Dec 2014 16:52:20 -0600 Subject: [PATCH] added ability to save a single image --- grids/image_stack.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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<