public void Execute() { this.OnBeforeExecute(); List <ImageSop> images = new List <ImageSop>(); try { VolumeFunction function = _function.Normalize(100); foreach (ISopDataSource sopDataSource in function.CreateSops(100, 100, 100, false)) { this.InitializeSopDataSource(sopDataSource); images.Add(new ImageSop(sopDataSource)); } MprViewerComponent component = new MprViewerComponent(Volume.Create(EnumerateFrames(images))); component.Layout(); LaunchImageViewerArgs args = new LaunchImageViewerArgs(WindowBehaviour.Auto); args.Title = component.Title; MprViewerComponent.Launch(component, args); } catch (Exception ex) { ExceptionHandler.Report(ex, Application.ActiveDesktopWindow); } finally { DisposeAll(images); } this.OnAfterExecute(); }
/// <summary> /// Finds the ImageBox displaying the specified slice set /// </summary> protected static IImageBox FindImageBox(IMprSliceSet sliceSet, MprViewerComponent viewer) { if (sliceSet == null || viewer == null) { return(null); } foreach (IImageBox imageBox in viewer.PhysicalWorkspace.ImageBoxes) { if (imageBox.DisplaySet != null && imageBox.DisplaySet.Uid == sliceSet.Uid) { return(imageBox); } } return(null); }