public static Volume Create(IEnumerable <string> filenames, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(filenames, "filenames"); List <ImageSop> loadedImageSops = new List <ImageSop>(); try { foreach (string fileName in filenames) { try { loadedImageSops.Add(new ImageSop(fileName)); } catch (Exception ex) { throw new ArgumentException(string.Format("Files must be valid DICOM image SOPs. File: {0}", fileName), ex); } } List <Frame> frames = new List <Frame>(); foreach (ImageSop sop in loadedImageSops) { frames.AddRange(sop.Frames); } return(Create(frames, callback)); } finally { foreach (ImageSop sop in loadedImageSops) { sop.Dispose(); } } }
public FrameCopyProgressTracker(int count, CreateVolumeProgressCallback callback) { _current = -1; // the callback notifies using frame index, not frame number, so the first callback should be 0 _count = count; _callback = callback; _synchronizationContext = SynchronizationContext.Current; }
public VolumeBuilder(IEnumerable<IFrameReference> frames, CreateVolumeProgressCallback callback) { _callback = callback ?? delegate { }; _frames = new List<IFrameReference>(); foreach (IFrameReference frame in frames) _frames.Add(frame.Clone()); }
public static Volume Create(IEnumerable<string> filenames, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(filenames, "filenames"); List<ImageSop> loadedImageSops = new List<ImageSop>(); try { foreach (string fileName in filenames) { try { loadedImageSops.Add(new ImageSop(fileName)); } catch (Exception ex) { throw new ArgumentException(string.Format("Files must be valid DICOM image SOPs. File: {0}", fileName), ex); } } List<Frame> frames = new List<Frame>(); foreach (ImageSop sop in loadedImageSops) frames.AddRange(sop.Frames); return Create(frames, callback); } finally { foreach (ImageSop sop in loadedImageSops) sop.Dispose(); } }
public static Volume Create(IEnumerable <IFrameReference> frames, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(frames, "frames"); using (VolumeBuilder builder = new VolumeBuilder(frames, callback)) { return(builder.Build()); } }
public static Volume Create(IEnumerable<IFrameReference> frames, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(frames, "frames"); using (VolumeBuilder builder = new VolumeBuilder(frames, callback)) { return builder.Build(); } }
public VolumeBuilder(IEnumerable <IFrameReference> frames, CreateVolumeProgressCallback callback) { _callback = callback ?? delegate { }; _frames = new List <IFrameReference>(); foreach (IFrameReference frame in frames) { _frames.Add(frame.Clone()); } }
public static Volume Create(IDisplaySet displaySet, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(displaySet, "displaySet"); List<Frame> frames = new List<Frame>(); foreach (IPresentationImage image in displaySet.PresentationImages) { IImageSopProvider imageSopProvider = image as IImageSopProvider; if (imageSopProvider == null) throw new ArgumentException("Images must be valid IImageSopProviders."); frames.Add(imageSopProvider.Frame); } return Create(frames, callback); }
public static Volume Create(IDisplaySet displaySet, CreateVolumeProgressCallback callback) { Platform.CheckForNullReference(displaySet, "displaySet"); List <Frame> frames = new List <Frame>(); foreach (IPresentationImage image in displaySet.PresentationImages) { IImageSopProvider imageSopProvider = image as IImageSopProvider; if (imageSopProvider == null) { throw new ArgumentException("Images must be valid IImageSopProviders."); } frames.Add(imageSopProvider.Frame); } return(Create(frames, callback)); }