package yi.iu.processor.graphseg;

import java.awt.*;

import yi.iu.processor.*;
import yi.iu.processor.channel.*;

public class GS_I1 extends GraphSeg
{
    public GS_I1() {
        dm= new DM_I1();
        
        //test the reasonablity of distance function
        /*
        int[] h1= new int[dm.BINS+1];
        int[] h2= new int[dm.BINS+1];
        h1[1]=h1[2]=h2[0]=h2[1]=1;
        h1[BINS]=h2[BINS]=2;
        int dist=dm.distance(h1, h2);
        System.err.println("distance="+dist);
        
        for (int i=0;i<dm.BINS+1;i++) h1[i]=h2[i]=0;
        h1[1]=h1[2]=h2[0]=h2[1]=2;
        h1[BINS]=h2[BINS]=4;
        dist=dm.distance(h1, h2);
        System.err.println("distance="+dist);
        
        for (int i=0;i<dm.BINS+1;i++) h1[i]=h2[i]=0;
        h1[1]=h1[2]=h2[0]=h2[1]=2000;
        h1[BINS]=h2[BINS]=4000;
        dist=dm.distance(h1, h2);
        System.err.println("distance="+dist);
        
        for (int i=0;i<dm.BINS+1;i++) h1[i]=h2[i]=0;
        h1[1]=h1[2]=2; h2[0]=h2[1]=3;
        h1[BINS]=4; h2[BINS]=6;
        dist=dm.distance(h1, h2);
        System.err.println("distance="+dist);
        
        for (int i=0;i<dm.BINS+1;i++) h1[i]=h2[i]=0;
        h1[1]=h1[2]=2000; h2[0]=h2[1]=3000;
        h1[BINS]=4000; h2[BINS]=6000;
        dist=dm.distance(h1, h2);
        System.err.println("distance="+dist);
        
        if (true) return null;
        */
    }
    
    public class DM_I1 extends DistanceMeasure
    {
        //return the bare data based on the brightness
        public int[] getBareData(int[] source, Dimension d) {
            return (new I1ChnlMaker()).getProcessed(source,d);
        }
    }
        
}