Skip to content

Commit

Permalink
Rename ImportTextFilter to ReadTextDataArrayFilter.
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Kleingers <[email protected]>
  • Loading branch information
joeykleingers committed Oct 11, 2023
1 parent 843b584 commit d5360e8
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 134 deletions.
2 changes: 1 addition & 1 deletion src/Plugins/ComplexCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ set(FilterList
ImportDeformKeyFileV12Filter
ImportDREAM3DFilter
ImportHDF5Dataset
ImportTextFilter
ReadTextDataArrayFilter
ImportVolumeGraphicsFileFilter
InitializeData
InterpolatePointCloudToRegularGridFilter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Import ASCII Attribute Array
# Read Text Data Array


## Group (Subgroup) ##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -67,7 +67,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -88,7 +88,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -109,7 +109,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand Down
8 changes: 4 additions & 4 deletions src/Plugins/ComplexCore/pipelines/Import_CSV_Data.d3dpipeline
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -71,7 +71,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -94,7 +94,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -117,7 +117,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -130,7 +130,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -153,7 +153,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -176,7 +176,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -199,7 +199,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand All @@ -222,7 +222,7 @@
},
"comments": "",
"filter": {
"name": "complex::ImportTextFilter",
"name": "complex::ReadTextDataArrayFilter",
"uuid": "25f7df3e-ca3e-4634-adda-732c0e56efd4"
},
"isDisabled": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include "ComplexCore/Filters/ImportDeformKeyFileV12Filter.hpp"
#include "ComplexCore/Filters/ImportDREAM3DFilter.hpp"
#include "ComplexCore/Filters/ImportHDF5Dataset.hpp"
#include "ComplexCore/Filters/ImportTextFilter.hpp"
#include "ComplexCore/Filters/ReadTextDataArrayFilter.hpp"
#include "ComplexCore/Filters/ImportVolumeGraphicsFileFilter.hpp"
#include "ComplexCore/Filters/InitializeData.hpp"
#include "ComplexCore/Filters/InterpolatePointCloudToRegularGridFilter.hpp"
Expand Down Expand Up @@ -169,7 +169,7 @@ namespace complex
{complex::Uuid::FromString("bdb978bc-96bf-5498-972c-b509c38b8d50").value(), complex::FilterTraits<ReadCSVFileFilter>::uuid}, // ReadASCIIData
{complex::Uuid::FromString("043cbde5-3878-5718-958f-ae75714df0df").value(), complex::FilterTraits<ImportDREAM3DFilter>::uuid}, // DataContainerReader
{complex::Uuid::FromString("9e98c3b0-5707-5a3b-b8b5-23ef83b02896").value(), complex::FilterTraits<ImportHDF5Dataset>::uuid}, // ImportHDF5Dataset
{complex::Uuid::FromString("a7007472-29e5-5d0a-89a6-1aed11b603f8").value(), complex::FilterTraits<ImportTextFilter>::uuid}, // ImportAsciDataArray
{complex::Uuid::FromString("a7007472-29e5-5d0a-89a6-1aed11b603f8").value(), complex::FilterTraits<ReadTextDataArrayFilter>::uuid}, // ImportAsciDataArray
{complex::Uuid::FromString("5fa10d81-94b4-582b-833f-8eabe659069e").value(), complex::FilterTraits<ImportVolumeGraphicsFileFilter>::uuid}, // ImportVolumeGraphicsFileFilter
{complex::Uuid::FromString("dfab9921-fea3-521c-99ba-48db98e43ff8").value(), complex::FilterTraits<InitializeData>::uuid}, // InitializeData
{complex::Uuid::FromString("4b551c15-418d-5081-be3f-d3aeb62408e5").value(), complex::FilterTraits<InterpolatePointCloudToRegularGridFilter>::uuid}, // InterpolatePointCloudToRegularGrid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ImportTextFilter.hpp"
#include "ReadTextDataArrayFilter.hpp"

#include "complex/Common/StringLiteral.hpp"
#include "complex/Common/TypeTraits.hpp"
Expand All @@ -22,32 +22,32 @@ using namespace complex;

