cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd()));
cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++;
    public void computeLocationStats(PlaneDef pd)    {        if (pd == null)        	throw new NullPointerException("No plane definition.");        ChannelBinding[] cb = getChannelBindings();        StatsFactory sf = new StatsFactory();        int w = 0;        for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); )        {        	// FIXME: This is where we need to have the ChannelBinding -->        	// Channel linkage. Without it, we have to assume that the order in        	// which the channel bindings was created matches up with the order        	// of the channels linked to the pixels set.        	Channel channel = (Channel) i.next();        	double gMin = channel.getStatsInfo().getGlobalMin().doubleValue();        	double gMax = channel.getStatsInfo().getGlobalMax().doubleValue();            //Test        	sf.computeLocationStats(metadata, buffer, pd, w);        	//cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction()));            cb[w].setNoiseReduction(Boolean.TRUE);        	float start = cb[w].getInputStart().floatValue();        	float end = cb[w].getInputEnd().floatValue();        	//TODO: find a better way.        	if (gMax == end && gMin == start)        		cb[w].setInputStart(new Float(sf.getInputStart()));        	cb[w].setInputEnd(new Float(sf.getInputEnd()));        }    }