From f5aca08b807b6658d0a17115b582bf0ac941bd66 Mon Sep 17 00:00:00 2001 From: nyoungbq Date: Wed, 21 Jun 2023 13:13:13 -0400 Subject: [PATCH] algorithm almost complete - randomness pending --- .../Filters/Algorithms/MergeColonies.cpp | 25 ++++++++----- .../Filters/Algorithms/MergeColonies.hpp | 7 ++-- .../Filters/MergeColoniesFilter.cpp | 36 +++++++++---------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.cpp index 4051ff7d9a..10aa3cd0dc 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.cpp @@ -138,6 +138,12 @@ MergeColonies::MergeColonies(DataStructure& dataStructure, const IFilter::Messag , m_ShouldCancel(shouldCancel) , m_MessageHandler(mesgHandler) , m_OrientationOps(LaueOps::GetAllOrientationOps()) +, m_FeatureParentIds(dataStructure.getDataRefAs(inputValues->FeatureParentIdsPath)) +, m_FeaturePhases(dataStructure.getDataRefAs(inputValues->FeaturePhasesPath)) +, m_AvgQuats(dataStructure.getDataRefAs(inputValues->AvgQuatsPath)) +, m_CrystalStructures(dataStructure.getDataRefAs(inputValues->CrystalStructuresPath)) +, m_AxisToleranceRad(inputValues->AxisTolerance * Constants::k_PiF / 180.0f) +, m_AngleTolerance(inputValues->AngleTolerance) { } @@ -153,14 +159,6 @@ const std::atomic_bool& MergeColonies::getCancel() // ----------------------------------------------------------------------------- Result<> MergeColonies::operator()() { - m_FeatureParentIds = m_DataStructure.getDataRefAs(m_InputValues->FeatureParentIdsPath); - m_FeaturePhases = m_DataStructure.getDataRefAs(m_InputValues->FeaturePhasesPath); - m_AvgQuats = m_DataStructure.getDataRefAs(m_InputValues->AvgQuatsPath); - m_CrystalStructures = m_DataStructure.getDataRefAs(m_InputValues->CrystalStructuresPath); - - m_AxisToleranceRad = m_InputValues->AxisTolerance * Constants::k_PiF / 180.0f; - m_AngleTolerance = m_InputValues->AngleTolerance; - GroupFeatures::execute(); auto active = m_DataStructure.getDataRefAs(m_InputValues->ActivePath); @@ -187,6 +185,10 @@ Result<> MergeColonies::operator()() } numParents += 1; + m_MessageHandler({IFilter::Message::Type::Info, "Characterizing Colonies Starting"}); + characterize_colonies(); + m_MessageHandler({IFilter::Message::Type::Info, "Characterizing Colonies Complete"}); + if(m_InputValues->RandomizeParentIds) { m_MessageHandler({IFilter::Message::Type::Info, "Randomizing Parent Ids...."}); @@ -355,3 +357,10 @@ bool MergeColonies::determineGrouping(int32 referenceFeature, int32 neighborFeat } return false; } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void MergeColonies::characterize_colonies() +{ +} diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.hpp index 113129bac2..d44fab7986 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/MergeColonies.hpp @@ -18,9 +18,6 @@ namespace complex { struct ORIENTATIONANALYSIS_EXPORT MergeColoniesInputValues { - bool UseNonContiguousNeighbors; - DataPath NonContiguousNLPath; - DataPath ContiguousNLPath; float32 AxisTolerance; float32 AngleTolerance; DataPath FeaturePhasesPath; @@ -47,7 +44,8 @@ class ORIENTATIONANALYSIS_EXPORT MergeColonies : public GroupFeatures using LaueOpsContainer = std::vector; public: - MergeColonies(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, MergeColoniesInputValues* inputValues); + MergeColonies(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, MergeColoniesInputValues* inputValues, + GroupFeaturesInputValues* groupInputValues); ~MergeColonies() noexcept; MergeColonies(const MergeColonies&) = delete; @@ -61,6 +59,7 @@ class ORIENTATIONANALYSIS_EXPORT MergeColonies : public GroupFeatures int getSeed(int32 newFid) override; bool determineGrouping(int32 referenceFeature, int32 neighborFeature, int32 newFid) override; + void characterize_colonies(); private: DataStructure& m_DataStructure; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeColoniesFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeColoniesFilter.cpp index 9575b35242..76ea649d78 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeColoniesFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeColoniesFilter.cpp @@ -99,11 +99,6 @@ IFilter::UniquePointer MergeColoniesFilter::clone() const IFilter::PreflightResult MergeColoniesFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const { - auto pUseNonContiguousNeighborsValue = filterArgs.value(k_UseNonContiguousNeighbors_Key); - auto pNonContiguousNeighborListArrayPathValue = filterArgs.value(k_NonContiguousNeighborListArrayPath_Key); - auto pContiguousNeighborListArrayPathValue = filterArgs.value(k_ContiguousNeighborListArrayPath_Key); - auto pAxisToleranceValue = filterArgs.value(k_AxisTolerance_Key); - auto pAngleToleranceValue = filterArgs.value(k_AngleTolerance_Key); auto pFeaturePhasesArrayPathValue = filterArgs.value(k_FeaturePhasesArrayPath_Key); auto pAvgQuatsArrayPathValue = filterArgs.value(k_AvgQuatsArrayPath_Key); auto pFeatureIdsArrayPathValue = filterArgs.value(k_FeatureIdsArrayPath_Key); @@ -128,21 +123,24 @@ Result<> MergeColoniesFilter::executeImpl(DataStructure& dataStructure, const Ar { MergeColoniesInputValues inputValues; - inputValues.UseNonContiguousNeighbors = filterArgs.value(k_UseNonContiguousNeighbors_Key); - inputValues.NonContiguousNeighborListArrayPath = filterArgs.value(k_NonContiguousNeighborListArrayPath_Key); - inputValues.ContiguousNeighborListArrayPath = filterArgs.value(k_ContiguousNeighborListArrayPath_Key); inputValues.AxisTolerance = filterArgs.value(k_AxisTolerance_Key); inputValues.AngleTolerance = filterArgs.value(k_AngleTolerance_Key); - inputValues.FeaturePhasesArrayPath = filterArgs.value(k_FeaturePhasesArrayPath_Key); - inputValues.AvgQuatsArrayPath = filterArgs.value(k_AvgQuatsArrayPath_Key); - inputValues.FeatureIdsArrayPath = filterArgs.value(k_FeatureIdsArrayPath_Key); - inputValues.CellPhasesArrayPath = filterArgs.value(k_CellPhasesArrayPath_Key); - inputValues.CrystalStructuresArrayPath = filterArgs.value(k_CrystalStructuresArrayPath_Key); - inputValues.CellParentIdsArrayName = filterArgs.value(k_CellParentIdsArrayName_Key); - inputValues.NewCellFeatureAttributeMatrixName = filterArgs.value(k_NewCellFeatureAttributeMatrixName_Key); - inputValues.FeatureParentIdsArrayName = filterArgs.value(k_FeatureParentIdsArrayName_Key); - inputValues.ActiveArrayName = filterArgs.value(k_ActiveArrayName_Key); - - return MergeColonies(dataStructure, messageHandler, shouldCancel, &inputValues)(); + inputValues.FeaturePhasesPath = filterArgs.value(k_FeaturePhasesArrayPath_Key); + inputValues.AvgQuatsPath = filterArgs.value(k_AvgQuatsArrayPath_Key); + inputValues.FeatureIdsPath = filterArgs.value(k_FeatureIdsArrayPath_Key); + inputValues.CellPhasesPath = filterArgs.value(k_CellPhasesArrayPath_Key); + inputValues.CrystalStructuresPath = filterArgs.value(k_CrystalStructuresArrayPath_Key); + inputValues.CellParentIdsPath = filterArgs.value(k_CellParentIdsArrayName_Key); + inputValues.CellFeatureAMPath = filterArgs.value(k_NewCellFeatureAttributeMatrixName_Key); + inputValues.FeatureParentIdsPath = filterArgs.value(k_FeatureParentIdsArrayName_Key); + inputValues.ActivePath = filterArgs.value(k_ActiveArrayName_Key); + + GroupFeaturesInputValues gpInputValues; + + gpInputValues.UseNonContiguousNeighbors = filterArgs.value(k_UseNonContiguousNeighbors_Key); + gpInputValues.NonContiguousNeighborListArrayPath = filterArgs.value(k_NonContiguousNeighborListArrayPath_Key); + gpInputValues.ContiguousNeighborListArrayPath = filterArgs.value(k_ContiguousNeighborListArrayPath_Key); + + return MergeColonies(dataStructure, messageHandler, shouldCancel, &inputValues, &gpInputValues)(); } } // namespace complex