Medical Imaging Interaction Toolkit  2018.4.99-ef453c4b
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkImage.h"
14 #include "mitkRegistrationBase.h"
15 
16 int mitkRegistrationBaseTest(int /*argc*/, char * /*argv*/ [])
17 {
18  // Create Image out of nowhere
20  mitk::PixelType pt(typeid(int));
21  unsigned int dim[] = {100, 100, 20};
22 
23  std::cout << "Creating image: ";
24  image = mitk::Image::New();
25  // image->DebugOn();
26  image->Initialize(mitk::PixelType(typeid(int)), 3, dim);
27  int *p = (int *)image->GetData();
28 
29  int size = dim[0] * dim[1] * dim[2];
30  int i;
31  for (i = 0; i < size; ++i, ++p)
32  *p = i;
33  std::cout << "[PASSED]" << std::endl;
34 
35  std::cout << "Constructor: ";
36  mitk::RegistrationBase::Pointer registrationBase = mitk::RegistrationBase::New();
37  std::cout << "[PASSED]" << std::endl;
38 
39  std::cout << "Set Reference Image: ";
40  registrationBase->SetReferenceImage(image);
41  std::cout << "[PASSED]" << std::endl;
42 
43  return EXIT_SUCCESS;
44 }
int mitkRegistrationBaseTest(int, char *[])
mitk::Image::Pointer image
static Pointer New()
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51