From 6e9cf1ac9dbeb469d5aa5f4bc05bf44128ce0a78 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 1 Dec 2016 13:03:00 -0600 Subject: [PATCH] fixed image bug in stim::envi --- stim/envi/bil.h | 2 +- stim/envi/bsq.h | 2 ++ stim/envi/envi.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stim/envi/bil.h b/stim/envi/bil.h index 80d26d4..6d58148 100644 --- a/stim/envi/bil.h +++ b/stim/envi/bil.h @@ -119,7 +119,7 @@ public: page++; //if wavelength is larger than the last wavelength in header file if (page == Z()) { - band_index(p, Z()-1); + band_index(p, Z()-1, PROGRESS); return true; } } diff --git a/stim/envi/bsq.h b/stim/envi/bsq.h index 7bc8e81..db00e0d 100644 --- a/stim/envi/bsq.h +++ b/stim/envi/bsq.h @@ -104,6 +104,7 @@ public: //if wavelength is smaller than the first one in header file if ( w[page] > wavelength ){ band_index(p, page); + if(PROGRESS) progress = 100; return true; } @@ -114,6 +115,7 @@ public: // (the wavelength is out of bounds) if (page == Z()) { band_index(p, Z()-1); //return the last band + if(PROGRESS) progress = 100; return true; } } diff --git a/stim/envi/envi.h b/stim/envi/envi.h index 2fc2fe7..955c0d0 100644 --- a/stim/envi/envi.h +++ b/stim/envi/envi.h @@ -1901,7 +1901,7 @@ public: void fft(std::string outfile, double band_min, double band_max, size_t samples = 0, void* ratio = NULL, size_t rx = 0, size_t ry = 0, bool PROGRESS = false, int cuda_device = 0){ - + if(samples == 0) samples = header.bands; double B = (double)header.bands; double delta = header.wavelength[1] - header.wavelength[0]; //calculate spacing in the current domain double span = samples * delta; //calculate the span in the current domain @@ -1916,6 +1916,7 @@ public: envi_header new_header = header; new_header.bands = size_i; new_header.set_wavelengths(start_i * fft_delta, fft_delta); + new_header.wavelength_units = "inv_" + header.wavelength_units; new_header.save(outfile + ".hdr"); if (header.interleave == envi_header::BIP){ -- libgit2 0.21.4