Commit 6e9cf1ac9dbeb469d5aa5f4bc05bf44128ce0a78
1 parent
90eae717
fixed image bug in stim::envi
Showing
3 changed files
with
5 additions
and
2 deletions
Show diff stats
stim/envi/bil.h
stim/envi/bsq.h
... | ... | @@ -104,6 +104,7 @@ public: |
104 | 104 | //if wavelength is smaller than the first one in header file |
105 | 105 | if ( w[page] > wavelength ){ |
106 | 106 | band_index(p, page); |
107 | + if(PROGRESS) progress = 100; | |
107 | 108 | return true; |
108 | 109 | } |
109 | 110 | |
... | ... | @@ -114,6 +115,7 @@ public: |
114 | 115 | // (the wavelength is out of bounds) |
115 | 116 | if (page == Z()) { |
116 | 117 | band_index(p, Z()-1); //return the last band |
118 | + if(PROGRESS) progress = 100; | |
117 | 119 | return true; |
118 | 120 | } |
119 | 121 | } | ... | ... |
stim/envi/envi.h
... | ... | @@ -1901,7 +1901,7 @@ public: |
1901 | 1901 | |
1902 | 1902 | |
1903 | 1903 | 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){ |
1904 | - | |
1904 | + if(samples == 0) samples = header.bands; | |
1905 | 1905 | double B = (double)header.bands; |
1906 | 1906 | double delta = header.wavelength[1] - header.wavelength[0]; //calculate spacing in the current domain |
1907 | 1907 | double span = samples * delta; //calculate the span in the current domain |
... | ... | @@ -1916,6 +1916,7 @@ public: |
1916 | 1916 | envi_header new_header = header; |
1917 | 1917 | new_header.bands = size_i; |
1918 | 1918 | new_header.set_wavelengths(start_i * fft_delta, fft_delta); |
1919 | + new_header.wavelength_units = "inv_" + header.wavelength_units; | |
1919 | 1920 | new_header.save(outfile + ".hdr"); |
1920 | 1921 | |
1921 | 1922 | if (header.interleave == envi_header::BIP){ | ... | ... |