Medical Imaging Interaction Toolkit  2026.06.00
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 
19 #include <vtkSmartPointer.h>
20 
22 
23 namespace mitk
24 {
35  class MITKCONTOURMODEL_EXPORT ContourModelUtils : public itk::Object
36  {
37  public:
39 
49  static ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice,
50  const ContourModel *contourIn3D);
51 
61  static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
62  const ContourModel *contourIn2D);
63 
74  static void FillContourInSlice2(const ContourModel* projectedContour,
75  Image* sliceImage,
76  int paintingPixelValue = 1);
77 
90  static void FillContourInSlice2(const ContourModel* projectedContour,
91  TimeStepType contourTimeStep,
92  Image* sliceImage,
93  int paintingPixelValue = 1);
94 
100  static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, TimeStepType timeStep);
101 
102  protected:
104  ~ContourModelUtils() override;
105  };
106 }
107 
108 #endif
#define MITKCONTOURMODEL_EXPORT
Abstract base class describing the geometry of a data object.
Static utility methods for working with contour models and images.
mitkClassMacroItkParent(ContourModelUtils, itk::Object)
~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)
Project a 3D contour onto a 2D image slice.
static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry, const ContourModel *contourIn2D)
Back-project a 2D slice contour into 3D world coordinates.
static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, TimeStepType timeStep)
Create a new contour model with the contour from time step 0 placed at the specified 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...
A time-resolved contour representation consisting of linked vertices in 3D space.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).