Example #1
0
        public DicomExceptionCode Listen(int port, int peers, DicomNetIpTypeFlags ipType)
        {
            DicomExceptionCode ret = DicomExceptionCode.Success;

            try
            {
                Listen("*", port, peers, ipType);
            }
            catch (DicomException de)
            {
                ret = de.Code;
            }

            return(ret);
        }
Example #2
0
 private void UpdateIpType()
 {
     if (radioButtonIpv4.Checked)
     {
         IpType = DicomNetIpTypeFlags.Ipv4;
     }
     else if (radioButtonIpv6.Checked)
     {
         IpType = DicomNetIpTypeFlags.Ipv6;
     }
     else
     {
         IpType = DicomNetIpTypeFlags.Ipv4OrIpv6;
     }
 }
Example #3
0
        public void Initialize()
        {
            if (System.Net.Sockets.Socket.OSSupportsIPv6)
            {
                radioButtonIpv6.Enabled     = true;
                radioButtonIpv4Ipv6.Enabled = true;
                radioButtonIpv4Ipv6.Enabled = DemosGlobal.IsOnVistaOrLater;
            }
            else
            {
                radioButtonIpv6.Enabled     = false;
                radioButtonIpv4Ipv6.Enabled = false;
                _ipType = DicomNetIpTypeFlags.Ipv4;
            }

            this.ServerSecure.CheckedChanged += ServerSecure_CheckedChanged;
        }
Example #4
0
        private void UpdateIpType()
        {
#if LEADTOOLS_V17_OR_LATER
            if (radioButtonIpv4.Checked)
            {
                IpType = DicomNetIpTypeFlags.Ipv4;
            }
            else if (radioButtonIpv6.Checked)
            {
                IpType = DicomNetIpTypeFlags.Ipv6;
            }
            else
            {
                IpType = DicomNetIpTypeFlags.Ipv4OrIpv6;
            }
#endif
        }
Example #5
0
        /// <summary>
        /// Performs a C-MOVE to move a series.
        /// </summary>
        /// <param name="patientID">Patient ID.</param>
        /// <param name="studyInstance">Study Instance UID.</param>
        /// <param name="seriesInstance">Series Instance UID.</param>
        /// <param name="clientPort">Client port for SCP to connect to.</param>
        public void MoveSeries(DicomServer server, string AETitle, string patientID, string studyInstance,
                               string seriesInstance, int clientPort)
        {
            DicomExceptionCode ret;

            this.patientID      = patientID;
            this.studyInstance  = studyInstance;
            this.seriesInstance = seriesInstance;
            this.clientPort     = clientPort;
            this.ipType         = server.IpType;

            ret = Associate(server, AETitle, new SCUProcessFunc(MoveSeriesProcess));
            if (ret != DicomExceptionCode.Success)
            {
                MessageBox.Show("Error during association: ", ret.ToString());
                return;
            }
        }
Example #6
0
        public DicomServer( )
        {
#if LEADTOOLS_V17_OR_LATER
            _ipType = DicomNetIpTypeFlags.Ipv4;
#endif
        }
Example #7
0
        private void LoadSettings( )
        {
            _mySettings = DicomDemoSettingsManager.LoadSettings(_demoName);
            if (_mySettings == null)
            {
                _mySettings          = new DicomDemoSettings();
                _mySettings.FirstRun = false;
                DicomDemoSettingsManager.SaveSettings(_demoName, _mySettings);
            }

            RegistryKey user     = Registry.CurrentUser;
            RegistryKey settings = user.OpenSubKey(_settingsLocation, true);

            if (settings == null)
            {
                //
                // We haven't saved any setting yet.  Will use the default
                //  settings.
                return;
            }

            _useTls = Convert.ToBoolean(settings.GetValue("UseTls", false));

            if (_useTls)
            {
                if (Utils.VerifyOpensslVersion(this) == false)
                {
                    _useTls = false;
                }
            }

            server.AETitle = Convert.ToString(settings.GetValue("ServerAE"));
            server.Port    = Convert.ToInt32(settings.GetValue("ServerPort", 104));
            string sValue = Convert.ToString(settings.GetValue("ServerIpType"));

            if (string.IsNullOrEmpty(sValue))
            {
                server.IpType = DicomNetIpTypeFlags.Ipv4;
            }
            else
            {
                server.IpType = (DicomNetIpTypeFlags)DemosGlobal.StringToEnum(typeof(DicomNetIpTypeFlags), sValue);
            }
            _ipType        = server.IpType;
            server.Address = IPAddress.Parse(Convert.ToString(settings.GetValue("ServerAddress", "127.0.0.1")));
            server.Timeout = Convert.ToInt32(settings.GetValue("ServerTimeout", 0));

            AETitle                 = Convert.ToString(settings.GetValue("ClientAE"));
            disableLogging          = Convert.ToBoolean(settings.GetValue("DisableLogging"));
            GroupLengthDataElements = Convert.ToBoolean(settings.GetValue("GroupLengthDataElements", false));


            _presentationContextType = Convert.ToInt32(settings.GetValue("PresentationContextType"));
            _cstoreCompressionType   = (DicomImageCompressionType)Enum.Parse(typeof(DicomImageCompressionType), Convert.ToString(settings.GetValue("Compression")));

            if (cstore != null)
            {
                cstore.PresentationContextType = _presentationContextType;
                cstore.Compression             = _cstoreCompressionType;
            }
        }
Example #8
0
        private List <string> ConfigureIpList(DicomNetIpTypeFlags ipType)
        {
            IPAddress[]   addresses               = Dns.GetHostAddresses(Dns.GetHostName());
            List <string> addressesStringList     = new List <string>();
            List <string> addressesIpv4StringList = new List <string>();
            List <string> addressesIpv6StringList = new List <string>();


            foreach (IPAddress address in addresses)
            {
                if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                {
                    addressesIpv4StringList.Add(address.ToString());
                }
                else if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
                {
                    addressesIpv6StringList.Add(address.ToString());
                }
            }

            View.CanIpV6CheckBox   = addressesIpv6StringList.Count > 0;
            View.CanIpBothCheckBox = DemosGlobal.IsOnVistaOrLater && View.CanIpV6CheckBox;

            switch (ipType)
            {
            case DicomNetIpTypeFlags.Ipv4:
                // nothing
                break;

            case DicomNetIpTypeFlags.Ipv6:
                if (!View.CanIpV6CheckBox)
                {
                    ipType = DicomNetIpTypeFlags.Ipv4;
                }
                break;

            case DicomNetIpTypeFlags.Ipv4OrIpv6:
                if (!View.CanIpBothCheckBox)
                {
                    ipType = DicomNetIpTypeFlags.Ipv4;
                }
                break;
            }

            addressesStringList.Clear();
            addressesStringList.Add("All");

            if ((ipType & DicomNetIpTypeFlags.Ipv4) == DicomNetIpTypeFlags.Ipv4)
            {
                foreach (string s in addressesIpv4StringList)
                {
                    if (s != "0.0.0.0")
                    {
                        addressesStringList.Add(s);
                    }
                }
            }

            if ((ipType & DicomNetIpTypeFlags.Ipv6) == DicomNetIpTypeFlags.Ipv6)
            {
                foreach (string s in addressesIpv6StringList)
                {
                    {
                        addressesStringList.Add(s);
                    }
                }
            }
            View.SetIpAddressList(addressesStringList.ToArray());
            View.IpType = ipType;
            return(addressesStringList);
        }
Example #9
0
 public DicomServer( )
 {
     _ipType = DicomNetIpTypeFlags.Ipv4;
 }