/// <summary> /// /// </summary> /// <param name="ivdc"></param> /// <returns></returns> public ImageVolumeDataContract AddImageVolume(ImageVolumeDataContract ivdc) { // assert that GUID was not already assigned System.Diagnostics.Trace.Assert(ivdc.Id.CompareTo(Guid.Empty) == 0); ivdc.Id = Guid.NewGuid(); ivdc.PixelBuffer = BufferRepository.CreateBuffer(ivdc.Id, typeof(ushort), ivdc.Width * ivdc.Height * ivdc.Depth); _cacheImageVolumes.TryAdd(ivdc.Id, ivdc); return(ivdc); }
/// <summary> /// /// </summary> /// <param name="ivdc"></param> /// <returns></returns> public ImageVolumeDataContract AddImageVolume(ImageVolumeDataContract ivdc) { // assert that GUID was not already assigned System.Diagnostics.Trace.Assert(ivdc.Id.CompareTo(Guid.Empty) == 0); ivdc.Id = Guid.NewGuid(); ivdc.PixelBuffer = BufferRepository.CreateBuffer(ivdc.Id, typeof(ushort), ivdc.Width * ivdc.Height * ivdc.Depth); _cacheImageVolumes.TryAdd(ivdc.Id, ivdc); return ivdc; }