diff --git a/Modules/Numerics/Statistics/include/itkKdTreeGenerator.h b/Modules/Numerics/Statistics/include/itkKdTreeGenerator.h index d05845df88f..f09db35059c 100644 --- a/Modules/Numerics/Statistics/include/itkKdTreeGenerator.h +++ b/Modules/Numerics/Statistics/include/itkKdTreeGenerator.h @@ -110,14 +110,16 @@ class ITK_TEMPLATE_EXPORT KdTreeGenerator : public Object /** Typedef for the smart pointer to the Subsample */ using SubsamplePointer = typename SubsampleType::Pointer; - /** Sets the input sample that provides the measurement vectors. */ + /** Set/Get the input sample that provides the measurement vectors. */ void SetSample(TSample * sample); + itkGetConstMacro(SourceSample, TSample *); /** Sets the number of measurement vectors that can be stored in a * terminal node. */ void SetBucketSize(unsigned int size); + itkGetConstMacro(BucketSize, unsigned int); /** Returns the pointer to the generated k-d tree. */ OutputPointer diff --git a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx index 06fa660e725..b8aa9f45e7d 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx @@ -49,7 +49,12 @@ itkKdTreeGeneratorTest(int, char *[]) treeGenerator->SetSample(sample); - treeGenerator->SetBucketSize(16); + ITK_TEST_SET_GET_VALUE(sample, treeGenerator->GetSourceSample()); + + unsigned int bucketSize = 16; + treeGenerator->SetBucketSize(bucketSize); + ITK_TEST_SET_GET_VALUE(bucketSize, treeGenerator->GetBucketSize()); + treeGenerator->Update(); using TreeType = TreeGeneratorType::KdTreeType;