private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Dictionary<int, int> mapPixels = new Dictionary<int,int>();
            int optimalThreshold;
            ImageMap = new Bitmap(comboBox1.Text);

            LogicSegmentation segmentation = new LogicSegmentation(ImageMap);

            segmentation.decomposeRGB();
            segmentation.greyScale();
            segmentation.composeRGB();
            segmentation.setMapImage(segmentation.getImageMap());
            mapPixels = segmentation.getMapOfPixels();

            LogicOptimalThreshold threshold = new LogicOptimalThreshold(mapPixels);
            optimalThreshold = threshold.OptimalThreshold;

            pictureHistogram.Image = segmentation.getHistogram(mapPixels, optimalThreshold);

            segmentation.decomposeRGB();
            segmentation.binarization(optimalThreshold);
            segmentation.composeRGB();
            segmentation.setMapImage(segmentation.getImageMap());
            pictureBox1.Image = ImageMap;

            labelUmbral.Text = optimalThreshold.ToString();
            Dictionary<int, DTOBinaryObject> binaryObjects = segmentation.generateBinaryObjects();
            LogicTanimoto tanimoto = new LogicTanimoto(binaryObjects);
            label2.Text = tanimoto.getPlate();
        }
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            LogicSegmentation segmentation = new LogicSegmentation(ImageMap);

            segmentation.decomposeRGB();
            segmentation.greyScale();
            segmentation.composeRGB();
            segmentation.setMapImage(segmentation.getImageMap());

            segmentation.decomposeRGB();
            segmentation.binarization((int)numericUpDown1.Value);
            segmentation.composeRGB();
            segmentation.setMapImage(segmentation.getImageMap());
            pictureBox1.Image = segmentation.getImageMap();

            Dictionary<int, DTOBinaryObject> binaryObjects = segmentation.generateBinaryObjects();
            LogicTanimoto tanimoto = new LogicTanimoto(binaryObjects);
            label2.Text = tanimoto.getPlate();
        }
 public UITanimoto(Dictionary<int, DTOBinaryObject> dictionary)
 {
     tanimoto = new LogicTanimoto(dictionary);
     InitializeComponent();
     InitializeCombos();
 }