示例#1
0
        /// <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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        /// <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));
        }
示例#5
0
        public int GetAudioGroupsCount(string authenticationCookie, string sopInstanceUID)
        {
            ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve);

            try
            {
                return(AddinsFactory.CreateObjectRetrieveAddin().GetAudioGroupsCount(sopInstanceUID));
            }
            catch
            {
                return(0);
            }
        }
示例#6
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));
        }
示例#7
0
        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);
        }
示例#8
0
 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 { }
 }
示例#9
0
        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;
            }
        }
示例#10
0
        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);
            }
        }
示例#11
0
        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);
            }
        }
示例#12
0
        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();
 }
示例#14
0
 public StoreService()
 {
     _addin = AddinsFactory.CreateStoreAddin();
 }
示例#15
0
 public WorklistService()
 {
     _Factory = new AddinsFactory();
     _AuthenticationService = _Factory.CreateAuthenticationAddin();
     _worklistAddin         = _Factory.CreateWorklistAddin();
 }
 public MonitorCalibrationService()
 {
     _MonitorCalibration = AddinsFactory.CreateMonitorCalibrationAddin();
 }
示例#17
0
        public void DeleteAnnotations(string authenticationCookie, string annotationID, string userData)
        {
            ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanDeleteAnnotations);

            AddinsFactory.CreateAnnotationsAddin( ).DeleteAnnotations(annotationID, userData);
        }
示例#18
0
        public WCFHangingProtocol GetHangingProtocol(string authenticationCookie, string sopInstanceUID, string userData)
        {
            var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve);

            return(AddinsFactory.CreateObjectRetrieveAddin().GetHangingProtocol(userName, sopInstanceUID, userData));
        }
示例#19
0
 public PACSRetrieveService()
 {
     _addin = AddinsFactory.CreatePacsDownloadAddin();
 }
示例#20
0
 public ObjectQueryService( )
 {
     _queryAddin = AddinsFactory.CreateQueryAddin();
 }
示例#21
0
 public ThreeDService( )
 {
     _queryAddin = AddinsFactory.CreateQueryAddin();
 }
示例#22
0
        public StudyLayout GetStudyLayout(string authenticationCookie, string studyInstanceUID, string userData)
        {
            var userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve);

            return(AddinsFactory.CreateObjectRetrieveAddin().GetStudyLayout(userName, studyInstanceUID, userData));
        }
示例#23
0
        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);
        }
示例#24
0
        public int[] GetMinMaxValues(string authenticationCookie, string sopInstanceUID, int frameNumber, string userData)
        {
            ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve);

            return(AddinsFactory.CreateObjectRetrieveAddin().GetMinMaxValues(sopInstanceUID, frameNumber));
        }
示例#25
0
        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));
        }
示例#26
0
 public TemplateService()
 {
     _addin = AddinsFactory.CreateTemplateAddin();
 }
示例#27
0
 public AuthenticationService()
 {
     _addin = AddinsFactory.CreateAuthenticationAddin();
 }
示例#28
0
        public AnnotationIdentifier[] FindSeriesAnnotations(string authenticationCookie, string seriesInstanceUID, string userData)
        {
            ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanViewAnnotations);

            return(AddinsFactory.CreateAnnotationsAddin( ).FindSeriesAnnotations(seriesInstanceUID, userData));
        }
示例#29
0
 public OptionsService()
 {
     _optionsAddin = AddinsFactory.CreateOptionsAddin();
 }
示例#30
0
        public List <StackItem> GetSeriesStacks(string authenticationCookie, string seriesInstanceUID, string userData)
        {
            ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanRetrieve);

            return(AddinsFactory.CreateObjectRetrieveAddin().GetSeriesStacks(seriesInstanceUID));
        }