Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 ============================================================================*/
12 
13 #ifndef mitkToFDebugHelper_h
14 #define mitkToFDebugHelper_h
15 
17 
18 namespace mitk
19 {
21  {
22  public:
23 
24  inline static void ToFDebugHelper::ShowCVDistanceImage(float* distances, unsigned int dimX, unsigned int dimY)
25  {
26  unsigned int* dim = new unsigned int[2];
27  dim[0] = dimX;
28  dim[1] = dimY;
30  image->Initialize(mitk::PixelType(mitk::MakeScalarPixelType<float>()), 2, dim);
31  image->SetSlice(distances);
32 
33  mitk::ImageToOpenCVImageFilter::Pointer filter = mitk::ImageToOpenCVImageFilter::New();
34  filter->SetImage(image);
35  cv::Mat cvImage = filter->GetOpenCVMat();
36  double minVal, maxVal;
37  cv::minMaxLoc(cvImage, &minVal, &maxVal);
38  cv::Mat uCCImage;
39  cvImage.convertTo(uCCImage, CV_8U, 255.0/(maxVal - minVal), -minVal);
40  cv::namedWindow("Debug Image", CV_WINDOW_AUTOSIZE);
41  cv::imshow("Debug Image", uCCImage);
42  cv::waitKey(10000000);
43  }
44  };
45 }
46 
47 #endif
mitk::Image::New
static Pointer New()
mitk::ToFDebugHelper::ShowCVDistanceImage
static void ToFDebugHelper::ShowCVDistanceImage(float *distances, unsigned int dimX, unsigned int dimY)
Definition: mitkToFDebugHelper.h:24
mitkImageToOpenCVImageFilter.h
itk::SmartPointer< Self >
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ImageToOpenCVImageFilter::New
static Pointer New()
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitk::ToFDebugHelper
Definition: mitkToFDebugHelper.h:20