Skip to content
Snippets Groups Projects
Commit 5dd8e75c authored by stefan's avatar stefan
Browse files

Fixed img Tests

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1750 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 11352aec
No related branches found
No related tags found
No related merge requests found
set(IPLT_ALG_UNIT_TESTS
test_circular_mask.cc
test_clear.cc
test_conj.cc
test_convolute.cc
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2010 by the OpenStructure authors
// Copyright (C) 2003-2010 by the IPLT authors
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3.0 of the License, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
/*
Author: Valerio Mariani
*/
#include <iostream>
#include "tests.hh"
#include <ost/img/image.hh>
#include <ost/img/alg/circular_mask.hh>
#include <ost/img/alg/randomize.hh>
namespace {
using namespace ost::img;
using namespace ost::img::alg;
void test()
{
ImageHandle im = CreateImage(Size(400,400),REAL,SPATIAL);
im.ApplyIP(Randomize());
CircularMask cm;
cm.SetMaskCenterOffset(::geom::Vec2(100,100));
cm.SetFillValue(0.0);
im.ApplyIP(cm);
ImageHandle im2 = CreateImage(Size(400,400),REAL,SPATIAL);
im2.ApplyIP(Randomize());
im2.SetSpatialOrigin(Point(100,100));
cm.SetRadius(10);
im2.ApplyIP(cm);
ImageHandle im3 = CreateImage(Size(400,400),REAL,SPATIAL);
im3.ApplyIP(Randomize());
cm.SetMaskCenterOffsetToDefault();
cm.SetRadiusToDefault();
cm.SetFillValueToDefault();
cm.SetSigma(6.0);
im3.ApplyIP(cm);
}
} // ns
test_suite* CreateCircularMaskTest()
{
test_suite* ts=BOOST_TEST_SUITE("Circular Mask Test");
ts->add(BOOST_TEST_CASE(&test));
return ts;
}
......@@ -36,7 +36,6 @@ extern test_suite* CreateMirrorTest();
extern test_suite* CreateTransformTest();
extern test_suite* CreateDiscreteShrinkTest();
extern test_suite* CreateFillTest();
extern test_suite* CreatePeakSearchTest();
extern test_suite* CreateStatTest();
extern test_suite* CreateClearTest();
extern test_suite* CreateFFTTest();
......@@ -49,8 +48,7 @@ bool init_ost_img_alg_unit_tests() {
framework::master_test_suite().add(CreateMirrorTest());
framework::master_test_suite().add(CreateTransformTest());
framework::master_test_suite().add(CreateDiscreteShrinkTest());
framework::master_test_suite().add(CreateFillTest());
framework::master_test_suite().add(CreatePeakSearchTest());
framework::master_test_suite().add(CreateFillTest());
framework::master_test_suite().add(CreateStatTest());
framework::master_test_suite().add(CreateConjugateTest());
framework::master_test_suite().add(CreateClearTest());
......@@ -67,4 +65,4 @@ int main(int argc, char** argv)
{
return boost::unit_test::unit_test_main(init_ost_img_alg_unit_tests,
argc, argv);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment