コード例 #1
0
        private void dataGridViewImage_MouseDown(object sender, MouseEventArgs e)
        {
            DataGridView.HitTestInfo theHitTestInfo;

            if (e.Button == MouseButtons.Right)
            {
                // Find out what part of the data grid is below the mouse pointer.
                theHitTestInfo = dataGridViewImage.HitTest(e.X, e.Y);

                switch (theHitTestInfo.Type)
                {
                case DataGridViewHitTestType.Cell:
                {
                    //Image image = (Image)scuDicomThread.ImageList[theHitTestInfo.RowIndex];
                    ArrayList _aList = (ArrayList)dataGridViewImage.DataSource;
                    Image     image  = (Image)_aList[theHitTestInfo.RowIndex];
                    if ((string)queryLevelComboBox.SelectedItem == "Patient_Root")
                    {
                        for (int i = 0; i < patientList.Count; i++)
                        {
                            Patient   patient  = (Patient)patientList[i];
                            ArrayList stdyList = patient.studyList;
                            for (int j = 0; j < stdyList.Count; j++)
                            {
                                Study     stdy       = (Study)stdyList[j];
                                ArrayList serieslist = stdy.seriesList;
                                for (int k = 0; k < serieslist.Count; k++)
                                {
                                    Series    seri    = (Series)serieslist[k];
                                    ArrayList imglist = seri.imageList;
                                    for (int l = 0; l < imglist.Count; l++)
                                    {
                                        Image img = (Image)imglist[l];
                                        if (image.SOPInstanceUID == img.SOPInstanceUID)
                                        {
                                            patientId    = patient.PatientId;
                                            studyInstId  = stdy.StudyInstanceUID;
                                            seriesInstId = seri.SeriesUID;
                                            imageInstId  = img.SOPInstanceUID;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if ((string)queryLevelComboBox.SelectedItem == "Study_Root")
                    {
                        for (int i = 0; i < studyList.Count; i++)
                        {
                            Study     stdy       = (Study)studyList[i];
                            ArrayList serieslist = stdy.seriesList;
                            for (int j = 0; j < serieslist.Count; j++)
                            {
                                Series    seri    = (Series)serieslist[j];
                                ArrayList imglist = seri.imageList;
                                for (int l = 0; l < imglist.Count; l++)
                                {
                                    Image img = (Image)imglist[l];
                                    if (image.SOPInstanceUID == img.SOPInstanceUID)
                                    {
                                        studyInstId  = stdy.StudyInstanceUID;
                                        seriesInstId = seri.SeriesUID;
                                        imageInstId  = img.SOPInstanceUID;
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    queryLevel = "IMAGE";
                    break;
                }
                }
            }
        }
コード例 #2
0
ファイル: SCUDicomThread.cs プロジェクト: ewcasas/DVTK
        private Patient CreateNewPatientInfo(DvtkHighLevelInterface.Dicom.Other.DataSet dataSet)
        {
            string patientName = "";
            if (dataSet.Exists("0x00100010"))
            {
                HLI.Attribute patientNameAtt = dataSet["0x00100010"];
                patientName = patientNameAtt.Values[0];
            }

            string patientId = "";
            if (dataSet.Exists("0x00100020"))
            {
                HLI.Attribute patientIdAtt = dataSet["0x00100020"];
                patientId = patientIdAtt.Values[0];
            }

            string patientBd = "";
            if (dataSet.Exists("0x00100030"))
            {
                HLI.Attribute patientBdAtt = dataSet["0x00100030"];
                patientBd = patientBdAtt.Values[0];
            }

            Patient patient = new Patient();
            patient.PatientName = patientName;
            patient.PatientId = patientId;
            patient.PatientBirthDate = patientBd;

            return patient;
        }