add filters in python bindings

This commit is contained in:
AndreaRigoni
2026-03-05 15:03:19 +00:00
parent 42db99759f
commit 554eff9b55
8 changed files with 269 additions and 8 deletions

View File

@@ -90,7 +90,8 @@ struct Voxel {
} // namespace Interface
struct Voxel {
Scalarf Value;
Scalarf Value = 0.0f;
Scalari Count = 0;
};
////////////////////////////////////////////////////////////////////////////////

View File

@@ -36,7 +36,7 @@
namespace uLib {
#ifdef USE_CUDA
#if defined(USE_CUDA) && defined(__CUDACC__)
template <typename VoxelT>
__global__ void ABTrimFilterKernel(const VoxelT *in, VoxelT *out,
const VoxelT *kernel, int vox_size,
@@ -108,7 +108,7 @@ public:
mBtrim = 0;
}
#ifdef USE_CUDA
#if defined(USE_CUDA) && defined(__CUDACC__)
void Run() {
if (this->m_Image->Data().GetDevice() == MemoryDevice::VRAM ||
this->m_KernelData.Data().GetDevice() == MemoryDevice::VRAM) {
@@ -206,7 +206,7 @@ public:
mBtrim = 0;
}
#ifdef USE_CUDA
#if defined(USE_CUDA) && defined(__CUDACC__)
void Run() {
if (this->m_Image->Data().GetDevice() == MemoryDevice::VRAM ||
this->m_KernelData.Data().GetDevice() == MemoryDevice::VRAM) {

View File

@@ -36,7 +36,7 @@
namespace uLib {
#ifdef USE_CUDA
#if defined(USE_CUDA) && defined(__CUDACC__)
template <typename VoxelT>
__global__ void LinearFilterKernel(const VoxelT *in, VoxelT *out,
const VoxelT *kernel, int vox_size,
@@ -66,7 +66,7 @@ public:
typedef VoxImageFilter<VoxelT, VoxFilterAlgorithmLinear<VoxelT>> BaseClass;
VoxFilterAlgorithmLinear(const Vector3i &size) : BaseClass(size) {}
#ifdef USE_CUDA
#if defined(USE_CUDA) && defined(__CUDACC__)
void Run() {
if (this->m_Image->Data().GetDevice() == MemoryDevice::VRAM ||
this->m_KernelData.Data().GetDevice() == MemoryDevice::VRAM) {