Пример #1
0
 public void ClearMessages(DicomThread dicomThread)
 {
     lock(lockObject)
     {
         dicomThread.Messages.Clear();
     }
 }
Пример #2
0
        public override void AssociationReleasedEventHandler(DicomThread worklistScp)
        {
            // do SCP specific post association processing here

            // call base implementation to generate event, update transaction log and cleanup data warehouse
            base.AssociationReleasedEventHandler(worklistScp);
        }
Пример #3
0
 internal void AddMessage(DicomThread dicomThread, DicomProtocolMessage message)
 {
     lock(lockObject)
     {
         dicomThread.Messages.Add(message);
         globalMessages.Add(message);
     }
 }
Пример #4
0
 public void Validate(DicomThread dicomThread, DicomProtocolMessage dicomProtocolMessage)
 {
     if (dicomProtocolMessage is DulMessage)
     {
         Validate(dicomThread, dicomProtocolMessage as DulMessage);
     }
     else
     {
         Validate(dicomThread, dicomProtocolMessage as DicomMessage);
     }
 }
Пример #5
0
        public DicomProtocolMessageCollection Messages(DicomThread dicomThread)
        {
            DicomProtocolMessageCollection dicomProtocolMessageCollection = new DicomProtocolMessageCollection();

            lock(lockObject)
            {
                foreach(DicomProtocolMessage dicomProtocolMessage in dicomThread.Messages)
                {
                    dicomProtocolMessageCollection.Add(dicomProtocolMessage);
                }
            }

            return(dicomProtocolMessageCollection);
        }
Пример #6
0
        public void Validate(DicomThread dicomThread, DicomMessage dicomMessage1, DicomMessage dicomMessage2)
        {
            this.thread.WriteInformationInternal("Validate Dicom message...");

            Dvtk.Sessions.ValidationControlFlags validationFlags = Dvtk.Sessions.ValidationControlFlags.None;

            // Determine if the VR's need to be validated.
            validationFlags |= ValidateValueRepresentations(dicomMessage1);

            // Determine if the DicomMessage can or needs to be validated against a definition file.
            validationFlags |= ValidateUseDefinitions(dicomThread, dicomMessage1);

            this.thread.WriteInformationInternal("- Using reference Dicom message.");
            dicomThread.DvtkScriptSession.Validate(dicomMessage1.DvtkDataDicomMessage, dicomMessage2.DvtkDataDicomMessage, validationFlags | Dvtk.Sessions.ValidationControlFlags.UseReferences);
        }
Пример #7
0
        public void Read(String fullFileName, DicomThread dicomThread)
        {
            DvtkData.Media.DicomFile dvtkDataDicomFile = null;

            if (!File.Exists(fullFileName))
            {
                throw new HliException("Dicom file or raw file \"" + fullFileName + "\" not found.");
            }

            dvtkDataDicomFile = dicomThread.DvtkScriptSession.ReadFile(fullFileName);

            this.dataSet.DvtkDataDataSet = dvtkDataDicomFile.DataSet;
            this.fileMetaInformation.DvtkDataFileMetaInformation = dvtkDataDicomFile.FileMetaInformation;
            this.dvtkDataFileHead = dvtkDataDicomFile.FileHead;
        }
Пример #8
0
        public override void AssociationReleasedEventHandler(DicomThread storageCommitScp)
        {
            // do SCP specific post association processing here
            // iterate over all the dicomMessages in the data warehouse
            foreach (DicomMessage dicomMessage in storageCommitScp.DataWarehouse.Messages(storageCommitScp).DicomMessages)
            {
                // check for the N-ACTION-RQ
                if (dicomMessage.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.NACTIONRQ)
                {
                    // produce a DICOM trigger for the Storage Commitment SCU - N-EVENT-REPORT-RQ
                    DicomTrigger storageCommitTrigger = GenerateTrigger(dicomMessage);
                    ParentActor.TriggerActor(ActorName, storageCommitTrigger);
                }
            }

            // call base implementation to generate event, update transaction log and cleanup data warehouse
            base.AssociationReleasedEventHandler(storageCommitScp);
        }
