Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkContourModelUtils.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 mitkContourModelUtils_h
14 #define mitkContourModelUtils_h
15 
16 #include <mitkContourModel.h>
17 #include <mitkImage.h>
18 #include <mitkLabelSetImage.h>
19 
20 #include <vtkSmartPointer.h>
21 
23 
24 namespace mitk
25 {
31  class MITKCONTOURMODEL_EXPORT ContourModelUtils : public itk::Object
32  {
33  public:
35 
42  static ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice,
43  const ContourModel *contourIn3D);
44 
51  static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
52  const ContourModel *contourIn2D);
53 
63  //[[deprecated]]
64  DEPRECATED(static void FillContourInSlice(const ContourModel* projectedContour,
65  TimeStepType contourTimeStep,
66  Image* sliceImage,
67  int paintingPixelValue = 1));
68 
79  static void FillContourInSlice2(const ContourModel* projectedContour,
80  Image* sliceImage,
81  int paintingPixelValue = 1);
82 
95  static void FillContourInSlice2(const ContourModel* projectedContour,
96  TimeStepType contourTimeStep,
97  Image* sliceImage,
98  int paintingPixelValue = 1);
99 
113  [[deprecated]]
115  vtkSmartPointer<vtkImageData> resultImage,
116  int paintingPixelValue,
117  double fillForegroundThreshold = 1.0);
118 
122  static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, TimeStepType timeStep);
123 
124  protected:
126  ~ContourModelUtils() override;
127  };
128 }
129 
130 #endif
#define MITKCONTOURMODEL_EXPORT
BaseGeometry Describes the geometry of a data object.
Helpful methods for working with contours and images.
mitkClassMacroItkParent(ContourModelUtils, itk::Object)
static void FillSliceInSlice(vtkSmartPointer< vtkImageData > filledImage, vtkSmartPointer< vtkImageData > resultImage, int paintingPixelValue, double fillForegroundThreshold=1.0)
Fills the paintingPixelValue into every pixel of resultImage as indicated by filledImage....
~ContourModelUtils() override
static void FillContourInSlice2(const ContourModel *projectedContour, Image *sliceImage, int paintingPixelValue=1)
Fill a contour in a 2D slice with a specified pixel value. This version always uses the contour of ti...
static ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice, const ContourModel *contourIn3D)
Projects a contour onto an image point by point. Converts from world to index coordinates.
static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry, const ContourModel *contourIn2D)
Projects a slice index coordinates of a contour back into world coordinates.
static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, TimeStepType timeStep)
Move the contour in time step 0 to to a new contour model at the given time step.
static void FillContourInSlice2(const ContourModel *projectedContour, TimeStepType contourTimeStep, Image *sliceImage, int paintingPixelValue=1)
Fill a contour in a 2D slice with a specified pixel value. This overloaded version uses the contour a...
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Image class for storing images.
Definition: mitkImage.h:70
#define DEPRECATED(func)
Definition: mitkCommon.h:175
Find image slices visible on a given plane.
std::size_t TimeStepType