chanMin = new double[seriesCount][]; for (int i=0; i<seriesCount; i++) { setCoreIndex(i); chanMin[i] = new double[getSizeC()]; Arrays.fill(chanMin[i], Double.POSITIVE_INFINITY); setCoreIndex(oldSeries); setCoreIndex(i); chanMax[i] = new double[getSizeC()]; Arrays.fill(chanMax[i], Double.NEGATIVE_INFINITY); setCoreIndex(oldSeries); setCoreIndex(i); int numRGB = getRGBChannelCount(); planeMin[i] = new double[getImageCount() * numRGB]; Arrays.fill(planeMin[i], Double.NaN); setCoreIndex(oldSeries); setCoreIndex(i); int numRGB = getRGBChannelCount(); planeMax[i] = new double[getImageCount() * numRGB]; Arrays.fill(planeMax[i], Double.NaN); setCoreIndex(oldSeries);
chanMin = new double[seriesCount][]; for (int i=0; i<seriesCount; i++) { setCoreIndex(i); chanMin[i] = new double[getSizeC()]; Arrays.fill(chanMin[i], Double.POSITIVE_INFINITY); setCoreIndex(oldSeries); setCoreIndex(i); chanMax[i] = new double[getSizeC()]; Arrays.fill(chanMax[i], Double.NEGATIVE_INFINITY); setCoreIndex(oldSeries); setCoreIndex(i); int numRGB = getRGBChannelCount(); planeMin[i] = new double[getImageCount() * numRGB]; Arrays.fill(planeMin[i], Double.NaN); setCoreIndex(oldSeries); setCoreIndex(i); int numRGB = getRGBChannelCount(); planeMax[i] = new double[getImageCount() * numRGB]; Arrays.fill(planeMax[i], Double.NaN); setCoreIndex(oldSeries);
/** * Checks that the min and max values for each core index do not change * when the resolutions are unflattened. */ @Test public void testMultipleResolutions() throws Exception { minMaxCalculator.setCoreIndex(0); minMaxCalculator.openBytes(0); assertMinMax(-2.0, 101.0); minMaxCalculator.setCoreIndex(1); minMaxCalculator.openBytes(0); assertMinMax(-1.0, 102.0); MinMaxCalculator unflattened = new MinMaxCalculator(new MinMaxCalculatorTestReader()); try { unflattened.setFlattenedResolutions(false); unflattened.setId(TEST_FILE); unflattened.setCoreIndex(0); unflattened.openBytes(0); assertEquals(-2.0, unflattened.getPlaneMinimum(0)[0]); assertEquals(103.0, unflattened.getPlaneMaximum(0)[0]); unflattened.setCoreIndex(1); unflattened.openBytes(0); assertEquals(-1.0, unflattened.getPlaneMinimum(0)[0]); assertEquals(104.0, unflattened.getPlaneMaximum(0)[0]); } finally { unflattened.close(); } }