diff --git a/core/base/mergeTreeTemporalReduction/CMakeLists.txt b/core/base/mergeTreeTemporalReduction/CMakeLists.txt new file mode 100644 index 0000000000..d7bcc98617 --- /dev/null +++ b/core/base/mergeTreeTemporalReduction/CMakeLists.txt @@ -0,0 +1,8 @@ +ttk_add_base_library(mergeTreeTemporalReduction + SOURCES + MergeTreeTemporalReduction.cpp + HEADERS + MergeTreeTemporalReduction.h + DEPENDS + mergeTreeClustering +) diff --git a/core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.cpp b/core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.cpp new file mode 100644 index 0000000000..d0aa5c2805 --- /dev/null +++ b/core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.cpp @@ -0,0 +1,6 @@ +#include + +ttk::MergeTreeTemporalReduction::MergeTreeTemporalReduction() { + // inherited from Debug: prefix will be printed at the beginning of every msg + this->setDebugMsgPrefix("MergeTreeTemporalReduction"); +} diff --git a/core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.h b/core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.h similarity index 97% rename from core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.h rename to core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.h index d181333a93..5d6de761f5 100644 --- a/core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.h +++ b/core/base/mergeTreeTemporalReduction/MergeTreeTemporalReduction.h @@ -1,9 +1,9 @@ /// \ingroup base -/// \class ttk::MergeTreeTemporalReductionEncoding +/// \class ttk::MergeTreeTemporalReduction /// \author Mathieu Pont (mathieu.pont@lip6.fr) /// \date 2021. /// -/// This module defines the %MergeTreeTemporalReductionEncoding class that +/// This module defines the %MergeTreeTemporalReduction class that /// computes a temporal reduction of a sequence of merge trees. /// /// \b Related \b publication \n @@ -30,11 +30,11 @@ namespace ttk { /** - * The MergeTreeTemporalReductionEncoding class provides methods to compute + * The MergeTreeTemporalReduction class provides methods to compute * a temporal reduction of a sequence of merge trees. */ - class MergeTreeTemporalReductionEncoding : virtual public Debug, - public MergeTreeBase { + class MergeTreeTemporalReduction : virtual public Debug, + public MergeTreeBase { protected: double removalPercentage_ = 50.; bool useL2Distance_ = false; @@ -43,7 +43,7 @@ namespace ttk { std::vector timeVariable_; public: - MergeTreeTemporalReductionEncoding(); + MergeTreeTemporalReduction(); void setRemovalPercentage(double rs) { removalPercentage_ = rs; @@ -397,6 +397,6 @@ namespace ttk { return removed; } - }; // MergeTreeTemporalReductionEncoding class + }; // MergeTreeTemporalReduction class } // namespace ttk diff --git a/core/base/mergeTreeTemporalReductionEncoding/CMakeLists.txt b/core/base/mergeTreeTemporalReductionEncoding/CMakeLists.txt deleted file mode 100644 index 8b627e8834..0000000000 --- a/core/base/mergeTreeTemporalReductionEncoding/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -ttk_add_base_library(mergeTreeTemporalReductionEncoding - SOURCES - MergeTreeTemporalReductionEncoding.cpp - HEADERS - MergeTreeTemporalReductionEncoding.h - DEPENDS - mergeTreeClustering -) diff --git a/core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.cpp b/core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.cpp deleted file mode 100644 index 73456d43c5..0000000000 --- a/core/base/mergeTreeTemporalReductionEncoding/MergeTreeTemporalReductionEncoding.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -ttk::MergeTreeTemporalReductionEncoding::MergeTreeTemporalReductionEncoding() { - // inherited from Debug: prefix will be printed at the beginning of every msg - this->setDebugMsgPrefix("MergeTreeTemporalReductionEncoding"); -} diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/CMakeLists.txt b/core/vtk/ttkMergeTreeTemporalReduction/CMakeLists.txt similarity index 100% rename from core/vtk/ttkMergeTreeTemporalReductionEncoding/CMakeLists.txt rename to core/vtk/ttkMergeTreeTemporalReduction/CMakeLists.txt diff --git a/core/vtk/ttkMergeTreeTemporalReduction/ttk.module b/core/vtk/ttkMergeTreeTemporalReduction/ttk.module new file mode 100644 index 0000000000..c66227e6d2 --- /dev/null +++ b/core/vtk/ttkMergeTreeTemporalReduction/ttk.module @@ -0,0 +1,11 @@ +NAME + ttkMergeTreeTemporalReduction +SOURCES + ttkMergeTreeTemporalReduction.cpp +HEADERS + ttkMergeTreeTemporalReduction.h + ttkMergeTreeTemporalReductionUtils.h +DEPENDS + mergeTreeTemporalReduction + ttkAlgorithm + ttkPlanarGraphLayout diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.cpp b/core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.cpp similarity index 95% rename from core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.cpp rename to core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.cpp index f6335d4f48..91631e9fe8 100644 --- a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.cpp +++ b/core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -20,7 +20,7 @@ using namespace ttk::ftm; // A VTK macro that enables the instantiation of this class via ::New() // You do not have to modify this -vtkStandardNewMacro(ttkMergeTreeTemporalReductionEncoding); +vtkStandardNewMacro(ttkMergeTreeTemporalReduction); /** * The constructor has to specify the number of input and output ports @@ -32,20 +32,19 @@ vtkStandardNewMacro(ttkMergeTreeTemporalReductionEncoding); * explicitly, by for example allocating memory on the heap that needs * to be freed when the filter is destroyed. */ -ttkMergeTreeTemporalReductionEncoding::ttkMergeTreeTemporalReductionEncoding() { +ttkMergeTreeTemporalReduction::ttkMergeTreeTemporalReduction() { this->SetNumberOfInputPorts(1); this->SetNumberOfOutputPorts(2); } -ttkMergeTreeTemporalReductionEncoding::~ttkMergeTreeTemporalReductionEncoding() - = default; +ttkMergeTreeTemporalReduction::~ttkMergeTreeTemporalReduction() = default; /** * This method specifies the required input object data types of the * filter by adding the vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE() key to * the port information. */ -int ttkMergeTreeTemporalReductionEncoding::FillInputPortInformation( +int ttkMergeTreeTemporalReduction::FillInputPortInformation( int port, vtkInformation *info) { if(port == 0) { info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkMultiBlockDataSet"); @@ -67,7 +66,7 @@ int ttkMergeTreeTemporalReductionEncoding::FillInputPortInformation( * Note: prior to the execution of the RequestData method the pipeline will * initialize empty output data objects based on this information. */ -int ttkMergeTreeTemporalReductionEncoding::FillOutputPortInformation( +int ttkMergeTreeTemporalReduction::FillOutputPortInformation( int port, vtkInformation *info) { if(port == 0) { info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataSet"); @@ -89,7 +88,7 @@ int ttkMergeTreeTemporalReductionEncoding::FillOutputPortInformation( * 2) The output objects are already initialized based on the information * provided by the FillOutputPortInformation method. */ -int ttkMergeTreeTemporalReductionEncoding::RequestData( +int ttkMergeTreeTemporalReduction::RequestData( vtkInformation *ttkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector) { @@ -116,7 +115,7 @@ int ttkMergeTreeTemporalReductionEncoding::RequestData( } template -int ttkMergeTreeTemporalReductionEncoding::run( +int ttkMergeTreeTemporalReduction::run( vtkInformationVector *outputVector, std::vector> &inputTrees) { if(not isDataVisualizationFilled()) @@ -153,7 +152,7 @@ static std::vector> } template -int ttkMergeTreeTemporalReductionEncoding::runCompute( +int ttkMergeTreeTemporalReduction::runCompute( std::vector> &inputTrees) { // ------------------------------------------------------------------------------------ // --- Construct trees @@ -221,7 +220,7 @@ int ttkMergeTreeTemporalReductionEncoding::runCompute( } template -int ttkMergeTreeTemporalReductionEncoding::runOutput( +int ttkMergeTreeTemporalReduction::runOutput( vtkInformationVector *outputVector, std::vector> &inputTrees) { bool const OutputSegmentation = (inputTrees[0]->GetNumberOfBlocks() == 3); diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.h b/core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.h similarity index 89% rename from core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.h rename to core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.h index 1094d2be9b..9dac57f85f 100644 --- a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionEncoding.h +++ b/core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReduction.h @@ -1,12 +1,12 @@ /// \ingroup vtk -/// \class ttkMergeTreeTemporalReductionEncoding +/// \class ttkMergeTreeTemporalReduction /// \author Mathieu Pont (mathieu.pont@lip6.fr) /// \date 2021. /// -/// \brief TTK VTK-filter that wraps the ttk::MergeTreeTemporalReductionEncoding +/// \brief TTK VTK-filter that wraps the ttk::MergeTreeTemporalReduction /// module. /// -/// This VTK filter uses the ttk::MergeTreeTemporalReductionEncoding module to +/// This VTK filter uses the ttk::MergeTreeTemporalReduction module to /// compute a temporal reduction of a sequence of merge trees. /// /// \param Input vtkMultiBlockDataSet Input trees @@ -19,7 +19,7 @@ /// See the related ParaView example state files for usage examples within a /// VTK pipeline. /// -/// \sa ttk::MergeTreeTemporalReductionEncoding +/// \sa ttk::MergeTreeTemporalReduction /// \sa ttkAlgorithm /// /// \b Related \b publication \n @@ -36,7 +36,7 @@ #pragma once // VTK Module -#include +#include // VTK Includes #include @@ -45,14 +45,13 @@ #include // TTK Base Includes -#include +#include -class TTKMERGETREETEMPORALREDUCTIONENCODING_EXPORT - ttkMergeTreeTemporalReductionEncoding +class TTKMERGETREETEMPORALREDUCTION_EXPORT ttkMergeTreeTemporalReduction : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class , - protected ttk::MergeTreeTemporalReductionEncoding // and we inherit from the - // base class + protected ttk::MergeTreeTemporalReduction // and we inherit from the + // base class { private: // Execution options @@ -213,16 +212,16 @@ class TTKMERGETREETEMPORALREDUCTIONENCODING_EXPORT * This static method and the macro below are VTK conventions on how to * instantiate VTK objects. You don't have to modify this. */ - static ttkMergeTreeTemporalReductionEncoding *New(); - vtkTypeMacro(ttkMergeTreeTemporalReductionEncoding, ttkAlgorithm); + static ttkMergeTreeTemporalReduction *New(); + vtkTypeMacro(ttkMergeTreeTemporalReduction, ttkAlgorithm); protected: /** * Implement the filter constructor and destructor * (see cpp file) */ - ttkMergeTreeTemporalReductionEncoding(); - ~ttkMergeTreeTemporalReductionEncoding() override; + ttkMergeTreeTemporalReduction(); + ~ttkMergeTreeTemporalReduction() override; /** * Specify the input data type of each input port diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionUtils.h b/core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReductionUtils.h similarity index 100% rename from core/vtk/ttkMergeTreeTemporalReductionEncoding/ttkMergeTreeTemporalReductionUtils.h rename to core/vtk/ttkMergeTreeTemporalReduction/ttkMergeTreeTemporalReductionUtils.h diff --git a/core/vtk/ttkMergeTreeTemporalReduction/vtk.module b/core/vtk/ttkMergeTreeTemporalReduction/vtk.module new file mode 100644 index 0000000000..c2e788c540 --- /dev/null +++ b/core/vtk/ttkMergeTreeTemporalReduction/vtk.module @@ -0,0 +1,4 @@ +NAME + ttkMergeTreeTemporalReduction +DEPENDS + ttkAlgorithm \ No newline at end of file diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttk.module b/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttk.module deleted file mode 100644 index ff7b539abf..0000000000 --- a/core/vtk/ttkMergeTreeTemporalReductionEncoding/ttk.module +++ /dev/null @@ -1,11 +0,0 @@ -NAME - ttkMergeTreeTemporalReductionEncoding -SOURCES - ttkMergeTreeTemporalReductionEncoding.cpp -HEADERS - ttkMergeTreeTemporalReductionEncoding.h - ttkMergeTreeTemporalReductionUtils.h -DEPENDS - mergeTreeTemporalReductionEncoding - ttkAlgorithm - ttkPlanarGraphLayout diff --git a/core/vtk/ttkMergeTreeTemporalReductionEncoding/vtk.module b/core/vtk/ttkMergeTreeTemporalReductionEncoding/vtk.module deleted file mode 100644 index 831cc62d9e..0000000000 --- a/core/vtk/ttkMergeTreeTemporalReductionEncoding/vtk.module +++ /dev/null @@ -1,4 +0,0 @@ -NAME - ttkMergeTreeTemporalReductionEncoding -DEPENDS - ttkAlgorithm \ No newline at end of file diff --git a/paraview/xmls/MergeTreeTemporalReductionEncoding.xml b/paraview/xmls/MergeTreeTemporalReduction.xml similarity index 95% rename from paraview/xmls/MergeTreeTemporalReductionEncoding.xml rename to paraview/xmls/MergeTreeTemporalReduction.xml index 9b4f0cd5da..d640fe8342 100644 --- a/paraview/xmls/MergeTreeTemporalReductionEncoding.xml +++ b/paraview/xmls/MergeTreeTemporalReduction.xml @@ -5,8 +5,8 @@ - - + + This filter allows to compute a temporal reduction of a sequence of merge trees. It greedily removes trees in the sequence that can be accurately reconstructed with the geodesic computation. This iterated removal reveals key frames in the sequence (the trees that are not removed and used to reconstruct the removed trees).