Example #1
0
        private void Button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog(); //打开OpenFileDlg选择文件
            DCMFile        file   = new DCMFile();        //实例化DCMFile对象

            dialog.ShowDialog();
            file.Decode(dialog.FileName);

            string[] lines = file.ToString("").Split('\n');
            for (int i = 0; i < lines.Length; i++)
            {
                ListViewItem item = new ListViewItem(lines[i].Split('\t'));
                lvOutput.Items.Add(item); //显示到ListView中;
            }

            frmImage form = new frmImage(file.Data);

            form.Show();
        }
Example #2
0
        //OpenFileDialog openFile = new OpenFileDialog();
        //openFile.ShowDialog();
        //string path = openFile.FileName;
        //RtxtInput.Text = File.ReadAllText(path);
        //从文件读取内容到文本框
        private void btnfile_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDlg = new OpenFileDialog();

            openFileDlg.Filter = "Dicom文件|*.dcm";
            if (openFileDlg.ShowDialog() == DialogResult.OK)
            {
                RtxtInput.Text = File.ReadAllText(openFileDlg.FileName);
                DCMFile dcm = new DCMFile(openFileDlg.FileName);
                uint    idx = 0;
                dcm.Decode(null, ref idx);
                string   str   = dcm.ToString("");
                string[] lines = str.Split('\n');
                lvOutput.Items.Clear();
                for (int i = 0; i < lines.Length; i++)
                {
                    ListViewItem item = new ListViewItem(lines[i].Split('\t'));
                    lvOutput.Items.Add(item);
                }
                //DCMDataSet对象实例化FrmImage,并show
                frmImage frmImage = new frmImage(dcm);
                frmImage.Show();
            }
        }