ASL  0.1.7
Advanced Simulation Library
testVTK_IO.cc
Go to the documentation of this file.
1 /*
2  * Advanced Simulation Library <http://asl.org.il>
3  *
4  * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5  *
6  *
7  * This file is part of Advanced Simulation Library (ASL).
8  *
9  * ASL is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU Affero General Public License as
11  * published by the Free Software Foundation, version 3 of the License.
12  *
13  * ASL is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
31 #include "aslGenerators.h"
32 #include "num/aslDataResampling.h"
34 
35 void testMINC()
36 {
37  cout << "Test of MINC files reader..." << endl;
38 
39  auto data(asl::read("subject04_crisp_v.mnc", 0));
40 
41  asl::writeVTKXML("data.vti",
42  *data,
43  "data");
44 }
45 
47 {
48  cout << "Test of MINC files reader +..." << endl;
49 
50  auto data(asl::read("subject04_crisp_v.mnc", 0));
51 
52  asl::DataCoarser dc(data);
53  dc.init();
54  dc.execute();
55  asl::writeVTKXML("dataCoarsed.vti",
56  *dc.getDataOut(),
57  "data");
58 
59 }
60 
62 {
63  cout << "Test of Surface STL files reader..." << endl;
64 
65  // INPUT_DATA_DIR will be expanded by the preprocessor to e.g. "/path/to/dir/"
66  // and the compiler will merge adjacent string literals
67  // alternatively `bus.stl` can be copied to the test directory
68  // by cmake (configure_file() for a configuration time copy or add_custom_command() for a build time copy)
69  auto data(asl::readSurface(INPUT_DATA_DIR "bus.stl", 5));
70 // auto data(asl::readSurface("xx.vtp", .01));
71 
72  asl::writeVTKXML("dataSurfaceSTL.vti",
73  *data,
74  "data");
75 }
76 
77 
78 
79 int main()
80 {
81 // testMINC();
82 // testMINCplus();
84  return 0;
85 }
SPDataWithGhostNodesACLData read(const string &fileName, unsigned int arrayNum, acl::CommandQueue queue=acl::hardware.defaultQueue)
SPDataWithGhostNodesACLData readSurface(const string &fileName, double dx, acl::CommandQueue queue=acl::hardware.defaultQueue)
virtual void execute()
Executes the numerical procedure.
void testMINCplus()
Definition: testVTK_IO.cc:46
int main()
Definition: testVTK_IO.cc:79
Algorithm for generation of coarsed dataset.
void writeVTKXML(const std::string &fileName, const AbstractData &data, const std::string &name)
void testSurfaceSTL()
Definition: testVTK_IO.cc:61
void testMINC()
Definition: testVTK_IO.cc:35
virtual void init()
Builds the necesery internal data and kernels.