2141 if (!autoScaleColor->isChecked())
2143 GLWindow->ss[0] = 0.496;
2144 GLWindow->ss[1] = 0.507;
2145 GLWindow->ss[2] = 0.518;
2146 GLWindow->ss[3] = 0.529;
2147 GLWindow->ss[4] = 0.540;;
2148 colorRange0->setValue(GLWindow->ss[0]);
2149 colorRange1->setValue(GLWindow->ss[1]);
2150 colorRange2->setValue(GLWindow->ss[2]);
2151 colorRange3->setValue(GLWindow->ss[3]);
2152 colorRange4->setValue(GLWindow->ss[4]);
2155 if (!GLWindow->nRoi)
2161 if (!entireCameraScale->isChecked())
2163 start = GLWindow->selectedPixel;
2164 end = GLWindow->selectedPixel+1;
2176 long numSamples = 0;
2177 int errorDetected = -1;
2179 for (
int i=start;
i<
end;
i++)
2183 for (
int j=10;j<GLWindow->nRoi-50;j++)
2185 int cValue = GLWindow->eventData[
i*GLWindow->nRoi+j];
2186 if (cValue > max && cValue < 32767)
2188 if (cValue < min && cValue > -32768)
2190 if (cValue < 32767 && cValue > -32768)
2202 average /= numSamples;
2203 if (errorDetected != -1)
2205 cout <<
"Overflow detected at pixel " << errorDetected <<
" (at least)" << endl;
2208 float minRange = (float)(min+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2209 float maxRange = (float)(max+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2210 float midRange = (float)(average+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2211 if (GLWindow->logScale)
2219 minRange = log10(minRange);
2220 maxRange = log10(maxRange);
2222 midRange = log10(midRange);
2225 GLWindow->ss[0] = minRange;
2226 colorRange0->setValue(GLWindow->ss[0]);
2227 GLWindow->ss[4] = maxRange;
2228 colorRange4->setValue(GLWindow->ss[4]);
2236 GLWindow->ss[2] = (maxRange+minRange)/2;
2237 colorRange2->setValue(GLWindow->ss[2]);
2239 GLWindow->ss[1] = minRange+(maxRange-minRange)/4;
2240 colorRange1->setValue(GLWindow->ss[1]);
2242 GLWindow->ss[3] = minRange+3*(maxRange-minRange)/4;
2243 colorRange3->setValue(GLWindow->ss[3]);