namespace complex
{
std::string ImportTextFilter::name() const
std::string ReadTextDataArrayFilter::name() const
{
return FilterTraits<ImportTextFilter>::name;
return FilterTraits<ReadTextDataArrayFilter>::name;
}

std::string ImportTextFilter::className() const
std::string ReadTextDataArrayFilter::className() const
{
return FilterTraits<ImportTextFilter>::className;
return FilterTraits<ReadTextDataArrayFilter>::className;
}

Uuid ImportTextFilter::uuid() const
Uuid ReadTextDataArrayFilter::uuid() const
{
return FilterTraits<ImportTextFilter>::uuid;
return FilterTraits<ReadTextDataArrayFilter>::uuid;
}

std::vector<std::string> ImportTextFilter::defaultTags() const
std::vector<std::string> ReadTextDataArrayFilter::defaultTags() const
{
return {className(), "IO", "Input", "Read", "Import", "Text"};
return {className(), "IO", "Input", "Read", "Import", "Text", "ASCII", "Attribute"};
}

std::string ImportTextFilter::humanName() const
std::string ReadTextDataArrayFilter::humanName() const
{
return "Import ASCII Data Array";
return "Read Text Data Array";
}

Parameters ImportTextFilter::parameters() const
Parameters ReadTextDataArrayFilter::parameters() const
{
Parameters params;

Expand Down Expand Up @@ -81,12 +81,12 @@ Parameters ImportTextFilter::parameters() const
return params;
}

IFilter::UniquePointer ImportTextFilter::clone() const
IFilter::UniquePointer ReadTextDataArrayFilter::clone() const
{
return std::make_unique<ImportTextFilter>();
return std::make_unique<ReadTextDataArrayFilter>();
}

IFilter::PreflightResult ImportTextFilter::preflightImpl(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const
IFilter::PreflightResult ReadTextDataArrayFilter::preflightImpl(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const
{
auto numericType = args.value<NumericType>(k_ScalarTypeKey);
auto arrayPath = args.value<DataPath>(k_DataArrayKey);
Expand Down Expand Up @@ -141,7 +141,8 @@ IFilter::PreflightResult ImportTextFilter::preflightImpl(const DataStructure& da
return {std::move(resultOutputActions)};
}

Result<> ImportTextFilter::executeImpl(DataStructure& data, const Arguments& args, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const
Result<> ReadTextDataArrayFilter::executeImpl(DataStructure& data, const Arguments& args, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel) const
{
auto inputFilePath = args.value<fs::path>(k_InputFileKey);
auto numericType = args.value<NumericType>(k_ScalarTypeKey);
Expand Down Expand Up @@ -194,7 +195,7 @@ Result<> ImportTextFilter::executeImpl(DataStructure& data, const Arguments& arg
return CsvParser::ReadFile<double>(inputFilePath, *dataArray, skipLines, delimiter);
}
default:
return MakeErrorResult(-1001, fmt::format("ImportTextFilter: Parameter NumericType which has a value of '{}' does not match any in complex.", to_underlying(numericType)));
return MakeErrorResult(-1001, fmt::format("ReadTextDataArrayFilter: Parameter NumericType which has a value of '{}' does not match any in complex.", to_underlying(numericType)));
}
}
} // namespace complex
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

namespace complex
{
class COMPLEXCORE_EXPORT ImportTextFilter : public IFilter
class COMPLEXCORE_EXPORT ReadTextDataArrayFilter : public IFilter
{
public:
ImportTextFilter() = default;
~ImportTextFilter() noexcept override = default;
ReadTextDataArrayFilter() = default;
~ReadTextDataArrayFilter() noexcept override = default;

ImportTextFilter(const ImportTextFilter&) = delete;
ImportTextFilter(ImportTextFilter&&) noexcept = delete;
ReadTextDataArrayFilter(const ReadTextDataArrayFilter&) = delete;
ReadTextDataArrayFilter(ReadTextDataArrayFilter&&) noexcept = delete;

ImportTextFilter& operator=(const ImportTextFilter&) = delete;
ImportTextFilter& operator=(ImportTextFilter&&) noexcept = delete;
ReadTextDataArrayFilter& operator=(const ReadTextDataArrayFilter&) = delete;
ReadTextDataArrayFilter& operator=(ReadTextDataArrayFilter&&) noexcept = delete;

static inline constexpr StringLiteral k_InputFileKey = "input_file";
static inline constexpr StringLiteral k_ScalarTypeKey = "scalar_type";
Expand Down Expand Up @@ -93,4 +93,4 @@ class COMPLEXCORE_EXPORT ImportTextFilter : public IFilter
};
} // namespace complex

COMPLEX_DEF_FILTER_TRAITS(complex, ImportTextFilter, "25f7df3e-ca3e-4634-adda-732c0e56efd4");
COMPLEX_DEF_FILTER_TRAITS(complex, ReadTextDataArrayFilter, "25f7df3e-ca3e-4634-adda-732c0e56efd4");
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ComplexCore/ComplexCore_test_dirs.hpp"
#include "ComplexCore/Filters/AlignSectionsFeatureCentroidFilter.hpp"
#include "ComplexCore/Filters/ImportTextFilter.hpp"
#include "ComplexCore/Filters/ReadTextDataArrayFilter.hpp"

#include "complex/Core/Application.hpp"
#include "complex/Parameters/ArraySelectionParameter.hpp"
Expand Down Expand Up @@ -95,7 +95,7 @@ TEST_CASE("ComplexCore::AlignSectionsFeatureCentroidFilter", "[Reconstruction][A

// Compare the output of the shifts file with the exemplar file

ImportTextFilter filter;
ReadTextDataArrayFilter filter;

Arguments args;
// read in the exemplar shift data file
Expand Down Expand Up @@ -129,7 +129,7 @@ TEST_CASE("ComplexCore::AlignSectionsFeatureCentroidFilter", "[Reconstruction][A

// Compare the output of the shifts file with the exemplar file

ImportTextFilter filter;
ReadTextDataArrayFilter filter;

Arguments args;
args.insertOrAssign(k_InputFileKey, std::make_any<FileSystemPathParameter::ValueType>(computedShiftsFile));
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/ComplexCore/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ set(${PLUGIN_NAME}UnitTest_SRCS

# ImportDeformKeyFileV12Test.cpp
ImportHDF5DatasetTest.cpp
ImportTextTest.cpp
ReadTextDataArrayTest.cpp
ImportVolumeGraphicsFileTest.cpp
InitializeDataTest.cpp
InterpolatePointCloudToRegularGridTest.cpp
Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/ComplexCore/test/CoreFilterTest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ComplexCore/ComplexCore_test_dirs.hpp"
#include "ComplexCore/Filters/CreateDataGroup.hpp"
#include "ComplexCore/Filters/ImportTextFilter.hpp"
#include "ComplexCore/Filters/ReadTextDataArrayFilter.hpp"

#include "complex/Common/StringLiteral.hpp"
#include "complex/Core/Application.hpp"
Expand Down Expand Up @@ -76,13 +76,13 @@ TEST_CASE("CoreFilterTest:RunCoreFilter")
file << i << "," << i + 1 << "," << i + 2 << "\n";
}
}
SECTION("Run ImportTextFilter")
SECTION("Run ReadTextDataArrayFilter")
{
static constexpr uint64 k_NComp = 3;
static constexpr uint64 k_NSkipLines = 0;
const static DynamicTableInfo::TableDataType k_TupleDims = {{static_cast<double>(k_NLines)}};

ImportTextFilter filter;
ReadTextDataArrayFilter filter;
DataStructure dataStructure;
Arguments args;
DataPath dataPath({"foo"});
Expand Down
14 changes: 7 additions & 7 deletions src/Plugins/ComplexCore/test/GenerateColorTableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "ComplexCore/ComplexCore_test_dirs.hpp"
#include "ComplexCore/Filters/GenerateColorTableFilter.hpp"
#include "ComplexCore/Filters/ImportTextFilter.hpp"
#include "ComplexCore/Filters/ReadTextDataArrayFilter.hpp"

#include "complex/Parameters/ArrayCreationParameter.hpp"
#include "complex/Parameters/DynamicTableParameter.hpp"
Expand Down Expand Up @@ -79,14 +79,14 @@ TEST_CASE("ComplexCore::GenerateColorTableFilter: Valid filter execution")

// Read Image File
{
const ImportTextFilter filter;
const ReadTextDataArrayFilter filter;
Arguments args;

args.insertOrAssign(ImportTextFilter::k_InputFileKey, std::make_any<fs::path>(k_InputImageFilePath));
args.insertOrAssign(ImportTextFilter::k_ScalarTypeKey, std::make_any<NumericType>(NumericType::float32));
args.insertOrAssign(ImportTextFilter::k_NCompKey, std::make_any<uint64>(1));
args.insertOrAssign(ImportTextFilter::k_NTuplesKey, std::make_any<DynamicTableParameter::ValueType>(DynamicTableInfo::TableDataType{{static_cast<double>(37989)}}));
args.insertOrAssign(ImportTextFilter::k_DataArrayKey, std::make_any<DataPath>(DataPath{{Constants::k_Confidence_Index.str()}}));
args.insertOrAssign(ReadTextDataArrayFilter::k_InputFileKey, std::make_any<fs::path>(k_InputImageFilePath));
args.insertOrAssign(ReadTextDataArrayFilter::k_ScalarTypeKey, std::make_any<NumericType>(NumericType::float32));
args.insertOrAssign(ReadTextDataArrayFilter::k_NCompKey, std::make_any<uint64>(1));
args.insertOrAssign(ReadTextDataArrayFilter::k_NTuplesKey, std::make_any<DynamicTableParameter::ValueType>(DynamicTableInfo::TableDataType{{static_cast<double>(37989)}}));
args.insertOrAssign(ReadTextDataArrayFilter::k_DataArrayKey, std::make_any<DataPath>(DataPath{{Constants::k_Confidence_Index.str()}}));

IFilter::ExecuteResult executeResult = filter.execute(dataStructure, args);
COMPLEX_RESULT_REQUIRE_VALID(executeResult.result);
Expand Down
Loading

0 comments on commit d5360e8

Please sign in to comment.