/********************************************************************/ /* Display Parameters */ /********************************************************************/ /// <summary> /// Loads image and passes it to the controller class. Only images of /// type "byte" are allowed. /// </summary> private void LoadImgButton_Click(object sender, System.EventArgs e) { string file,info; int dispROI = HWndCtrl.MODE_INCLUDE_ROI; if (openImageFileDialog.ShowDialog() == DialogResult.OK) { file = openImageFileDialog.FileName; roiController.reset(); mView.resetWindow(); if (mAssistant.setImage(file)) { currImage = mAssistant.getImage(); info = currImage.GetChannelInfo("type", 1); } else { info = "wrong file type"; } if (info != "byte") { currImage = null; mAssistant.setImage(currImage); dispROI = HWndCtrl.MODE_EXCLUDE_ROI; MessageBox.Show("Problem occured: The Image is of type \"" + info + "\".\nOnly byte images are supported by this Measure Assistant!", "Measure assistant", MessageBoxButtons.OK, MessageBoxIcon.Information); } mView.setDispLevel(dispROI); UpdateView(); } }