HBP: offer the same interface as FBP
For now in chunked.py
, there is this brittle cases distinction
if options["method"] == "GHBP":
for i in range(self.n_slices):
self._tmp_sino[:] = self.radios[:, i, :] # copy into contiguous array
self.reconstruction.sino_filter.filter_sino(self._tmp_sino, output=self._tmp_sino)
self.reconstruction_hbp.backprojection(self._tmp_sino, output=self.recs[i])
else: # FBP
for i in range(self.n_slices):
self._tmp_sino[:] = self.radios[:, i, :] # copy into contiguous array
self.reconstruction.fbp(self._tmp_sino, output=self.recs[i])
In principle, a certain care is taken so that all the processing classes have a common interface, so that they can be exchanged in the pipeline.
Ideally, the above code should simplify as
for i in range(self.n_slices):
self._tmp_sino[:] = self.radios[:, i, :] # copy into contiguous array
self.reconstruction(self._tmp_sino, output=self.recs[i]) # self.reconstruction is either a Backprojector or GeneralizedHierarchicalBackprojector instance, with an entry point
This entails to do the following:
- Update
GeneralisedHierarchicalBackprojector
so that it has the same interface (up to additional specialized kwargs) asBackprojector
. It does not have to inherit fromBackprojector
. - Update
GeneralisedHierarchicalBackprojector
so that it also has the sinogram filtering (by composition, optionally) - Update
GeneralisedHierarchicalBackprojector
to have an entry point - Update
Backprojector
to have an entry point