private static SaveImageFormat GetImageFormat ( SaveImageFormatElement imageFormatElement ) { SaveImageFormat imageFormat; imageFormat = new SaveImageFormat( ); imageFormat.Format = ( RasterImageFormat )Enum.Parse(typeof(RasterImageFormat), imageFormatElement.Format, true); imageFormat.Height = imageFormatElement.Height; imageFormat.Width = imageFormatElement.Width; imageFormat.QualityFactor = imageFormatElement.QFactor; return(imageFormat); }
private static SaveImageFormatElement GetImageFormatElement ( SaveImageFormat imageFormat ) { SaveImageFormatElement imageFormatElement; imageFormatElement = new SaveImageFormatElement( ); imageFormatElement.Format = Enum.GetName(typeof(RasterImageFormat), imageFormat.Format); imageFormatElement.Height = imageFormat.Height; imageFormatElement.Width = imageFormat.Width; imageFormatElement.QFactor = imageFormat.QualityFactor; return(imageFormatElement); }
private static void FillStoreCommandDefualtSettings(StorageAddInsConfiguration settings, string serviceName) { CStoreCommandConfiguration defaultStoreConfiguration; defaultStoreConfiguration = new CStoreCommandConfiguration(); //// Default the TifJ2K //// This is for the ImagePyramid and automatic generation of instance.json files on store //// This speeds access to image in the HTML5 Medical Web Viewer //SaveImageFormat defaultFormat = new SaveImageFormat // { // Format = RasterImageFormat.TifJ2k, // Width = 0, // Height = 0, // QualityFactor = 2 // }; //defaultStoreConfiguration.OtherImageFormat.Add(defaultFormat); // Set the default store location settings.StoreAddIn.StorageLocation = Path.Combine(defaultStoreConfiguration.DataSetStorageLocation, serviceName); #if (LEADTOOLS_V19_OR_LATER) settings.StoreAddIn.HangingProtocolLocation = Path.Combine(defaultStoreConfiguration.HangingProtocolLocation, serviceName); #endif settings.StoreAddIn.StoreFileExtension = defaultStoreConfiguration.DicomFileExtension; // Set the default Overwrite location settings.StoreAddIn.OverwriteBackupLocation = Path.Combine(defaultStoreConfiguration.OverwriteBackupLocation, serviceName); // Set the default Backup location string storeLocation = GetCommonDocumentsFolder(); string deleteBackupLocation = Path.Combine(storeLocation, "Backup"); settings.StoreAddIn.DeleteBackupLocation = Path.Combine(deleteBackupLocation, serviceName); // Set the default CStoreFailures location string storeFailuresLocation = Path.Combine(storeLocation, "StoreFailures"); settings.StoreAddIn.CStoreFailuresPath = Path.Combine(storeFailuresLocation, serviceName); settings.StoreAddIn.DirectoryStructure.CreatePatientFolder = defaultStoreConfiguration.DirectoryStructure.CreatePatientFolder; settings.StoreAddIn.DirectoryStructure.CreateSeriesFolder = defaultStoreConfiguration.DirectoryStructure.CreateSeriesFolder; settings.StoreAddIn.DirectoryStructure.CreateStudyFolder = defaultStoreConfiguration.DirectoryStructure.CreateStudyFolder; settings.StoreAddIn.DirectoryStructure.UsePatientName = defaultStoreConfiguration.DirectoryStructure.UsePatientName; settings.StoreAddIn.DirectoryStructure.SplitPatientId = defaultStoreConfiguration.DirectoryStructure.SplitPatientId; foreach (SaveImageFormat imageFormat in defaultStoreConfiguration.OtherImageFormat) { SaveImageFormatElement saveImageElement; saveImageElement = new SaveImageFormatElement( ); saveImageElement = GetImageFormatElement(imageFormat); settings.StoreAddIn.ImagesFormat.Add(saveImageElement); } settings.StoreAddIn.CreateThumbnailImage = defaultStoreConfiguration.SaveThumbnail; if (defaultStoreConfiguration.SaveThumbnail) { settings.StoreAddIn.ThumbnailFormat = GetImageFormatElement(defaultStoreConfiguration.ThumbnailFormat); } }