MCPcopy Create free account
hub / github.com/astra-toolbox/astra-toolbox / getDLTensor

Function getDLTensor

python/astra/src/dlpack.cpp:248–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248astra::CFloat32VolumeData2D* getDLTensor(PyObject *obj, const astra::CVolumeGeometry2D &pGeom, std::string &error)
249{
250 if (!PyCapsule_CheckExact(obj))
251 return nullptr;
252
253 // x,y,z
254 std::array<int, 2> dims{pGeom.getGridColCount(), pGeom.getGridRowCount()};
255
256 astra::CDataStorage *storage = getDLTensorStorage(obj, dims, error);
257 if (!storage)
258 return nullptr;
259
260 return new astra::CFloat32VolumeData2D(pGeom, storage);
261}
262astra::CFloat32ProjectionData2D* getDLTensor(PyObject *obj, const astra::CProjectionGeometry2D &pGeom, std::string &error)
263{
264 if (!PyCapsule_CheckExact(obj))

Callers

nothing calls this directly

Calls 9

getDLTensorStorageFunction · 0.85
getDetectorCountMethod · 0.80
getGridSliceCountMethod · 0.80
getDetectorColCountMethod · 0.80
getProjectionCountMethod · 0.80
getDetectorRowCountMethod · 0.80
getGridColCountMethod · 0.45
getGridRowCountMethod · 0.45

Tested by

no test coverage detected