private void tbOpenFile_Click(object sender, EventArgs e) { if (OriginalImage != null) { //if (MessageBox.Show("是否要對上一次的操作結果儲存?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) //{ // SaveLabelFile(); //} SaveLabelFile(); } using (OpenFileDialog dialog = new OpenFileDialog()) { dialog.Filter = "*.dcm|*.dcm|All File(*.*)|*.*"; if (dialog.ShowDialog() == DialogResult.OK) { ImagePath_Dcm = dialog.FileName; string dcmFileName = System.IO.Path.GetFileNameWithoutExtension(ImagePath_Dcm); string targetFileName = dcmFileName + ".jpg"; //檢查存檔路徑是否跟讀取影像有相同的影像,如果有則直接載入影像,如果沒有則轉檔載入 string targetFilePath = Path.Combine(SettingObj.SavePath, targetFileName); RightNowInfo = Image_Func.DcmDetailData(ImagePath_Dcm); if (!Func.CheckFileExist(targetFilePath)) { //檔案不存在 string jpgFilePath = Image_Func.DcmToJPG(ImagePath_Dcm, SettingObj.SavePath); targetFilePath = jpgFilePath; } ImagePath_Jpg = targetFilePath; //顯示在ImageBox Bitmap image = (Bitmap)Bitmap.FromFile(ImagePath_Jpg); Image <Bgr, Byte> img = new Image <Bgr, Byte>(image); SettingImage(img); LoadingLabelFile(ImagePath_Dcm, ImagePath_Jpg); AdjustmentInit(true); ImageProc(); } } }
/// <summary>The parse dicom info.</summary> /// <param name="dcmInfo">The dcm info.</param> /// <param name="directoryName">The directory name.</param> /// <returns>The <see cref="int"/>.</returns> public static int ParseDicomInfo(DcmInfo dcmInfo, string directoryName) { return(0); }