Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkContourUtils.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 mitkContourUtils_h
14 #define mitkContourUtils_h
15 
16 #include "mitkContour.h"
17 #include "mitkContourModel.h"
18 #include "mitkImage.h"
20 
21 namespace mitk
22 {
29  class MITKSEGMENTATION_EXPORT ContourUtils : public itk::Object
30  {
31  public:
33  itkFactorylessNewMacro(Self);
34  itkCloneMacro(Self);
35 
42  ContourModel::Pointer ProjectContourTo2DSlice(Image *slice,
43  Contour *contourIn3D);
44 
51  ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
52  Contour *contourIn2D);
53 
57  void FillContourInSlice(Contour *projectedContour, Image *sliceImage, int paintingPixelValue = 1);
58 
59  protected:
61  ~ContourUtils() override;
62  };
63 }
64 
65 #endif
#define MITKSEGMENTATION_EXPORT
BaseGeometry Describes the geometry of a data object.
Helpful methods for working with contours and images.
void FillContourInSlice(Contour *projectedContour, Image *sliceImage, int paintingPixelValue=1)
Fill a contour in a 2D slice with a specified pixel value.
~ContourUtils() override
ContourModel::Pointer ProjectContourTo2DSlice(Image *slice, Contour *contourIn3D)
Projects a contour onto an image point by point. Converts from world to index coordinates.
ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry, Contour *contourIn2D)
Projects a slice index coordinates of a contour back into world coordinates.
mitkClassMacroItkParent(ContourUtils, itk::Object)
Stores vertices for drawing a contour.
Definition: mitkContour.h:32
Image class for storing images.
Definition: mitkImage.h:70
Find image slices visible on a given plane.