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
@@ -119,7 +119,7 @@ public: | @@ -119,7 +119,7 @@ public: | ||
119 | page++; | 119 | page++; |
120 | //if wavelength is larger than the last wavelength in header file | 120 | //if wavelength is larger than the last wavelength in header file |
121 | if (page == Z()) { | 121 | if (page == Z()) { |
122 | - band_index(p, Z()-1); | 122 | + band_index(p, Z()-1, PROGRESS); |
123 | return true; | 123 | return true; |
124 | } | 124 | } |
125 | } | 125 | } |
stim/envi/bsq.h
@@ -104,6 +104,7 @@ public: | @@ -104,6 +104,7 @@ public: | ||
104 | //if wavelength is smaller than the first one in header file | 104 | //if wavelength is smaller than the first one in header file |
105 | if ( w[page] > wavelength ){ | 105 | if ( w[page] > wavelength ){ |
106 | band_index(p, page); | 106 | band_index(p, page); |
107 | + if(PROGRESS) progress = 100; | ||
107 | return true; | 108 | return true; |
108 | } | 109 | } |
109 | 110 | ||
@@ -114,6 +115,7 @@ public: | @@ -114,6 +115,7 @@ public: | ||
114 | // (the wavelength is out of bounds) | 115 | // (the wavelength is out of bounds) |
115 | if (page == Z()) { | 116 | if (page == Z()) { |
116 | band_index(p, Z()-1); //return the last band | 117 | band_index(p, Z()-1); //return the last band |
118 | + if(PROGRESS) progress = 100; | ||
117 | return true; | 119 | return true; |
118 | } | 120 | } |
119 | } | 121 | } |
stim/envi/envi.h
@@ -1901,7 +1901,7 @@ public: | @@ -1901,7 +1901,7 @@ public: | ||
1901 | 1901 | ||
1902 | 1902 | ||
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){ | 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 | double B = (double)header.bands; | 1905 | double B = (double)header.bands; |
1906 | double delta = header.wavelength[1] - header.wavelength[0]; //calculate spacing in the current domain | 1906 | double delta = header.wavelength[1] - header.wavelength[0]; //calculate spacing in the current domain |
1907 | double span = samples * delta; //calculate the span in the current domain | 1907 | double span = samples * delta; //calculate the span in the current domain |
@@ -1916,6 +1916,7 @@ public: | @@ -1916,6 +1916,7 @@ public: | ||
1916 | envi_header new_header = header; | 1916 | envi_header new_header = header; |
1917 | new_header.bands = size_i; | 1917 | new_header.bands = size_i; |
1918 | new_header.set_wavelengths(start_i * fft_delta, fft_delta); | 1918 | new_header.set_wavelengths(start_i * fft_delta, fft_delta); |
1919 | + new_header.wavelength_units = "inv_" + header.wavelength_units; | ||
1919 | new_header.save(outfile + ".hdr"); | 1920 | new_header.save(outfile + ".hdr"); |
1920 | 1921 | ||
1921 | if (header.interleave == envi_header::BIP){ | 1922 | if (header.interleave == envi_header::BIP){ |