/// <summary> /// Gets a single image /// </summary> /// <param name="authenticationCookie"></param> /// <param name="sopInstanceUID"></param> /// <returns></returns> /// <remarks> /// <para>RoleName:CanRetrieve</para> /// </remarks> public Stream GetImage(string authenticationCookie, string sopInstanceUID, int frame, string mimeType, int bitsPerPixel, int qualityFactor, int width, int height, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); if (frame <= 0) { frame = 1; } if (string.IsNullOrEmpty(mimeType)) { mimeType = SupportedMimeTypes.JPG; } if (mimeType.ToLower() == SupportedMimeTypes.JPG.ToLower()) { if (qualityFactor < 2) { qualityFactor = 2; } } WebOperationContext.Current.OutgoingResponse.ContentType = mimeType; return(AddinsFactory.CreateObjectRetrieveAddin().GetImage(sopInstanceUID, frame, mimeType, bitsPerPixel, qualityFactor, width, height, userData)); }
public string GetDicomJSON(string authenticationCookie, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID, string userData) { var user = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); ExtraOptions extraOptions = new ExtraOptions(); ObjectUID uid = new ObjectUID(); extraOptions.UserData = userData; uid.StudyInstanceUID = studyInstanceUID; uid.SeriesInstanceUID = seriesInstanceUID; if (string.IsNullOrEmpty(sopInstanceUID)) { var options = new QueryOptions(); options.StudiesOptions = new StudiesQueryOptions(); options.StudiesOptions.StudyInstanceUID = studyInstanceUID; options.SeriesOptions = new SeriesQueryOptions(); options.SeriesOptions.SeriesInstanceUID = seriesInstanceUID; var objectsFound = AddinsFactory.CreateQueryAddin().FindInstances(user, options, 1, true); if (objectsFound.Length > 0) { var objects = objectsFound.Where(o => o != null).ToArray(); if (objects.Length > 0) { sopInstanceUID = objects[0].SOPInstanceUID; } } } uid.SOPInstanceUID = sopInstanceUID; return(AddinsFactory.CreateObjectRetrieveAddin().GetDicomJSON(uid)); }
public Stream GetSeriesThumbnail(string authenticationCookie, string studyInstanceUID, string seriesInstanceUID, int width, int height) { var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); WebOperationContext.Current.OutgoingResponse.ContentType = SupportedMimeTypes.JPG; return(AddinsFactory.CreateObjectRetrieveAddin().GetSeriesThumbnail(userName, seriesInstanceUID, SupportedMimeTypes.JPG, 24, 10, width, height)); }
/// <summary> /// Gets the raw DICOM object as XML /// </summary> /// <param name="authenticationCookie">Cookie</param> /// <param name="uid">UIDs. Only SOPInstanceUID is used</param> /// <param name="options">Query options</param> /// <param name="extraOptions">Extra options</param> /// <returns>The DICOM as XML</returns> /// <remarks> /// <para>RoleName:CanRetrieve</para> /// </remarks> public XmlElement GetDicomXml(string authenticationCookie, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); ObjectUID uid = new ObjectUID(); uid.StudyInstanceUID = studyInstanceUID; uid.SeriesInstanceUID = seriesInstanceUID; uid.SOPInstanceUID = sopInstanceUID; return(AddinsFactory.CreateObjectRetrieveAddin().GetDicomXml(uid)); }
public int GetAudioGroupsCount(string authenticationCookie, string sopInstanceUID) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); try { return(AddinsFactory.CreateObjectRetrieveAddin().GetAudioGroupsCount(sopInstanceUID)); } catch { return(0); } }
public Stream GetAudio(string authenticationCookie, string sopInstanceUID, int groupIndex, string mimeType) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); if (string.IsNullOrEmpty(mimeType)) { mimeType = SupportedMimeTypes.WAVE; } WebOperationContext.Current.OutgoingResponse.ContentType = mimeType; return(AddinsFactory.CreateObjectRetrieveAddin().GetAudio(sopInstanceUID, groupIndex, mimeType)); }
public Stream GetImageTile(string authenticationCookie, string sopInstanceUID, int frame, int x, int y, int width, int height, int xResolution, int yResolution, Boolean wldata, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); LeadRect tile = LeadRect.Create(x, y, width, height); string mime; var stream = AddinsFactory.CreateObjectRetrieveAddin().GetImageTile(sopInstanceUID, frame, tile, xResolution, yResolution, wldata, userData, out mime); WebOperationContext.Current.OutgoingResponse.ContentType = mime; return(stream); }
public void ClearCache(string authenticationCookie) { try { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanDeleteCache); AddinsFactory.RefreshTimeStamp(); var storage = AddinsFactory.CacheDiskStorage; if (null != storage) { storage.RunCleanup(null); } } catch { } }
public ExportService() { try { _exportAddin = AddinsFactory.CreateExportAddin(); } catch (Exception ex) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError; WebOperationContext.Current.OutgoingResponse.StatusDescription = ex.Message; WebOperationContext.Current.OutgoingResponse.ContentType = "application/json"; throw; } }
public Stream GetMPRImage(string authenticationCookie, string id, int mprType, int index) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); _queryAddin.LockTimeOut(id); try { var stream = AddinsFactory.CreateObjectRetrieveAddin().GetMPRImage(id, mprType, index); WebOperationContext.Current.OutgoingResponse.ContentType = SupportedMimeTypes.PNG; return(stream); } finally { _queryAddin.UnlockTimeOut(id); } }
public XmlElement GetAnnotations(string authenticationCookie, string annotationID, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanViewAnnotations); Stream annStream = AddinsFactory.CreateAnnotationsAddin( ).GetAnnotations(annotationID, userData); if (null == annStream) { return(null); } else { annStream.Position = 0; XmlDocument document = new XmlDocument( ); document.Load(annStream); return(document.DocumentElement); } }
public AnnotationIdentifier SaveAnnotations(string authenticationCookie, string seriesInstanceUID, string annotationData, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanStoreAnnotations); string identifier = AddinsFactory.CreateAnnotationsAddin().SaveAnnotations(seriesInstanceUID, annotationData, userData); if (!string.IsNullOrEmpty(identifier)) { AnnotationIdentifier annID = new AnnotationIdentifier( ); annID.UserData = userData; annID.SeriesInstanceUID = seriesInstanceUID; annID.AnnotationID = identifier; return(annID); } else { return(null); } }
public PatientAccessRightsService( ) { _addin = AddinsFactory.CreatePatientAccessRightsAddin(); }
public StoreService() { _addin = AddinsFactory.CreateStoreAddin(); }
public WorklistService() { _Factory = new AddinsFactory(); _AuthenticationService = _Factory.CreateAuthenticationAddin(); _worklistAddin = _Factory.CreateWorklistAddin(); }
public MonitorCalibrationService() { _MonitorCalibration = AddinsFactory.CreateMonitorCalibrationAddin(); }
public void DeleteAnnotations(string authenticationCookie, string annotationID, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanDeleteAnnotations); AddinsFactory.CreateAnnotationsAddin( ).DeleteAnnotations(annotationID, userData); }
public WCFHangingProtocol GetHangingProtocol(string authenticationCookie, string sopInstanceUID, string userData) { var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); return(AddinsFactory.CreateObjectRetrieveAddin().GetHangingProtocol(userName, sopInstanceUID, userData)); }
public PACSRetrieveService() { _addin = AddinsFactory.CreatePacsDownloadAddin(); }
public ObjectQueryService( ) { _queryAddin = AddinsFactory.CreateQueryAddin(); }
public ThreeDService( ) { _queryAddin = AddinsFactory.CreateQueryAddin(); }
public StudyLayout GetStudyLayout(string authenticationCookie, string studyInstanceUID, string userData) { var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); return(AddinsFactory.CreateObjectRetrieveAddin().GetStudyLayout(userName, studyInstanceUID, userData)); }
public Stream DownloadImage(string authenticationCookie, string sopInstanceUID, int frame, int bitsPerPixel, int qualityFactor, int width, int height, string annotationFileName, double xDpi, double yDpi, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); if (frame <= 0) { frame = 1; } if (qualityFactor < 2) { qualityFactor = 2; } // string dir = HostingEnvironment.ApplicationPhysicalPath; string dir = Path.GetTempPath(); if (null == dir) { dir = string.Empty; } string outDir = Path.Combine(dir, "Temp"); string filePath = null; string annotationData = null; if (!String.IsNullOrEmpty(annotationFileName)) { filePath = Path.Combine(outDir, annotationFileName); } if (filePath != null && File.Exists(filePath)) { XmlDocument doc = new XmlDocument(); doc.Load(filePath); annotationData = doc.InnerXml; File.Delete(filePath); } if (null != WebOperationContext.Current) { WebOperationContext.Current.OutgoingResponse.ContentType = SupportedMimeTypes.JPG; WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Disposition", string.Format("attachment; filename={0}.jpg", sopInstanceUID.ToString())); } if (width == 0 && height == 0) { var captureSize = ConfigurationManager.AppSettings.Get("MaxCaptureSize"); if (!string.IsNullOrEmpty(captureSize)) { int.TryParse(captureSize, out width); int.TryParse(captureSize, out height); } } Stream stream = AddinsFactory.CreateObjectRetrieveAddin().DownloadImage(sopInstanceUID, frame, SupportedMimeTypes.JPG, bitsPerPixel, qualityFactor, width, height, annotationData, xDpi, yDpi, userData); if (null != WebOperationContext.Current) { WebOperationContext.Current.OutgoingResponse.ContentLength = stream.Length; } return(stream); }
public int[] GetMinMaxValues(string authenticationCookie, string sopInstanceUID, int frameNumber, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); return(AddinsFactory.CreateObjectRetrieveAddin().GetMinMaxValues(sopInstanceUID, frameNumber)); }
public List <DisplaySetView> GetHangingProtocolInstances(string authenticationCookie, string hangingProtocolSOP, string patientID, string studyInstanceUID, string studyDateMostRecent, string userData) { var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); return(AddinsFactory.CreateObjectRetrieveAddin().GetHangingProtocolInstances(userName, hangingProtocolSOP, patientID, studyInstanceUID, studyDateMostRecent, userData)); }
public TemplateService() { _addin = AddinsFactory.CreateTemplateAddin(); }
public AuthenticationService() { _addin = AddinsFactory.CreateAuthenticationAddin(); }
public AnnotationIdentifier[] FindSeriesAnnotations(string authenticationCookie, string seriesInstanceUID, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanViewAnnotations); return(AddinsFactory.CreateAnnotationsAddin( ).FindSeriesAnnotations(seriesInstanceUID, userData)); }
public OptionsService() { _optionsAddin = AddinsFactory.CreateOptionsAddin(); }
public List <StackItem> GetSeriesStacks(string authenticationCookie, string seriesInstanceUID, string userData) { ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve); return(AddinsFactory.CreateObjectRetrieveAddin().GetSeriesStacks(seriesInstanceUID)); }