Closed marcelvanherk closed 4 years ago
Hi,
python properties are not handled properly, e.g. pydicom dataset.pixel_array returns nil. This is a property that should call a getter. Not sure how to implement it:
lua example:
pyd=python.import('pydicom') dataset = pyd.dcmread(filename) print(dataset.PatientName) --fails plt.imshow{dataset.pixel_array, cmap=plt.cm.bone} -- works python.globals().dataset=dataset plt.imshow{python.eval('dataset.pixel_array'), cmap=plt.cm.bone}
plt.show()
Marcel
Found it: change this: item = PyObject_GetItem(obj->o, key);
into
item = PyObject_GetItem(obj->o, key); if (!item) item = PyObject_GetAttr(obj->o, key);
Fixes it!
Is fixed in the merged version
Hi,
python properties are not handled properly, e.g. pydicom dataset.pixel_array returns nil. This is a property that should call a getter. Not sure how to implement it:
lua example:
pyd=python.import('pydicom') dataset = pyd.dcmread(filename) print(dataset.PatientName) --fails plt.imshow{dataset.pixel_array, cmap=plt.cm.bone} -- works python.globals().dataset=dataset plt.imshow{python.eval('dataset.pixel_array'), cmap=plt.cm.bone}
plt.show()
Marcel