Skip to content

Commit

Permalink
Rename the H5EbsdReaderParameter to ReadH5EbsdFileParameter
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Nov 13, 2023
1 parent ccc9bbe commit 768994d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/Plugins/OrientationAnalysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ create_complex_plugin(NAME ${PLUGIN_NAME}
# include directories that are needed for the parameter.
# ------------------------------------------------------------------------------
set(complex_injected_parameters
H5EbsdReaderParameter
ReadH5EbsdFileParameter
OEMEbsdScanSelectionParameter
#EbsdToH5EbsdParameter
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "OrientationAnalysis/OrientationAnalysis_export.hpp"
#include "OrientationAnalysis/Parameters/H5EbsdReaderParameter.h"
#include "OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.h"

#include "complex/DataStructure/DataPath.hpp"
#include "complex/DataStructure/DataStructure.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ReadH5EbsdFilter.hpp"

#include "OrientationAnalysis/Filters/Algorithms/ReadH5Ebsd.hpp"
#include "OrientationAnalysis/Parameters/H5EbsdReaderParameter.h"
#include "OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.h"

#include "complex/DataStructure/DataPath.hpp"
#include "complex/Filter/Actions/CreateArrayAction.hpp"
Expand Down Expand Up @@ -56,8 +56,8 @@ Parameters ReadH5EbsdFilter::parameters() const
Parameters params;
// Create the parameter descriptors that are needed for this filter
params.insertSeparator(Parameters::Separator{"Input Parameters"});
params.insert(std::make_unique<H5EbsdReaderParameter>(k_ReadH5EbsdParameter_Key, "Import H5Ebsd File", "Object that holds all relevant information to import data from the file.",
H5EbsdReaderParameter::ValueType{}));
params.insert(std::make_unique<ReadH5EbsdFileParameter>(k_ReadH5EbsdParameter_Key, "Import H5Ebsd File", "Object that holds all relevant information to import data from the file.",
ReadH5EbsdFileParameter::ValueType{}));

params.insertSeparator(Parameters::Separator{"Created Data Structure Objects"});
params.insert(std::make_unique<DataGroupCreationParameter>(k_DataContainerName_Key, "Created Image Geometry", "The complete path to the imported Image Geometry", DataPath({"DataContainer"})));
Expand All @@ -82,7 +82,7 @@ IFilter::PreflightResult ReadH5EbsdFilter::preflightImpl(const DataStructure& da
const std::atomic_bool& shouldCancel) const
{

auto pReadH5EbsdFilterValue = filterArgs.value<H5EbsdReaderParameter::ValueType>(k_ReadH5EbsdParameter_Key);
auto pReadH5EbsdFilterValue = filterArgs.value<ReadH5EbsdFileParameter::ValueType>(k_ReadH5EbsdParameter_Key);
auto imageGeomPath = filterArgs.value<DataPath>(k_DataContainerName_Key);
auto pCellAttributeMatrixNameValue = filterArgs.value<std::string>(k_CellAttributeMatrixName_Key);
DataPath cellAttributeMatrixPath = imageGeomPath.createChildPath(pCellAttributeMatrixNameValue);
Expand Down Expand Up @@ -233,7 +233,7 @@ Result<> ReadH5EbsdFilter::executeImpl(DataStructure& dataStructure, const Argum
/****************************************************************************
* Extract the actual input values from the 'filterArgs' object
***************************************************************************/
auto pReadH5EbsdFilterValue = filterArgs.value<H5EbsdReaderParameter::ValueType>(k_ReadH5EbsdParameter_Key);
auto pReadH5EbsdFilterValue = filterArgs.value<ReadH5EbsdFileParameter::ValueType>(k_ReadH5EbsdParameter_Key);
auto pDataContainerNameValue = filterArgs.value<DataPath>(k_DataContainerName_Key);
auto pCellAttributeMatrixNameValue = filterArgs.value<std::string>(k_CellAttributeMatrixName_Key);
auto pCellEnsembleAttributeMatrixNameValue = pDataContainerNameValue.createChildPath(filterArgs.value<std::string>(k_CellEnsembleAttributeMatrixName_Key));
Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "OrientationAnalysis/Filters/ReadH5EbsdFilter.hpp"
#include "OrientationAnalysis/OrientationAnalysis_test_dirs.hpp"
#include "OrientationAnalysis/Parameters/H5EbsdReaderParameter.h"
#include "OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.h"

#include "complex/Core/Application.hpp"
#include "complex/Parameters/ArrayCreationParameter.hpp"
Expand Down Expand Up @@ -35,15 +35,15 @@ TEST_CASE("OrientationAnalysis::ReadH5Ebsd: Valid filter execution", "[Orientati
ReadH5EbsdFilter filter;
Arguments args;

H5EbsdReaderParameter::ValueType h5ebsdParamVal;
ReadH5EbsdFileParameter::ValueType h5ebsdParamVal;
h5ebsdParamVal.inputFilePath = fmt::format("{}/Small_IN100.h5ebsd", unit_test::k_TestFilesDir);
h5ebsdParamVal.startSlice = 1;
h5ebsdParamVal.endSlice = 117;
h5ebsdParamVal.eulerRepresentation = EbsdLib::AngleRepresentation::Radians;
h5ebsdParamVal.selectedArrayNames = {Constants::k_ConfidenceIndex, Constants::k_EulerAngles, Constants::k_Fit, Constants::k_ImageQuality, Constants::k_Phases, Constants::k_SEMSignal};
h5ebsdParamVal.useRecommendedTransform = true;

args.insertOrAssign(ReadH5EbsdFilter::k_ReadH5EbsdParameter_Key, std::make_any<H5EbsdReaderParameter::ValueType>(h5ebsdParamVal));
args.insertOrAssign(ReadH5EbsdFilter::k_ReadH5EbsdParameter_Key, std::make_any<ReadH5EbsdFileParameter::ValueType>(h5ebsdParamVal));
args.insertOrAssign(ReadH5EbsdFilter::k_DataContainerName_Key, std::make_any<DataPath>(Constants::k_DataContainerPath));
args.insertOrAssign(ReadH5EbsdFilter::k_CellAttributeMatrixName_Key, std::make_any<std::string>(Constants::k_CellData));
args.insertOrAssign(ReadH5EbsdFilter::k_CellEnsembleAttributeMatrixName_Key, std::make_any<std::string>(Constants::k_EnsembleAttributeMatrix));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <OrientationAnalysis/OrientationAnalysisPlugin.hpp>

#include <OrientationAnalysis/Parameters/H5EbsdReaderParameter.h>
#include <OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.h>
#include <OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.h>

#include "OrientationAnalysis/OrientationAnalysisFilterBinding.hpp"

Expand All @@ -21,17 +21,17 @@ PYBIND11_MODULE(orientationanalysis, mod)

auto* plugin = internals.addPlugin<OrientationAnalysisPlugin>();

auto h5EbsdReaderParameter = COMPLEX_PY_BIND_PARAMETER(mod, H5EbsdReaderParameter);
auto h5EbsdReaderParameter = COMPLEX_PY_BIND_PARAMETER(mod, ReadH5EbsdFileParameter);
auto oemEbsdScanSelectionParameter = COMPLEX_PY_BIND_PARAMETER(mod, OEMEbsdScanSelectionParameter);

py::class_<H5EbsdReaderParameter::ValueType> h5EbsdReaderValueType(h5EbsdReaderParameter, "ValueType");
py::class_<ReadH5EbsdFileParameter::ValueType> h5EbsdReaderValueType(h5EbsdReaderParameter, "ValueType");
h5EbsdReaderValueType.def(py::init<>());
h5EbsdReaderValueType.def_readwrite("input_file_path", &H5EbsdReaderParameter::ValueType::inputFilePath);
h5EbsdReaderValueType.def_readwrite("start_slice", &H5EbsdReaderParameter::ValueType::startSlice);
h5EbsdReaderValueType.def_readwrite("end_slice", &H5EbsdReaderParameter::ValueType::endSlice);
h5EbsdReaderValueType.def_readwrite("euler_representation", &H5EbsdReaderParameter::ValueType::eulerRepresentation);
h5EbsdReaderValueType.def_readwrite("selected_array_names", &H5EbsdReaderParameter::ValueType::selectedArrayNames);
h5EbsdReaderValueType.def_readwrite("use_recommended_transform", &H5EbsdReaderParameter::ValueType::useRecommendedTransform);
h5EbsdReaderValueType.def_readwrite("input_file_path", &ReadH5EbsdFileParameter::ValueType::inputFilePath);
h5EbsdReaderValueType.def_readwrite("start_slice", &ReadH5EbsdFileParameter::ValueType::startSlice);
h5EbsdReaderValueType.def_readwrite("end_slice", &ReadH5EbsdFileParameter::ValueType::endSlice);
h5EbsdReaderValueType.def_readwrite("euler_representation", &ReadH5EbsdFileParameter::ValueType::eulerRepresentation);
h5EbsdReaderValueType.def_readwrite("selected_array_names", &ReadH5EbsdFileParameter::ValueType::selectedArrayNames);
h5EbsdReaderValueType.def_readwrite("use_recommended_transform", &ReadH5EbsdFileParameter::ValueType::useRecommendedTransform);

py::class_<OEMEbsdScanSelectionParameter::ValueType> oemEbsdScanSelectionValueType(oemEbsdScanSelectionParameter, "ValueType");
oemEbsdScanSelectionValueType.def(py::init<>());
Expand All @@ -49,7 +49,7 @@ PYBIND11_MODULE(orientationanalysis, mod)
OEMEbsdScanSelectionParameter::ExtensionsType>(),
"name"_a, "human_name"_a, "help_text"_a, "default_value"_a, "reader_type"_a, "extensions_type"_a);

internals.addConversion<H5EbsdReaderParameter>();
internals.addConversion<ReadH5EbsdFileParameter>();
internals.addConversion<OEMEbsdScanSelectionParameter>();

OrientationAnalysis::BindFilters(mod, internals);
Expand Down
2 changes: 1 addition & 1 deletion wrapping/python/docs/generate_sphinx_docs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void GenerateParameterList()
{
::s_ParameterMap.clear();
ADD_PARAMETER_TRAIT(complex.OEMEbsdScanSelectionParameter, "3935c833-aa51-4a58-81e9-3a51972c05ea")
ADD_PARAMETER_TRAIT(complex.H5EbsdReaderParameter, "FAC15aa6-b367-508e-bf73-94ab6be0058b")
ADD_PARAMETER_TRAIT(complex.ReadH5EbsdFileParameter, "FAC15aa6-b367-508e-bf73-94ab6be0058b")
ADD_PARAMETER_TRAIT(complex.NumericTypeParameter, "a8ff9dbd-45e7-4ed6-8537-12dd53069bce")
ADD_PARAMETER_TRAIT(complex.StringParameter, "5d6d1868-05f8-11ec-9a03-0242ac130003")
ADD_PARAMETER_TRAIT(complex.DataStoreFormatParameter, "cfd5c150-2938-42a7-b023-4a9288fb6899")
Expand Down
14 changes: 7 additions & 7 deletions wrapping/python/docs/source/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -445,17 +445,17 @@ General Parameters
)
.. _H5EbsdReaderParameter:
.. py:class:: H5EbsdReaderParameter
.. py:class:: ReadH5EbsdFileParameter
This parameter is used for the :ref:`orientationAnalysis.ReadH5EbsdFilter() <ReadH5EbsdFilter>` and holds the information to import the EBSD data from the file.

The primary python object that will hold the information to pass to the filter is the H5EbsdReaderParameter class described below.
The primary python object that will hold the information to pass to the filter is the ReadH5EbsdFileParameter class described below.

:ivar ValueType: H5EbsdReaderParameter
:ivar ValueType: ReadH5EbsdFileParameter

.. py:class:: H5EbsdReaderParameter
.. py:class:: ReadH5EbsdFileParameter
The H5EbsdReaderParameter class holds all the necessary information to import EBSD data stored in the H5Ebsd file.
The ReadH5EbsdFileParameter class holds all the necessary information to import EBSD data stored in the H5Ebsd file.

:ivar euler_representation: Int. 0=Radians, 1=Degrees
:ivar start_slice: Int. The starting slice of EBSD data to import
Expand All @@ -467,8 +467,8 @@ General Parameters
.. code:: python
data_structure = cx.DataStructure()
# Create the H5EbsdReaderParameter and assign values to it.
h5ebsdParameter = cxor.H5EbsdReaderParameter.ValueType()
# Create the ReadH5EbsdFileParameter and assign values to it.
h5ebsdParameter = cxor.ReadH5EbsdFileParameter.ValueType()
h5ebsdParameter.euler_representation=0
h5ebsdParameter.end_slice=117
h5ebsdParameter.selected_array_names=["Confidence Index", "EulerAngles", "Fit", "Image Quality", "Phases", "SEM Signal", "X Position", "Y Position"]
Expand Down
4 changes: 2 additions & 2 deletions wrapping/python/examples/import_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Create the DataStructure object
data_structure = cx.DataStructure()

# Create the H5EbsdReaderParameter and assign values to it.
h5ebsdParameter = cxor.H5EbsdReaderParameter.ValueType()
# Create the ReadH5EbsdFileParameter and assign values to it.
h5ebsdParameter = cxor.ReadH5EbsdFileParameter.ValueType()
h5ebsdParameter.euler_representation=0
h5ebsdParameter.end_slice=117
h5ebsdParameter.selected_array_names=["Confidence Index", "EulerAngles", "Fit", "Image Quality", "Phases", "SEM Signal", "X Position", "Y Position"]
Expand Down

0 comments on commit 768994d

Please sign in to comment.