protected void selectListDicom_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) { string selected = selectListDicom.SelectedItem.ToString(); dcm item = new dcm(sys.dicomsPath + selected.Substring(selected.LastIndexOf('|') + 1)); Details.Text = item.patientName + Environment.NewLine + convToDate(item.dateOfScan) + Environment.NewLine + convToTime(item.timeOfScan) + Environment.NewLine + item.frameNum; }
private void buttonConvert_Click(object sender, EventArgs e) { // make sure they selected a file for conversion if (selectListDicom.SelectedItem == null) { popup.msg("Select a file to be converted."); return; } if (selectListDicom.CheckedItems == null || selectListDicom.CheckedItems.Count <= 0) { popup.msg("No dicom files selected."); return; } string presetfile = sys.presetPath + dropdownProfiles.SelectedValue; IDictionary <string, string> presetsettings = sys.getPresets(presetfile + ".txt"); buttonConvert.Text = "Converting"; buttonConvert.Enabled = false; Console.WriteLine(presetsettings.ToString()); ProgressWindow form2 = new ProgressWindow(selectListDicom.CheckedItems); this.Enabled = false; foreach (object item in selectListDicom.CheckedItems) { string toPass = item.ToString(); form2.textbox(toPass.Substring(toPass.LastIndexOf('|') + 1)); //filename form2.progressbar(0); form2.Show(); Application.DoEvents(); dcm temp = new dcm(sys.dicomsPath + toPass.Substring(toPass.LastIndexOf('|') + 1)); gui.convert(toPass.Substring(toPass.LastIndexOf('|') + 1), form2, temp.frameRate); } form2.setProgress(100); form2.textbox("Done"); form2.progtext("Done"); form2.Update(); Application.DoEvents(); Thread.Sleep(2000); form2.Close(); this.Enabled = true; this.Focus(); buttonConvert.Text = "Convert"; buttonConvert.Enabled = true; initMovList(); //update mov list }
private void initDicomList() { string[] dcmList = gui.getDicomFiles(sys.dicomsPath); if (dcmList.Length > 0) { foreach (string file in dcmList) { dcm temp = new dcm(sys.dicomsPath + file); if (temp.frameNum > 1) { selectListDicom.Items.Add(temp); } } } else { selectListDicom.Items.Add("No .dcm files found."); selectListDicom.SelectionMode = SelectionMode.None; } }