Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkToFDebugHelper.h
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 ===================================================================*/
17 //#include <mitkImage.h
18 
19 namespace mitk
20 {
22  {
23  public:
24 
25  inline static void ToFDebugHelper::ShowCVDistanceImage(float* distances, unsigned int dimX, unsigned int dimY)
26  {
27  unsigned int* dim = new unsigned int[2];
28  dim[0] = dimX;
29  dim[1] = dimY;
31  image->Initialize(mitk::PixelType(mitk::MakeScalarPixelType<float>()), 2, dim);
32  image->SetSlice(distances);
33 
35  filter->SetImage(image);
36  cv::Mat cvImage = cv::Mat(filter->GetOpenCVImage(), true);
37  double minVal, maxVal;
38  cv::minMaxLoc(cvImage, &minVal, &maxVal);
39  cv::Mat uCCImage;
40  cvImage.convertTo(uCCImage, CV_8U, 255.0/(maxVal - minVal), -minVal);
41  cv::namedWindow("Debug Image", CV_WINDOW_AUTOSIZE);
42  cv::imshow("Debug Image", uCCImage);
43  cv::waitKey(10000000);
44  }
45  };
46 }
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
static Pointer New()
static void ToFDebugHelper::ShowCVDistanceImage(float *distances, unsigned int dimX, unsigned int dimY)
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55