public IList <IStorageLocation> CreateMedia ( DicomMediaWriterParameters mediaParameters, ILocationProvider storageProvider, int[] frameList ) { if (null == storageProvider) { throw new InvalidOperationException("No MediaStorage service found"); } List <IStorageLocation> locations = new List <IStorageLocation> ( ); var dataset = GetMediaDataset(mediaParameters.Dataset, mediaParameters.MediaInfo); string transferSyntax = (!string.IsNullOrWhiteSpace(mediaParameters.MediaInfo.TransferSyntax)) ? (mediaParameters.MediaInfo.TransferSyntax) : ""; if (!StoreMultiFrames) { throw new InvalidOperationException("Media writer doesn't support generating frames"); } foreach (int frame in frameList) { var storeLocation = storageProvider.GetLocation(MediaFactory.Create(mediaParameters.Dataset, frame, MediaType, transferSyntax)); Upload(mediaParameters.Dataset, frame, storeLocation); locations.Add(storeLocation); } return(locations); }
public IList <IStorageLocation> CreateMedia ( DicomMediaWriterParameters mediaParameters ) { return(CreateMedia(mediaParameters, MediaStorage)); }
public IList <IStorageLocation> CreateMedia ( DicomMediaWriterParameters mediaParameters, ILocationProvider sotrageProvider ) { if (null != sotrageProvider) { int framesCount = 1; List <IStorageLocation> locations = new List <IStorageLocation> ( ); var dataset = GetMediaDataset(mediaParameters.Dataset, mediaParameters.MediaInfo); string transferSyntax = (!string.IsNullOrWhiteSpace(mediaParameters.MediaInfo.TransferSyntax)) ? (mediaParameters.MediaInfo.TransferSyntax) : ""; if (StoreMultiFrames) { DicomPixelData pd; pd = DicomPixelData.Create(mediaParameters.Dataset); framesCount = pd.NumberOfFrames; } for (int frame = 1; frame <= framesCount; frame++) { var storeLocation = sotrageProvider.GetLocation(MediaFactory.Create(mediaParameters.Dataset, frame, MediaType, transferSyntax)); Upload(dataset, frame, storeLocation); locations.Add(storeLocation); } return(locations); } throw new InvalidOperationException("No MediaStorage service found"); }