mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Merge topic 'addMomentsTest'
8a44ea4a9 adapt pixel wrongnes ratio 47441e841 add render test for moments Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kenneth Moreland <morelandkd@ornl.gov> Merge-request: !3070
This commit is contained in:
commit
ddada34223
3
data/baseline/filter/moments.png
Normal file
3
data/baseline/filter/moments.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c077570d0acc5ee81707e1b763e5edbf285af840474d48ab5b051599cb809697
|
||||
size 81863
|
3
data/baseline/filter/moments0.png
Normal file
3
data/baseline/filter/moments0.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4979a7c0e46943bd7a2c94581023c7db12a30ee12bda735b0041c64cff52196
|
||||
size 65438
|
3
data/baseline/filter/moments12.png
Normal file
3
data/baseline/filter/moments12.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cbd7292ca4006866afc2339e39e14a3edf8c5983e04a5ceea80b5d698293fc86
|
||||
size 94505
|
@ -9,13 +9,17 @@
|
||||
##============================================================================
|
||||
|
||||
set(unit_tests
|
||||
RenderTestComputeMoments.cxx
|
||||
UnitTestImageDifferenceFilter.cxx
|
||||
UnitTestImageMedianFilter.cxx
|
||||
)
|
||||
|
||||
set(libraries
|
||||
vtkm_filter_image_processing
|
||||
vtkm_source)
|
||||
vtkm_source
|
||||
vtkm_rendering
|
||||
vtkm_rendering_testing
|
||||
)
|
||||
|
||||
vtkm_unit_tests(
|
||||
SOURCES ${unit_tests}
|
||||
|
@ -0,0 +1,44 @@
|
||||
//============================================================================
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
//
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//============================================================================
|
||||
|
||||
#include <vtkm/filter/image_processing/ComputeMoments.h>
|
||||
#include <vtkm/source/Wavelet.h>
|
||||
|
||||
#include <vtkm/rendering/testing/RenderTest.h>
|
||||
#include <vtkm/rendering/testing/Testing.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
void TestComputeMoments()
|
||||
{
|
||||
vtkm::source::Wavelet source;
|
||||
vtkm::cont::DataSet data = source.Execute();
|
||||
|
||||
vtkm::filter::image_processing::ComputeMoments filter;
|
||||
filter.SetActiveField("RTData");
|
||||
filter.SetOrder(2);
|
||||
filter.SetRadius(2);
|
||||
vtkm::cont::DataSet result = filter.Execute(data);
|
||||
|
||||
vtkm::rendering::testing::RenderTestOptions testOptions;
|
||||
testOptions.AllowedPixelErrorRatio = 0.001f;
|
||||
testOptions.ColorTable = vtkm::cont::ColorTable("inferno");
|
||||
testOptions.EnableAnnotations = false;
|
||||
vtkm::rendering::testing::RenderTest(result, "index", "filter/moments.png", testOptions);
|
||||
vtkm::rendering::testing::RenderTest(result, "index0", "filter/moments0.png", testOptions);
|
||||
vtkm::rendering::testing::RenderTest(result, "index12", "filter/moments12.png", testOptions);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int RenderTestComputeMoments(int argc, char* argv[])
|
||||
{
|
||||
return vtkm::cont::testing::Testing::Run(TestComputeMoments, argc, argv);
|
||||
}
|
@ -9,3 +9,5 @@ PRIVATE_DEPENDS
|
||||
vtkm_worklet
|
||||
TEST_DEPENDS
|
||||
vtkm_source
|
||||
vtkm_rendering
|
||||
vtkm_rendering_testing
|
||||
|
Loading…
Reference in New Issue
Block a user