Beispiel #1
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        public HliScp()
        {
            // set up the default transfer syntax support
            _transferSyntaxes = new TransferSyntaxes(IMPLICIT_VR_LITTLE_ENDIAN,
                                                     EXPLICIT_VR_LITTLE_ENDIAN,
                                                     EXPLICIT_VR_BIG_ENDIAN);

            // set up the default sop class support
            _sopClasses = new SopClasses(VERIFICATION_SOP_CLASS_UID);
        }
Beispiel #2
0
        /// <summary>
        /// Add a single sop class to the list.
        /// </summary>
        /// <param name="sopClass">Sop Class UID.</param>
        public void AddSopClass(System.String sopClass)
        {
            // first check if the class has been instantiated
            if (_sopClasses == null)
            {
                _sopClasses = new SopClasses();
            }

            // Add the transfer syntax
            _sopClasses.Add(sopClass);
        }
Beispiel #3
0
 /// <summary>
 /// Selected SOP Classes
 /// </summary>
 public void setSupportedSopClasses(ArrayList list)
 {
     sopClasses = new SopClasses((System.String[])list.ToArray(typeof(System.String)));
 }
Beispiel #4
0
        /// <summary>
        /// Creates presentation contexts to be used in an A-ASSOCIATE-AC that are based on the
        /// presentation contexts of this instance.
        /// </summary>
        /// <remarks>
        /// The following holds for the returned presentation contexts:<br></br>
        /// - All requested presentation contexts with an abstract syntax not contained in the supplied
        ///   SOP classes will be rejected (have result field 3).<br></br>
        /// - For each other requested presentation contex that has an abstract syntax contained in
        ///   the supplied SOP classes, do the following:<br></br>
        ///   1)<br></br>
        ///   Check if one or more of the requested transfer syntaxes is present in the first supplied
        ///   TransferSyntaxes instance. If this is the case, use the requested transfer syntax that is
        ///   requested before the other ones in the accepted presentation context counterpart (has
        ///   result field 0).<br></br>
        ///   2)<br></br>
        ///   If no requested transfer syntaxes was present, try this with the second supplied
        ///   TransferSyntaxes instance.<br></br>
        ///   3) If no requested transfer syntaxes was present is in any supplied TransferSyntaxes
        ///   instance, reject the presentation context with result 4.<br></br>
        ///
        ///   Note that a difference exists between supplying one TransferSyntaxes instance with all
        ///   transfer syntaxes to accept and supplying multiple TransferSyntaxes instances each containing
        ///   only one transfer syntax. In the first case, the preference (order of proposed transfer
        ///   syntaxes) of the SCU will be used, in the second case the preference of the caller of this
        ///   method will be used.
        /// </remarks>
        /// <param name="sopClasses">The SOP Classes to accept.</param>
        /// <param name="transferSyntaxesList">The transfer syntaxes to accept.</param>
        /// <returns>The created presentation contexts.</returns>
        public PresentationContextCollection CreatePresentationContextsForAssociateAc(SopClasses sopClasses, params TransferSyntaxes[] transferSyntaxesList)
        {
            PresentationContextCollection presentationContextsForAssociateAc = new PresentationContextCollection();

            PresentationContextCollection presentationContexts = PresentationContexts;

            foreach (PresentationContext presentationContextInAssociateRq in presentationContexts)
            {
                String abstractSyntaxInAssociateRq = presentationContextInAssociateRq.AbstractSyntax;

                PresentationContext presentationContextForAssociateAc = null;

                if (sopClasses.List.Contains(abstractSyntaxInAssociateRq))
                {
                    String transferSyntaxForAssociateAc = DetermineTransferSyntaxToAccept
                                                              (presentationContextInAssociateRq.TransferSyntaxes,
                                                              transferSyntaxesList);

                    if (transferSyntaxForAssociateAc.Length == 0)
                    {
                        presentationContextForAssociateAc = new PresentationContext
                                                                (presentationContextInAssociateRq.AbstractSyntax,
                                                                4,
                                                                "");
                    }
                    else
                    {
                        presentationContextForAssociateAc = new PresentationContext
                                                                (presentationContextInAssociateRq.AbstractSyntax,
                                                                0,
                                                                transferSyntaxForAssociateAc);
                    }
                }
                else
                {
                    presentationContextForAssociateAc = new PresentationContext
                                                            (presentationContextInAssociateRq.AbstractSyntax,
                                                            3,
                                                            "");
                }

                presentationContextForAssociateAc.SetId(presentationContextInAssociateRq.ID);

                presentationContextsForAssociateAc.Add(presentationContextForAssociateAc);
            }

            return(presentationContextsForAssociateAc);
        }
Beispiel #5
0
        /// <summary>
        /// Creates presentation contexts to be used in an A-ASSOCIATE-AC that are based on the
        /// presentation contexts of this instance.
        /// </summary>
        /// <remarks>
        /// The following holds for the returned presentation contexts:
        /// - All requested presentation contexts with an abstract syntax contained in the supplied
        ///   SOP classes will be accepted (have result field 0). The rest will be rejected
        ///   (have result field 3).
        /// - For each accepted requested presentation context, the first proposed transfer syntax
        ///   will be used.
        /// </remarks>
        /// <param name="sopClasses">The SOP Classes to accept.</param>
        /// <returns>The created presentation contexts.</returns>
        public PresentationContextCollection CreatePresentationContextsForAssociateAc(SopClasses sopClasses)
        {
            PresentationContextCollection presentationContextsForAssociateAc = new PresentationContextCollection();

            PresentationContextCollection presentationContexts = PresentationContexts;

            foreach (PresentationContext presentationContextInAssociateRq in presentationContexts)
            {
                String abstractSyntaxInAssociateRq = presentationContextInAssociateRq.AbstractSyntax;

                PresentationContext presentationContextForAssociateAc = null;

                if (sopClasses.List.Contains(abstractSyntaxInAssociateRq))
                {
                    presentationContextForAssociateAc = new PresentationContext
                                                            (presentationContextInAssociateRq.AbstractSyntax,
                                                            0,
                                                            presentationContextInAssociateRq.TransferSyntaxes[0]);
                }
                else
                {
                    presentationContextForAssociateAc = new PresentationContext
                                                            (presentationContextInAssociateRq.AbstractSyntax,
                                                            3,
                                                            "");
                }

                presentationContextForAssociateAc.SetId(presentationContextInAssociateRq.ID);

                presentationContextsForAssociateAc.Add(presentationContextForAssociateAc);
            }

            return(presentationContextsForAssociateAc);
        }
Beispiel #6
0
 /// <summary>
 /// Clear the current sop class list - reset contents to empty.
 /// </summary>
 public void ClearSopClasses()
 {
     _sopClasses = null;
 }