我正在使用 dcm4chee 作为 PACS 服务器,我正在尝试根据患者姓名检索一项研究。
相关代码为:
ae = AE()
ae.add_requested_context(PatientRootQueryRetrieveInformationModelFind)
ae.add_requested_context(VerificationSOPClass)
assoc = ae.associate(config['pacs_remotehost']['ip'], config['pacs_remotehost']['ports']['DICOM'],ae_title='DCM4CHEE')
if assoc.is_established:
ds = Dataset()
ds.PatientName = '*************' #name erased
ds.QueryRetrieveLevel = 'PATIENT'
ds.StudyInstanceUID = ''
responses = assoc.send_c_find(ds, query_model='P')
for (status, identifier) in responses:
if status:
print('C-FIND query status: 0x{0:04x}'.format(status.Status))
# If the status is 'Pending' then `identifier` is the C-FIND response
if status.Status in (0xFF00, 0xFF01):
print(identifier)
else:
print('Connection timed out, was aborted or received invalid response')
# Release the association
assoc.release()
else:
print('Association rejected, aborted or never connected')
我得到了一个成功的信号:
C-FIND查询状态:0x0000
但是当我想访问像素数据时,我输入了 status.pixel_array 而不是 Numpy 数组,它包含以下错误:
File "<ipython-input-2-c65fb50a50a6>", line 1, in <module>
status.pixel_array File "/usr/local/lib/python2.7/site-packages/pydicom/dataset.py", line 552, in __getattr__
return super(Dataset, self).__getattribute__(name)
File "/usr/local/lib/python2.7/site-packages/pydicom/dataset.py", line 949, in pixel_array
self.convert_pixel_data()
File "/usr/local/lib/python2.7/site-packages/pydicom/dataset.py", line 816, in convert_pixel_data
transfer_syntax = self.file_meta.TransferSyntaxUID
File "/usr/local/lib/python2.7/site-packages/pydicom/dataset.py", line 552, in __getattr__
return super(Dataset, self).__getattribute__(name)
AttributeError: 'Dataset' object has no attribute 'file_meta'
有谁知道为什么我得到这个错误而不是图像?