Пример #9
0
        /// <summary>
        /// Validate the Dicom Message by inspecting the VR's.
        /// </summary>
        /// <param name="dicomMessage">The Dicom Message.</param>
        public void Validate(DicomThread dicomThread, DicomMessage dicomMessage)
        {
            this.thread.WriteInformationInternal("Validate Dicom message...");

            Dvtk.Sessions.ValidationControlFlags validationFlags = Dvtk.Sessions.ValidationControlFlags.None;

            // Determine if the VR's need to be validated.
            validationFlags |= ValidateValueRepresentations(dicomMessage);

            // Determine if the DicomMessage can or needs to be validated against a definition file.
            validationFlags |= ValidateUseDefinitions(dicomThread, dicomMessage);

            // If validation is needed, do it now.
            if (validationFlags != Dvtk.Sessions.ValidationControlFlags.None)
            {
                dicomThread.DvtkScriptSession.Validate(dicomMessage.DvtkDataDicomMessage, null, validationFlags);
            }
            else
            {
                dicomThread.WriteInformationInternal("No validation performed.");
            }
        }
Пример #10
0
 // !!!! Duidelijk maken dat onderstaande event wordt geraised vanwege childs.
 private void HandleChildAssociationReleasedEvent(DicomThread dicomThread)
 {
     TriggerAssociationReleasedEvent(dicomThread);
 }
Пример #11
0
        public virtual void AssociationReleasedEventHandler(DicomThread dicomThread)
        {
            DicomTransaction transaction = new DicomTransaction(TransactionNameEnum.RAD_10, TransactionDirectionEnum.TransactionReceived);

            foreach (DicomMessage dicomMessage in dicomThread.DataWarehouse.Messages(dicomThread).DicomMessages)
            {
                transaction.DicomMessages.Add(dicomMessage);
            }

            // publish the transaction event to any interested parties
            PublishEvent(ActorName, transaction);

            // get the next transaction number - needed to sort the
            // transactions correctly
            int transactionNumber = TransactionNumber.GetNextTransactionNumber();

            // save the transaction
            ActorsTransaction actorsTransaction = new ActorsTransaction(transactionNumber,
                                                                        ParentActor.ActorName,
                                                                        ActorName,
                                                                        transaction,
                                                                        dicomThread.ResultsFileName,
                                                                        dicomThread.NrOfErrors,
                                                                        dicomThread.NrOfWarnings);
            ParentActor.ActorsTransactionLog.Add(actorsTransaction);

            dicomThread.DataWarehouse.ClearMessages(dicomThread);
        }
Пример #12
0
 protected void TriggerAssociationReleasedEvent(DicomThread dicomThread)
 {
     if (AssociationReleasedEvent != null)
     {
         AssociationReleasedEvent(dicomThread);
     }
 }
Пример #13
0
        private Dvtk.Sessions.ValidationControlFlags ValidateUseDefinitions(DicomThread dicomThread, DicomMessage dicomMessage)
        {
            Dvtk.Sessions.ValidationControlFlags validationFlag = Dvtk.Sessions.ValidationControlFlags.None;

            String iodName = dicomThread.GetIodNameFromDefinition(dicomMessage);

            if (iodName.Length == 0)
            {
                this.thread.WriteWarningInternal("- Skipping definition file validation: unable to find correct definition file for DimseCommand " + dicomMessage.CommandSet.DimseCommand.ToString() + " and SOP Class UID " + dicomMessage.CommandSet.GetSopClassUid() + ".  Are the correct definition files loaded?");
            }
            else
            {
                if (dicomMessage.IodNamesValidatedAgainst.Contains(iodName))
                {
                    this.thread.WriteInformationInternal("- Skipping definition file validation: already performed for \"" + iodName + "\".");
                }
                else
                {
                    dicomMessage.DataSet.IodId = iodName;
                    dicomMessage.IodNamesValidatedAgainst.Add(iodName);
                    validationFlag = Dvtk.Sessions.ValidationControlFlags.UseDefinitions;
                    this.thread.WriteInformationInternal("- Using \"" + iodName + "\" for definition file validation.");
                }
            }

            return(validationFlag);
        }
Пример #14
0
        /// <summary>
        /// Validate the Dul Message by inspecting the VR's and the definition.
        /// </summary>
        /// <param name="dulMessage">The Dul Message.</param>
        public void Validate(DicomThread dicomThread, DulMessage dulMessage)
        {
            this.thread.WriteInformationInternal("Validate Dul message...");

            if (!dulMessage.AreValueRepresentationsValidated)
            {
                dicomThread.DvtkScriptSession.Validate(dulMessage.DvtkDataDulMessage, null, Dvtk.Sessions.ValidationControlFlags.UseValueRepresentations);
                dulMessage.AreValueRepresentationsValidated = true;
            }
            else
            {
                dicomThread.WriteInformationInternal("VR's of DulMessage will not be validated again.\r\nNo validation performed.");
            }
        }
Пример #15
0
 public DicomThreadOptions(DicomThread dicomThread)
 {
     this.dicomThread = dicomThread;
 }