fw4spl
tests/fwTest/include/fwTest/generator/Image.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWTEST_GENERATOR_IMAGE_HPP__
8 #define __FWTEST_GENERATOR_IMAGE_HPP__
9 
10 #include "fwTest/config.hpp"
11 
12 #include <fwCore/base.hpp>
13 
14 #include <fwData/Image.hpp>
15 
16 #include <fwDataTools/helper/Array.hpp>
17 
18 #include <fwMath/Compare.hpp>
19 
20 #include <fwTools/Type.hpp>
21 
22 
23 namespace fwTest
24 {
25 namespace generator
26 {
27 
28 
32 class Image
33 {
34 
35 public:
36 
40  FWTEST_API static void initRand();
41 
50  FWTEST_API static void generateImage(::fwData::Image::sptr image,
52  std::vector<double> spacing,
53  std::vector<double> origin,
54  ::fwTools::Type type);
55 
57  FWTEST_API static void generateRandomImage(::fwData::Image::sptr image, ::fwTools::Type type);
58 
60  FWTEST_API static void randomizeArray(::fwData::Array::sptr array);
61 
63  FWTEST_API static ::fwData::Array::sptr createRandomizedArray(const std::string& type,
64  ::fwData::Array::SizeType sizes);
65 
66 };
67 
68 } // namespace generator
69 } // namespace fwTest
70 
71 #endif // __FWTEST_GENERATOR_IMAGE_HPP__
std::vector< size_t > SizeType
Array size type.
static FWTEST_API void generateRandomImage(::fwData::Image::sptr image,::fwTools::Type type)
Generate an image with random information (size, spacing, ...). Buffer is filled with random values...
static FWTEST_API void randomizeArray(::fwData::Array::sptr array)
Fill array with random value.
static FWTEST_API void initRand()
Initialize &#39;rand&#39; seed.
static FWTEST_API void generateImage(::fwData::Image::sptr image,::fwData::Image::SizeType size, std::vector< double > spacing, std::vector< double > origin,::fwTools::Type type)
Generate an image with the given informations. Buffer is filled with 0.
Definition: Data.hpp:15
Class describing an elementary C++ type aka unsigned char, signed char, .... int, float...
Definition: Type.hpp:32
static FWTEST_API::fwData::Array::sptr createRandomizedArray(const std::string &type,::fwData::Array::SizeType sizes)
Creates an Array with the given type and size and fills buffer with random values.
This class contains helper to generate images.
::fwData::Array::SizeType SizeType
Image size type.