Skip to content

Commit

Permalink
FILTER: Rename 'Contouring' to 'FlyingEdges3D' (#869)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson authored Feb 26, 2024
1 parent 1b1d2d8 commit b6a5019
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 59 deletions.
8 changes: 4 additions & 4 deletions src/Plugins/SimplnxCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ set(FilterList
FindTriangleGeomSizesFilter
FindVertexToTriangleDistancesFilter
FindVolFractionsFilter
FlyingEdges3DFilter
GenerateColorTableFilter
GenerateVectorColorsFilter
GeneratePythonSkeletonFilter
GenerateVectorColorsFilter
IdentifySample
ImageContouringFilter
InitializeData
InitializeImageGeomCellData
InterpolatePointCloudToRegularGridFilter
Expand Down Expand Up @@ -170,10 +170,10 @@ set(AlgorithmList
FindTriangleGeomCentroids
FindTriangleGeomSizes
FindVertexToTriangleDistances
FlyingEdges3D
GenerateColorTable
GenerateVectorColors
GeneratePythonSkeleton
ImageContouring
GenerateVectorColors
KMeans
KMedoids
LabelTriangleGeometry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Contour (Image Contouring)
# FlyingEdges3D (Image Contouring)

## Group (Subgroup)

Visual Analysis

## Description

This filter will draw a 3 dimensional contouring line through an Image Geometry based on an input value.
This filter will draw a 3 dimensional contouring surface through an Image Geometry based on an input value.

Here's what the results look like:

![3D-Contouring](Images/3D-contouring.png)
![3D-Contouring](Images/FlyingEdges3D_1.png)

% Auto generated parameter table will be inserted here

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ImageContouring.hpp"
#include "FlyingEdges3D.hpp"

#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/FlyingEdges.hpp"
Expand Down Expand Up @@ -26,7 +26,7 @@ struct ExecuteFlyingEdgesFunctor
} // namespace

// -----------------------------------------------------------------------------
ImageContouring::ImageContouring(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ImageContouringInputValues* inputValues)
FlyingEdges3D::FlyingEdges3D(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, FlyingEdges3DInputValues* inputValues)
: m_DataStructure(dataStructure)
, m_InputValues(inputValues)
, m_ShouldCancel(shouldCancel)
Expand All @@ -35,16 +35,16 @@ ImageContouring::ImageContouring(DataStructure& dataStructure, const IFilter::Me
}

// -----------------------------------------------------------------------------
ImageContouring::~ImageContouring() noexcept = default;
FlyingEdges3D::~FlyingEdges3D() noexcept = default;

// -----------------------------------------------------------------------------
const std::atomic_bool& ImageContouring::getCancel()
const std::atomic_bool& FlyingEdges3D::getCancel()
{
return m_ShouldCancel;
}

// -----------------------------------------------------------------------------
Result<> ImageContouring::operator()()
Result<> FlyingEdges3D::operator()()
{
const auto& image = m_DataStructure.getDataRefAs<ImageGeom>(m_InputValues->imageGeomPath);
float64 isoVal = m_InputValues->isoVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace nx::core
{

struct SIMPLNXCORE_EXPORT ImageContouringInputValues
struct SIMPLNXCORE_EXPORT FlyingEdges3DInputValues
{
DataPath imageGeomPath;
DataPath triangleGeomPath;
Expand All @@ -17,27 +17,27 @@ struct SIMPLNXCORE_EXPORT ImageContouringInputValues
};

/**
* @class ImageContouring
* @class FlyingEdges3D
* @brief This filter draw a 3 dimensional contouring line through an Image Geometry based on an input value.
*/
class SIMPLNXCORE_EXPORT ImageContouring
class SIMPLNXCORE_EXPORT FlyingEdges3D
{
public:
ImageContouring(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ImageContouringInputValues* inputValues);
~ImageContouring() noexcept;
FlyingEdges3D(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, FlyingEdges3DInputValues* inputValues);
~FlyingEdges3D() noexcept;

ImageContouring(const ImageContouring&) = delete;
ImageContouring(ImageContouring&&) noexcept = delete;
ImageContouring& operator=(const ImageContouring&) = delete;
ImageContouring& operator=(ImageContouring&&) noexcept = delete;
FlyingEdges3D(const FlyingEdges3D&) = delete;
FlyingEdges3D(FlyingEdges3D&&) noexcept = delete;
FlyingEdges3D& operator=(const FlyingEdges3D&) = delete;
FlyingEdges3D& operator=(FlyingEdges3D&&) noexcept = delete;

Result<> operator()();

const std::atomic_bool& getCancel();

private:
DataStructure& m_DataStructure;
const ImageContouringInputValues* m_InputValues = nullptr;
const FlyingEdges3DInputValues* m_InputValues = nullptr;
const std::atomic_bool& m_ShouldCancel;
const IFilter::MessageHandler& m_MessageHandler;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ImageContouringFilter.hpp"
#include "FlyingEdges3DFilter.hpp"

#include "SimplnxCore/Filters/Algorithms/ImageContouring.hpp"
#include "SimplnxCore/Filters/Algorithms/FlyingEdges3D.hpp"

#include "simplnx/Common/Types.hpp"
#include "simplnx/DataStructure/Geometry/ImageGeom.hpp"
Expand All @@ -20,37 +20,37 @@ const std::string k_VertexNormals = "VertexNormals";
namespace nx::core
{
//------------------------------------------------------------------------------
std::string ImageContouringFilter::name() const
std::string FlyingEdges3DFilter::name() const
{
return FilterTraits<ImageContouringFilter>::name.str();
return FilterTraits<FlyingEdges3DFilter>::name.str();
}

//------------------------------------------------------------------------------
std::string ImageContouringFilter::className() const
std::string FlyingEdges3DFilter::className() const
{
return FilterTraits<ImageContouringFilter>::className;
return FilterTraits<FlyingEdges3DFilter>::className;
}

//------------------------------------------------------------------------------
Uuid ImageContouringFilter::uuid() const
Uuid FlyingEdges3DFilter::uuid() const
{
return FilterTraits<ImageContouringFilter>::uuid;
return FilterTraits<FlyingEdges3DFilter>::uuid;
}

//------------------------------------------------------------------------------
std::string ImageContouringFilter::humanName() const
std::string FlyingEdges3DFilter::humanName() const
{
return "Surface Contour Filter (Flying Edges 3D)";
}

//------------------------------------------------------------------------------
std::vector<std::string> ImageContouringFilter::defaultTags() const
std::vector<std::string> FlyingEdges3DFilter::defaultTags() const
{
return {className(), "Surface Contour Filter (Flying Edges)", "Image Geometry"};
return {className(), "FlyingEdges3D", "Contouring", "Image Geometry", "Flying Edges 3D", "ISO Contour"};
}

//------------------------------------------------------------------------------
Parameters ImageContouringFilter::parameters() const
Parameters FlyingEdges3DFilter::parameters() const
{
Parameters params;

Expand All @@ -72,14 +72,14 @@ Parameters ImageContouringFilter::parameters() const
}

//------------------------------------------------------------------------------
IFilter::UniquePointer ImageContouringFilter::clone() const
IFilter::UniquePointer FlyingEdges3DFilter::clone() const
{
return std::make_unique<ImageContouringFilter>();
return std::make_unique<FlyingEdges3DFilter>();
}

//------------------------------------------------------------------------------
IFilter::PreflightResult ImageContouringFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel) const
IFilter::PreflightResult FlyingEdges3DFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel) const
{
auto pImageGeomPath = filterArgs.value<DataPath>(k_SelectedImageGeometry_Key);
auto pTriangleGeomName = filterArgs.value<std::string>(k_NewTriangleGeometryName_Key);
Expand All @@ -103,17 +103,17 @@ IFilter::PreflightResult ImageContouringFilter::preflightImpl(const DataStructur
}

//------------------------------------------------------------------------------
Result<> ImageContouringFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel) const
Result<> FlyingEdges3DFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel) const
{
ImageContouringInputValues inputValues;
FlyingEdges3DInputValues inputValues;

inputValues.imageGeomPath = filterArgs.value<DataPath>(k_SelectedImageGeometry_Key);
inputValues.contouringArrayPath = filterArgs.value<DataPath>(k_SelectedDataArray_Key);
inputValues.triangleGeomPath = DataPath({filterArgs.value<std::string>(k_NewTriangleGeometryName_Key)});
inputValues.isoVal = filterArgs.value<float64>(k_IsoVal_Key);
inputValues.normalsArrayPath = inputValues.triangleGeomPath.createChildPath(INodeGeometry0D::k_VertexDataName).createChildPath(k_VertexNormals);

return ImageContouring(dataStructure, messageHandler, shouldCancel, &inputValues)();
return FlyingEdges3D(dataStructure, messageHandler, shouldCancel, &inputValues)();
}
} // namespace nx::core
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
namespace nx::core
{
/**
* @class ImageContouringFilter
* @class FlyingEdges3DFilter
* @brief This filter will draw a 3 dimensional contouring line through an Image Geometry based on an input value.
*/
class SIMPLNXCORE_EXPORT ImageContouringFilter : public IFilter
class SIMPLNXCORE_EXPORT FlyingEdges3DFilter : public IFilter
{
public:
ImageContouringFilter() = default;
~ImageContouringFilter() noexcept override = default;
FlyingEdges3DFilter() = default;
~FlyingEdges3DFilter() noexcept override = default;

ImageContouringFilter(const ImageContouringFilter&) = delete;
ImageContouringFilter(ImageContouringFilter&&) noexcept = delete;
FlyingEdges3DFilter(const FlyingEdges3DFilter&) = delete;
FlyingEdges3DFilter(FlyingEdges3DFilter&&) noexcept = delete;

ImageContouringFilter& operator=(const ImageContouringFilter&) = delete;
ImageContouringFilter& operator=(ImageContouringFilter&&) noexcept = delete;
FlyingEdges3DFilter& operator=(const FlyingEdges3DFilter&) = delete;
FlyingEdges3DFilter& operator=(FlyingEdges3DFilter&&) noexcept = delete;

// Parameter Keys
static inline constexpr StringLiteral k_SelectedImageGeometry_Key = "selected_image_geometry";
Expand Down Expand Up @@ -96,4 +96,4 @@ class SIMPLNXCORE_EXPORT ImageContouringFilter : public IFilter
};
} // namespace nx::core

SIMPLNX_DEF_FILTER_TRAITS(nx::core, ImageContouringFilter, "c15b1af6-c43d-44ba-b180-f0130afafc8e");
SIMPLNX_DEF_FILTER_TRAITS(nx::core, FlyingEdges3DFilter, "c15b1af6-c43d-44ba-b180-f0130afafc8e");
2 changes: 1 addition & 1 deletion src/Plugins/SimplnxCore/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set(${PLUGIN_NAME}UnitTest_SRCS
GenerateVectorColorsTest.cpp
GeneratePythonSkeletonTest.cpp
IdentifySampleTest.cpp
ImageContouringTest.cpp
FlyingEdges3DTest.cpp
ImageGeomTest.cpp
InitializeDataTest.cpp
InitializeImageGeomCellDataTest.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "SimplnxCore/Filters/ImageContouringFilter.hpp"
#include "SimplnxCore/Filters/FlyingEdges3DFilter.hpp"
#include "SimplnxCore/SimplnxCore_test_dirs.hpp"

#include "simplnx/DataStructure/Geometry/TriangleGeom.hpp"
Expand Down Expand Up @@ -33,7 +33,7 @@ const DataPath k_ExemplarNormals = k_ExemplarContourPath.createChildPath(INodeGe
const DataPath k_NewNormals = k_NewContourPath.createChildPath(INodeGeometry0D::k_VertexDataName).createChildPath(k_VertexNormals);
} // namespace ContourTest

TEST_CASE("SimplnxCore::Image Contouring Valid Execution", "[SimplnxCore][ImageContouring]")
TEST_CASE("SimplnxCore::Image Contouring Valid Execution", "[SimplnxCore][FlyingEdges3D]")
{
const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "flying_edges_exemplar.tar.gz",
"flying_edges_exemplar.dream3d");
Expand All @@ -44,16 +44,16 @@ TEST_CASE("SimplnxCore::Image Contouring Valid Execution", "[SimplnxCore][ImageC

{
// Instantiate the filter and an Arguments Object
ImageContouringFilter filter;
FlyingEdges3DFilter filter;
Arguments args;

// Create default Parameters for the filter.
args.insertOrAssign(ImageContouringFilter::k_IsoVal_Key, std::make_any<float64>(ContourTest::k_IsoVal));
args.insertOrAssign(FlyingEdges3DFilter::k_IsoVal_Key, std::make_any<float64>(ContourTest::k_IsoVal));
// Selected Data Objects
args.insertOrAssign(ImageContouringFilter::k_SelectedImageGeometry_Key, std::make_any<GeometrySelectionParameter::ValueType>(ContourTest::k_GeometryPath));
args.insertOrAssign(ImageContouringFilter::k_SelectedDataArray_Key, std::make_any<DataPath>(ContourTest::k_DataPath));
args.insertOrAssign(FlyingEdges3DFilter::k_SelectedImageGeometry_Key, std::make_any<GeometrySelectionParameter::ValueType>(ContourTest::k_GeometryPath));
args.insertOrAssign(FlyingEdges3DFilter::k_SelectedDataArray_Key, std::make_any<DataPath>(ContourTest::k_DataPath));
// Output Path
args.insertOrAssign(ImageContouringFilter::k_NewTriangleGeometryName_Key, std::make_any<DataObjectNameParameter::ValueType>(ContourTest::k_NewTriangleContourName));
args.insertOrAssign(FlyingEdges3DFilter::k_NewTriangleGeometryName_Key, std::make_any<DataObjectNameParameter::ValueType>(ContourTest::k_NewTriangleContourName));

// Preflight the filter and check result
auto preflightResult = filter.preflight(dataStructure, args);
Expand Down

0 comments on commit b6a5019

Please sign in to comment.