예제 #1
0
        private void Mask_Load_Click(object sender, EventArgs e)
        {
            ListSelectionDialog diag = new ListSelectionDialog();

            bool success = wgDB.GetAllMasks();

            if (success)
            {
                for (int i = 0; i < wgDB.m_maskList.Count(); i++)
                {
                    diag.AddItemToList(wgDB.m_maskList[i].Description, wgDB.m_maskList[i].MaskID);
                }

                diag.ShowDialog();

                if (diag.m_itemSelected)
                {
                    MaskContainer mask;
                    success = wgDB.GetMask(diag.m_databaseID, out mask);

                    if (success)
                    {
                        m_mask.SetupMaskFromContainer(mask);

                        //success = wgDB.GetReferenceImage(mask.ReferenceImageID, out m_refImage);

                        //if (success)
                        //{
                        //    if (m_colorModel.m_maxPixelValue != m_refImage.MaxPixelValue)
                        //    {
                        //        m_colorModel.SetMaxPixelValue(m_refImage.MaxPixelValue);
                        //        m_colorModel.BuildColorMap();
                        //    }

                        //    SetImage(m_refImage.ImageData, m_refImage.Width, m_refImage.Height);
                        //}

                        DrawMask();
                    }
                }
            }
        }
예제 #2
0
        public void PopulateMaskList()
        {
            bool success = wgDB.GetAllMasks();

            if (success)
            {
                if (VM.MaskList == null)
                {
                    VM.MaskList = new ObservableCollection <MaskContainer>();
                }
                else
                {
                    VM.MaskList.Clear();
                }

                foreach (MaskContainer mask in wgDB.m_maskList)
                {
                    VM.MaskList.Add(mask);
                }
            }
        }