InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

PointFeature (FPFH) does not honor ITK filter/pipeline semantics

Open
#6,359 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

The `itk::PointFeature` filter (FPFH descriptors), ingested into `Modules/Registration/FPFH`, does not follow ITK's filter/pipeline conventions. It works only when its compute method is called manually, which is surprising for a class deriving from `MeshToMeshFilter`.

This is filed as a follow-up to the FPFH ingest so the ingest itself stays a faithful import; the redesign should be evaluated separately.

Specifics

- `GenerateData()` is effectively a no-op: it checks the input point count and returns without computing anything or setting the output. Calling `Update()` therefore produces no FPFH output.
- The algorithm parameters `radius` and `neighbors` are not pipeline parameters (no `Set`/`Get` macros, not part of the `Modified()`/`GetMTime()` machinery). They are passed only as arguments to the public `ComputeFPFHFeature(input, normals, radius, neighbors)` method.
- The result is exposed via `GetFpfhFeature()`, which returns null until `ComputeFPFHFeature()` has been called manually.
- Input normals are supplied as a second `PointSet` whose point *positions* are the normal vectors, rather than via point data.

### Suggested direction (to be evaluated)

- Add `itkSetMacro`/`itkGetMacro` for `Radius` and `NeighborCount` (or `itkSetGetDecoratedInput` for the normals point set).
- Move the body of `ComputeFPFHFeature()`/`ComputeSPFHFeature()` into `GenerateData()` and emit the descriptors as the filter output (or a decorated output), so `Update()` works.
- Consider enforcing 3-D input (`static_assert(InputDimension == 3)` or a concept check), since `ComputePairFeatures` hardcodes three components.
- Validate that `input_normals` has at least as many points as `input` before indexing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.