public ROIDescriptor GetROIDescriptor() { ROIDescriptor roiDescriptor = new ROIDescriptor(); if (ROIList.Count == 0) { return(roiDescriptor); } foreach (ROI item in ROIList) { roiDescriptor.contours.Add(item.GetROIDescriptorContour()); } return(roiDescriptor); }
//https://docs.microsoft.com/en-us/dotnet/api/system.windows.dependencypropertychangedeventargs?view=netcore-3.1 private static void OnGetLastEventDataChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { uImageControl imageControl = (uImageControl)obj; ROIDescriptor.LastEventData lastEventData = (ROIDescriptor.LastEventData)args.NewValue; ROIDescriptor.LastEventData other = (ROIDescriptor.LastEventData)args.OldValue; if (lastEventData.type == EventType.Draw) { ROIDescriptor lastROIDescriptor = imageControl._lastROIDescriptor; ROIDescriptor previousROIDescriptor = imageControl.GetROIDescriptor(); if (!lastEventData.IsChanged(other) || !previousROIDescriptor.IsChanged(lastROIDescriptor)) { imageControl._lastROIDescriptor = previousROIDescriptor; imageControl.OnROIValueChanged(new ROIValueChangedEventArgs(lastEventData, lastROIDescriptor, previousROIDescriptor)); } } }
public ROIValueChangedEventArgs(ROIDescriptor.LastEventData lastEventData, ROIDescriptor oldROI, ROIDescriptor newROI) { this.lastEventData = lastEventData; this.ROI = newROI; }
public static void µROItoMask(ROIDescriptor rOI, µImage mask) { return; }