From c9fd97f041e77b49500e6ef9fa666afca86eb470 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Fri, 31 Oct 2014 11:36:51 -0500 Subject: [PATCH] edits for classification --- envi/envi.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/envi/envi.h b/envi/envi.h index adc4c61..2a33806 100644 --- a/envi/envi.h +++ b/envi/envi.h @@ -603,11 +603,29 @@ public: { //save pixels in X as floating numbers: float * p float * p = (float*)malloc(header.bands * sizeof(float)); //save pixel information - unsigned bandnum = header.samples * header.lines; //calculate pixel numbers in a band + unsigned pixels = header.samples * header.lines; //calculate pixel numbers in a band unsigned count = 0; //for counting use unsigned j = 0; //memory the pointer location in X - for(unsigned i = start; i < bandnum; i++){ + //create two indices into the mask (mask index and pixel index) + unsigned mi = 0; //valid pixel index + unsigned pi = 0; //actual pixel in the mask + + //find the actual pixel index for the mask index "start" + while(mi < start){ + if(mask[pi]) + mi++; + + pi++; + } + //at this point, pi is an index to the mi'th valid pixel + + //load the next N valid pixels + //for(unsigned i = 0; i < N; i++){ + + //} + + for(unsigned i = pi; i < pixels; i++){ if(mask[i] != 0){ pixel(p, i); //copy p to X -- libgit2 0.21.4