示例#1
0
        private void cargarMapaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "Ficheros DCM (*.dcm)|*.dcm";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                using (var file = File.OpenRead(openFileDialog1.FileName))
                {
                    map          = Serializer.Deserialize <MapaST>(file);
                    pbMapa.Image = map.printBW();
                    if (map.Regiones == null)
                    {
                        map.Regiones = new HashSet <Masslabelling.Region>();
                    }
                    else
                    {
                        foreach (Masslabelling.Region R in map.Regiones)
                        {
                            tvAccidentes.Nodes.Add(fillTree(R));
                        }
                    }
                    tbS.Text = map.Semilla;
                }
            }
        }
示例#2
0
        private void abrirImágenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ibImagen.FunctionalMode = Emgu.CV.UI.ImageBox.FunctionalModeOption.Minimum;
            ibCrop.FunctionalMode   = Emgu.CV.UI.ImageBox.FunctionalModeOption.Minimum;
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "Ficheros DCM (*.dcm)|*.dcm";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                using (var file = File.OpenRead(openFileDialog1.FileName))
                {
                    map = Serializer.Deserialize <MapaST>(file);
                    src = new Image <Gray, Byte>(map.printBW());
                    if (map.Regiones == null)
                    {
                        map.Regiones = new HashSet <Masslabelling.Region>();
                    }
                    ibImagen.Image = src;
                }
            }
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            tvAccidentes.Nodes.Clear();
            map           = new MapaST(Convert.ToInt32(nudW.Value), Convert.ToInt32(nudH.Value), tbS.Text);
            map.Latitude  = double.Parse(tbLat.Text);
            map.Longitude = double.Parse(tbLong.Text);
            map.Scale     = double.Parse(tbScale.Text);
            map.WaterLine = double.Parse(nudAgua.Value.ToString());
            map.ColorFile = ((KeyValuePair <string, string>)cbSchema.SelectedItem).Value;

            //map.SaveColMap();

            //map.Mercador();
            int proj = ((KeyValuePair <string, int>)cbProyecciones.SelectedItem).Value;

            switch (proj)
            {
            case 0:
                map.Mercador();
                break;

            case 1:
                map.Mollweide();
                break;

            default:
                map.Mercador();
                break;
            }

            //map.Mollweide();

            //map.MakeHeightMap();
            // map.Save();
            //map.printBMP();
            pbMapa.Image = map.printBMP2();
            //int i = 3;
        }
示例#4
0
 private void nuevoMapaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     pbMapa.Image = null;
     tvAccidentes.Nodes.Clear();
     map = null;
 }