Medical Imaging Interaction Toolkit  2018.4.99-07c45cb1
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 (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 ============================================================================*/
13 //#include <mitkImage.h
14 
15 namespace mitk
16 {
18  {
19  public:
20 
21  inline static void ToFDebugHelper::ShowCVDistanceImage(float* distances, unsigned int dimX, unsigned int dimY)
22  {
23  unsigned int* dim = new unsigned int[2];
24  dim[0] = dimX;
25  dim[1] = dimY;
27  image->Initialize(mitk::PixelType(mitk::MakeScalarPixelType<float>()), 2, dim);
28  image->SetSlice(distances);
29 
30  mitk::ImageToOpenCVImageFilter::Pointer filter = mitk::ImageToOpenCVImageFilter::New();
31  filter->SetImage(image);
32  cv::Mat cvImage = filter->GetOpenCVMat();
33  double minVal, maxVal;
34  cv::minMaxLoc(cvImage, &minVal, &maxVal);
35  cv::Mat uCCImage;
36  cvImage.convertTo(uCCImage, CV_8U, 255.0/(maxVal - minVal), -minVal);
37  cv::namedWindow("Debug Image", CV_WINDOW_AUTOSIZE);
38  cv::imshow("Debug Image", uCCImage);
39  cv::waitKey(10000000);
40  }
41  };
42 }
DataCollection - Class to facilitate loading/accessing structured data.
mitk::Image::Pointer image
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:51