예제 #1
0
            public FramePixelDataRetriever(FramePixelData source, MINTBinaryStream binaryStream, bool useBulkLoading)
            {
                BaseUrl = source.Parent.BinaryUri;

                StudyInstanceUid  = source.Parent.StudyInstanceUid;
                SeriesInstanceUid = source.Parent.SeriesInstanceUid;
                SopInstanceUid    = source.Parent.SopInstanceUid;
                FrameNumber       = source.FrameNumber;
                TransferSyntaxUid = source.Parent.TransferSyntaxUid;
                BinaryStream      = binaryStream;
                UseBulkLoading    = useBulkLoading;
            }
        public MINTSopDataSource(InstanceMINTXml instanceXml, MINTBinaryStream BinaryStream, bool UseBulkLoading)
            : base(new DicomFile("", new DicomAttributeCollection(), instanceXml.Collection))
        {
            //These don't get set properly for instance xml.
            DicomFile sourceFile = (DicomFile)SourceMessage;

            sourceFile.TransferSyntaxUid          = instanceXml.TransferSyntax.UidString;
            sourceFile.MediaStorageSopInstanceUid = instanceXml[DicomTags.SopInstanceUid].GetString(0, "");
            sourceFile.MetaInfo[DicomTags.SopClassUid].SetString(0, instanceXml[DicomTags.SopClassUid].GetString(0, ""));
            BinaryUri      = instanceXml.PixelDataUri;
            binaryStream   = BinaryStream;
            useBulkLoading = UseBulkLoading;
        }
        protected override int OnStart(StudyLoaderArgs studyLoaderArgs)
        {
            _studyKey = studyLoaderArgs.Server as MINTApi.StudyKey;

            EventResult      result          = EventResult.Success;
            AuditedInstances loadedInstances = new AuditedInstances();

            try
            {
                XmlDocument  doc      = RetrieveHeaderXml();
                StudyMINTXml studyXml = new StudyMINTXml(studyLoaderArgs);
                studyXml.SetMemento(_studyKey.MetadataUri, doc);

                var allInstances = studyXml.AllInstances;
                _instances = allInstances.GetEnumerator();

                var patientId        = studyXml[DicomTags.PatientId].GetString(0, "");
                var patientsName     = studyXml[DicomTags.PatientsName].GetString(0, "");
                var studyInstanceUid = studyXml[DicomTags.StudyInstanceUid].GetString(0, "");

                loadedInstances.AddInstance(patientId, patientsName, studyInstanceUid);

                UseBulkLoading = false;
                if (UseBulkLoading)
                {
                    binaryStream = new MINTBinaryStream();
                    binaryStream.SetBaseURI(_studyKey.MetadataUri);
                    binaryStream.RetrievePixelData();
                }
                return(allInstances.Count);
            }
            catch (Exception e)
            {
                Console.WriteLine("EXCEPTION: " + e.Message);
                result = EventResult.MajorFailure;
                throw;
            }
            finally
            {
                AuditHelper.LogOpenStudies(new string[] { this.Name }, loadedInstances, EventSource.CurrentUser, result);
            }
        }
 /// <summary>
 /// Creates an instance of <see cref="StreamingClient"/> to connect to a streaming server.
 /// </summary>
 /// <param name="baseUri">Base Uri to the location where the streaming server is located (eg http://localhost:1000/wado)</param>
 public MINTStreamingClient(Uri baseUri, bool useBulkLoading, MINTBinaryStream binaryStream)
 {
     _baseUri        = baseUri;
     _useBulkLoading = useBulkLoading;
     _binaryStream   = binaryStream;
 }