iMSTK
Interactive Medical Simulation Toolkit
imstkSurfaceMeshImageMask.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkGeometryAlgorithm.h"
10 #include "imstkMath.h"
11 
12 namespace imstk
13 {
14 class ImageData;
15 class SurfaceMesh;
16 
25 {
26 public:
28  ~SurfaceMeshImageMask() override = default;
29 
30 public:
34  void setReferenceImage(std::shared_ptr<ImageData> refImage);
35  void setInputMesh(std::shared_ptr<SurfaceMesh> mesh);
36  std::shared_ptr<ImageData> getOutputImage() const;
37 
42  imstkSetMacro(BorderExtent, int);
43  imstkGetMacro(BorderExtent, int);
45 
49  imstkSetMacro(Dimensions, const Vec3i&);
50  imstkGetMacro(Dimensions, const Vec3i&);
52 
56  void setDimensions(int dimX, int dimY, int dimZ) { setDimensions(Vec3i(dimX, dimY, dimZ)); }
57 
58 protected:
59  void requestUpdate() override;
60 
61 private:
62  Vec3i m_Dimensions = Vec3i(-1, -1, -1);
63  int m_BorderExtent = 1;
64  bool m_CheckManifold = true;
65 };
66 } // namespace imstk
imstkSetMacro(BorderExtent, int)
Get/Set a border around the generated image of pixel amount border exists outside of bounds...
Compound Geometry.
void setReferenceImage(std::shared_ptr< ImageData > refImage)
Optional input, used for information (dimensions, spacing, etc)
Abstract base class for geometry algorithms. GeometryAlgorithms take N input geometries and produce N...
void setDimensions(int dimX, int dimY, int dimZ)
The dimensions of the image to generate.
void requestUpdate() override
Users can implement this for the logic to be run.