Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkRegistrationBaseTest.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkImage.h"
18 #include "mitkRegistrationBase.h"
19 
20 int mitkRegistrationBaseTest(int /*argc*/, char * /*argv*/ [])
21 {
22  // Create Image out of nowhere
24  mitk::PixelType pt(typeid(int));
25  unsigned int dim[] = {100, 100, 20};
26 
27  std::cout << "Creating image: ";
28  image = mitk::Image::New();
29  // image->DebugOn();
30  image->Initialize(mitk::PixelType(typeid(int)), 3, dim);
31  int *p = (int *)image->GetData();
32 
33  int size = dim[0] * dim[1] * dim[2];
34  int i;
35  for (i = 0; i < size; ++i, ++p)
36  *p = i;
37  std::cout << "[PASSED]" << std::endl;
38 
39  std::cout << "Constructor: ";
41  std::cout << "[PASSED]" << std::endl;
42 
43  std::cout << "Set Reference Image: ";
44  registrationBase->SetReferenceImage(image);
45  std::cout << "[PASSED]" << std::endl;
46 
47  return EXIT_SUCCESS;
48 }
int mitkRegistrationBaseTest(int, char *[])
static Pointer New()
static Pointer New()
Method for creation through the object factory.
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55