1
/*=========================================================================
3
* Copyright Insight Software Consortium
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0.txt
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
17
*=========================================================================*/
20
#include <SimpleITKTestHarness.h>
21
#include <SimpleITK.h>
24
namespace sitk = itk::simple;
26
DataFinder dataFinder;
28
int main (int argc, char *argv[])
33
std::cout << "Starting sitkShowTest\n";
37
for (int i=1; i<argc; i++)
41
std::cout << "Reading " << argv[i] << std::endl;
42
img = sitk::ReadImage( argv[i] );
43
std::cout << "Showing " << argv[i] << std::endl;
46
catch (std::exception &e)
48
std::cout << "Exception: " << e.what() << std::endl;
53
std::cout << "Default exception\n";
63
std::cout << "Read 1\n";
64
img = sitk::ReadImage( dataFinder.GetFile ( "Input/RA-Float.nrrd" ) );
65
std::cout << "Show 1\n";
68
catch (std::exception &e)
70
std::cout << "Exception: " << e.what() << std::endl;
75
std::cout << "Default exception\n";
82
std::cout << "Read 2\n";
83
img = sitk::ReadImage( dataFinder.GetFile ( "Input/VM1111Shrink-RGB.png" ) );
84
std::cout << "Show 2\n";
87
catch (std::exception &e)
89
std::cout << "Exception: " << e.what() << std::endl;
94
std::cout << "Default exception\n";
100
std::cout << "Read 3\n";
101
img = sitk::ReadImage( dataFinder.GetFile ( "Input/cthead1-Float.mha" ) );
102
std::cout << "Show 3\n";
103
sitk::Show(img, "Dave was here", true);
105
catch (std::exception &e)
107
std::cout << "Exception: " << e.what() << std::endl;
112
std::cout << "Default exception\n";