private void _btnCancel_Click(object sender, EventArgs e) { _mainForm.FilterCancel_Click(_firstTime, _originalBitmap, false); _cell.SetWindowLevel(_oldWindowWidth, _oldWindowCenter); _cell.Invalidate(); }
private void AdjustFusionImage_Edit(object sender, AnnRectangleObject fusionEditRect) { int subCellIndex = _cell.ActiveSubCell; int index = _cmbFusedIndex.SelectedIndex; MedicalViewerFusion fusion = _cell.SubCells[subCellIndex].Fusion[index]; AnnContainer _Container = GetContainer(_cell, fusionEditRect); fusion.Rotation = (float)fusionEditRect.Angle; LeadPointD[] pt = new LeadPointD[1]; LeadRectD rect = _Container.Mapper.RectFromContainerCoordinates(fusionEditRect.Rect, AnnFixedStateOperations.None); Rectangle displayRect = _cell.GetDisplayedImageRectangle(); rect.Offset(-displayRect.Left, -displayRect.Top); pt[0].X = (float)(rect.X + rect.Width / 2); pt[0].Y = (float)(rect.Y + rect.Height / 2); LeadPointD point = LeadPointD.Create(pt[0].X, pt[0].Y); _cell.AutomationContainer.Mapper.Transform.TransformPoints(pt); float normalizedXPosition = (float)(((float)point.X - (float)displayRect.Width / 2) / fusion.FusedImage.Width * 100 / _cell.GetScale(subCellIndex)); float normalizedYPosition = (float)(((float)point.Y - (float)displayRect.Height / 2) / fusion.FusedImage.Height * 100 / _cell.GetScale(subCellIndex)); float scaleX = (float)((rect.Width / fusion.FusedImage.Width) * 100 / _cell.GetScale(subCellIndex)); float scaleY = (float)((rect.Height / fusion.FusedImage.Height) * 100 / _cell.GetScale(subCellIndex)); if (scaleX == 0) { scaleX = 0.1F; } if (scaleY == 0) { scaleY = 0.1F; } RectangleF rectangle = new RectangleF(normalizedXPosition, normalizedYPosition, Math.Abs(scaleX), Math.Abs(scaleY)); fusion.DisplayRectangle = rectangle; UpdateFusionUI(index); CellData cellData = (CellData)_cell.Tag; if (cellData.SyncCellFusion) { UpdateCellFusions(fusion, subCellIndex, index); } _cell.Invalidate(); }
private void _txtWeight_TextChanged(object sender, EventArgs e) { int index = _listFusionImages.SelectedIndex; if (index == -1) { return; } int Num; bool isNum = int.TryParse(_txtWeight.Text, out Num); if (!isNum) { _txtWeight.Text = _weightList[index].ToString(); } else { if (_txtWeight.Text == "") { _weightList[index] = 0; } else { _weightList[index] = Math.Min(100, Convert.ToInt32(_txtWeight.Text)); } _trackBarWeight.Value = _weightList[index]; _cell.SubCells[_cell.ActiveSubCell].Fusion[index].FusionScale = _weightList[index] / 100.0f; _cell.Invalidate(); } }
private void ApplyFilter() { _mainForm.FilterRunCommand(_command, false, false); if (_cell.Image.BitsPerPixel == 16) { int orignalPage = _cell.Image.Page; _cell.Image.Page = _cell.ActiveSubCell + 1; GetLinearVoiLookupTableCommand voiLut = new GetLinearVoiLookupTableCommand(); voiLut.Run(_cell.Image); _cell.Image.Page = orignalPage; _cell.SetWindowLevel(_cell.ActiveSubCell, (int)voiLut.Width, (int)voiLut.Center); } _cell.Invalidate(); }
private void _cbFrames_ItemCheck(object sender, ItemCheckEventArgs e) { if (!_firstTime) { if (_form.StentCommand != null) { if (!(e.CurrentValue == CheckState.Checked)) { _form.StentCommand.SelectFrame(_cell.Image, e.Index); } else { _form.StentCommand.UnSelectFrame(_cell.Image, e.Index); } _form.ApplyEnhancements(_form.StentCommand.EnhancedImage); _cell.Invalidate(); } } }