Create a "processing" module ?
Base classes and backends
An increasing number of classes have several backends.
In principle the nabu modules breakdown tries to follow the tomography steps (estimation, pre-processing, phase, reconstruction, stitching). But these classes can be used in any step (ex. fft), so it doesn't fit this scheme.
For now many of these are in nabu.misc
, but the name is unfortunate.
The idea is always the same:
- One base class with common code between backend, and possibly the reference (numpy-based) implementation
- Cuda and OpenCL backend based on this class
In the current state (see below), the different modules/classes are scattered in a not-so-consistent way.
There are at least 2 options:
- Put everything in a common "processing" module, and have
feature.py
,feature_cuda.py
andfeature_opencl.py
- Put only the base classes in "misc", and the backends in other folders:
misc.feature
,cuda.feature
,opencl.feature
. This is roughly the current state. The drawback is that the tests (for all backends) are inmisc
, which sounds weird.
Current state
Padding:
- PaddingBase in misc
- CudaPadding in cuda
- OpenCLPadding in opencl
Histogram
- PartialHistogram in misc
- CudaPartialHistogram in misc
- OpenCLPartialHistogram TBD
Unsharp
- UnsharpMask in misc
- CudaUnsharpMask in misc
- OpenCLUnsharpMask in misc
Rotation
- Rotation in misc
- CudaRotation in misc
- OpenCLRotation TBD
Processing
- ProcessingBase in misc
- CudaProcessing in cuda
- OpenCLProcessing in opencl
Kernel
- KernelBase in misc
- CudaKernel in cuda
- OpenCLKernel in opencl
Convolution
- CudaConvolution in cuda
- OpenclConvolution in silx
MedFilt
- MedianFilter in cuda
- no other backend
Edited by Pierre Paleo