private void Bn_InputFile1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "请选择要打开的数据:"; openFileDialog.Filter = "Raster Files|*.tif;*.tiff;*.img"; if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } Tb_InputFile1.Text = openFileDialog.FileName; PCAfusionParams.PanFilePath = openFileDialog.FileName; IRasterDataset rasterDataset = DatasetFactory.OpenRasterDataset(openFileDialog.FileName, OpenMode.Update) as IRasterDataset; Cb_BandSelect.Items.Clear(); for (int i = 1; i <= rasterDataset.GetBandCount(); i++) { Cb_BandSelect.Items.Add("波段" + i.ToString()); } }
/// <summary> /// 点击获取数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "请选择要打开的数据"; openFileDialog.Filter = "Raster Files|*.tif;*.tiff;*.img"; if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } textBox1.Text = openFileDialog.FileName; neuralEx.InputFilePath = openFileDialog.FileName; IRasterDataset rasterDataset = DatasetFactory.OpenRasterDataset(openFileDialog.FileName, OpenMode.Update) as IRasterDataset; listBox1.Items.Clear(); for (int i = 1; i <= rasterDataset.GetBandCount(); i++) { listBox1.Items.Add("波段" + i.ToString()); } BandCount = rasterDataset.GetBandCount(); }
private void Bn_ChooseFile_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "请选择要打开的数据:"; openFileDialog.Filter = "Raster Files|*.tif;*.tiff;*.img"; if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } Tb_InputFile.Text = openFileDialog.FileName; iSODataParams.InputFilePath = openFileDialog.FileName; IRasterDataset rasterDataset = DatasetFactory.OpenRasterDataset(openFileDialog.FileName, OpenMode.Update) as IRasterDataset; for (int i = 1; i <= rasterDataset.GetBandCount(); i++) { LB_BandDisplay.Items.Add("波段" + i.ToString()); } IList <int> lowBand = new List <int>(); lowBand.Add(0); lowBand.Add(1); lowBand.Add(2); iSODataParams.LowBands = lowBand; }