Exemplo n.º 1
0
        private bool SendImage(ApplicationEntity host, string path)
        {
            bool result = true;

            try
            {
                DataSet dicom = new DataSet();
                dicom.Read(path);

                string            uid     = (string)dicom[t.SOPClassUID].Value;
                StorageServiceSCU storage = new StorageServiceSCU(uid);
                storage.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

                Association association = new Association();
                association.AddService(storage);

                if (association.Open(host))
                {
                    if (storage.Active)
                    {
                        try
                        {
                            storage.Store(dicom);
                        }
                        catch (Exception ex)
                        {
                            result = false;
                            Debug.WriteLine(ex.Message);
                        }
                    }
                }
                else
                {
                    result = false;
                    //Debug.WriteLine("\ncan't Open.");
                }

                association.Close();
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 2
0
 public StorageServiceSCU(StorageServiceSCU other)
     : base(other)
 {
 }