我得到了SCU和SCP之间的DICOM服务器和图像通信的诀窍。我正在使用一个ClearCanas PACS服务器,并且可以访问webgui。使用以下代码,我可以将DICOM dt从SCU(我的计算机)发送到SCP(远程服务器)import sys
import argparse
from netdicom import AE
from netdicom.SOPclass import StorageSOPClass, VerificationSOPClass
from dicom.UID import ExplicitVRLittleEndian, ImplicitVRLittleEndian, \
ExplicitVRBigEndian
from dicom import read_file
# parse commandline
parser = argparse.ArgumentParser(description='storage SCU example')
parser.add_argument('remotehost')
parser.add_argument('remoteport', type=int)
parser.add_argument('file', nargs='+')
parser.add_argument('-aet', help='calling AE title', default='PYNETDICOM')
parser.add_argument('-aec', help='called AE title', default='REMOTESCU')
parser.add_argument('-implicit', action='store_true',
help='negociate implicit transfer syntax only',
default=False)
parser.add_argument('-explicit', action='store_true',
help='negociate explicit transfer syntax only',
default=False)
args = parser.parse_args()
if args.implicit:
ts = [ImplicitVRLittleEndian]
elif args.explicit:
ts = [ExplicitVRLittleEndian]
else:
ts = [
ExplicitVRLittleEndian,
ImplicitVRLittleEndian,
ExplicitVRBigEndian
]
# call back
def OnAssociateResponse(association):
print "Association response received"
# create application entity
MyAE = AE(args.aet, 0, [StorageSOPClass, VerificationSOPClass], [], ts)
MyAE.OnAssociateResponse = OnAssociateResponse
# remote application entity
RemoteAE = dict(Address=args.remotehost, Port=args.remoteport, AET=args.aec)
# create association with remote AE
print "Request association"
assoc = MyAE.RequestAssociation(RemoteAE)
if not assoc:
print "Could not establish association"
sys.exit(1)
# perform a DICOM ECHO, just to make sure remote AE is listening
print "DICOM Echo ... ",
st = assoc.VerificationSOPClass.SCU(1)
print 'done with status "%s"' % st
# create some dataset
for ii in args.file:
print ii
d = read_file(ii)
print "DICOM StoreSCU ... ",
try:
st = assoc.SCU(d, 1)
print 'done with status "%s"' % st
except:
raise
print "problem", d.SOPClassUID
print "Release association"
assoc.Release(0)
# done
MyAE.Quit
我的问题是,有没有一种方法可以将对象远程发送到服务器上的不同目录/make目录,并将数据发送到不同的目录?在