Skip to content

Commit

Permalink
ENH: Update Generate Color Table Filter and Parameter (#866)
Browse files Browse the repository at this point in the history
The ColorTableParameter was changed to take a string value that is the name of the preset.

Signed-off-by: Michael Jackson <[email protected]>
Co-authored-by: Michael Jackson <[email protected]>
  • Loading branch information
nyoungbq and imikejackson authored Feb 29, 2024
1 parent 93ca6a3 commit d4264ca
Show file tree
Hide file tree
Showing 25 changed files with 15,249 additions and 228 deletions.
28 changes: 21 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ endif()
file(TO_CMAKE_PATH "${CMAKE_COMMAND}" CMAKE_COMMAND_NORM)

project(simplnx
VERSION 1.2.4
VERSION 1.2.6
DESCRIPTION "SIMPL Redesign"
HOMEPAGE_URL "https://github.com/bluequartzsoftware/simplnx"
LANGUAGES CXX
Expand Down Expand Up @@ -209,10 +209,10 @@ endif()
# Force HDF5 1.10 API
target_compile_definitions(simplnx PUBLIC "H5_USE_110_API")

target_compile_options(simplnx
PUBLIC
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang,Intel>:-ffp-contract=off>
)
target_compile_options( simplnx PUBLIC
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang,Intel>: "-ffp-contract=off">
)


if(SIMPLNX_ENABLE_MULTICORE)
target_compile_definitions(simplnx PUBLIC "SIMPLNX_ENABLE_MULTICORE")
Expand Down Expand Up @@ -487,7 +487,7 @@ set(SIMPLNX_HDRS
${SIMPLNX_SOURCE_DIR}/Utilities/DataGroupUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/DataObjectUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/FilePathGenerator.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/ColorPresetsUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/ColorTableUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/FileUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/FilterUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/GeometryUtilities.hpp
Expand Down Expand Up @@ -704,7 +704,7 @@ set(SIMPLNX_SRCS
${SIMPLNX_SOURCE_DIR}/Utilities/OStreamUtilities.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/GeometryHelpers.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/GeometryUtilities.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/ColorPresetsUtilities.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/ColorTableUtilities.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/ImageRotationUtilities.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/Math/GeometryMath.cpp
${SIMPLNX_SOURCE_DIR}/Utilities/Math/MatrixMath.cpp
Expand Down Expand Up @@ -747,6 +747,20 @@ foreach(param ${CoreParameters})
)
endforeach()

# Generate Supporting Color Table File
file(READ ${simplnx_SOURCE_DIR}/resources/ColorTablePresets/ColorTablePresets.json COLOR_TABLE_JSON)
string(REGEX REPLACE "[ \t\n\r]+" " " COLOR_TABLE_FLAT ${COLOR_TABLE_JSON})
string(HEX ${COLOR_TABLE_FLAT} COLOR_TABLE_HEX)
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\0," COLOR_TABLE_HEX ${COLOR_TABLE_HEX})
string(APPEND COLOR_TABLE_HEX "0x00")

set(SIMPLNX_GENERATED_COLOR_TABLE_HEADER ${SIMPLNX_GENERATED_HEADER_DIR}/util/ColorTable.hpp)
cmpConfigureFileWithMD5Check(CONFIGURED_TEMPLATE_PATH ${SIMPLNX_SOURCE_DIR}/Parameters/util/ColorTable.in.hpp GENERATED_FILE_PATH ${SIMPLNX_GENERATED_COLOR_TABLE_HEADER})
list(APPEND SIMPLNX_GENERATED_HEADERS
${SIMPLNX_GENERATED_COLOR_TABLE_HEADER}
)

# Generate Python-Bindings Supporting Files
set(SIMPLNX_GENERATED_PYTHON_HEADER ${SIMPLNX_GENERATED_HEADER_DIR}/SimplnxPython.hpp)
set(SIMPLNX_PYTHON_MODULE "simplnx")
configure_file(${simplnx_SOURCE_DIR}/wrapping/python/CxPybind/SimplnxPython.hpp.in ${SIMPLNX_GENERATED_PYTHON_HEADER})
Expand Down
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "simplnx" %}
{% set version = "1.2.5" %}
{% set version = "1.2.6" %}

package:
name: {{ name|lower }}
Expand Down
2 changes: 1 addition & 1 deletion conda/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context:
version: "1.2.5"
version: "1.2.6"
name: simplnx

package:
Expand Down
36 changes: 2 additions & 34 deletions pipelines/Combo-EBSD-osc_r0c0.d3dpipeline
Original file line number Diff line number Diff line change
Expand Up @@ -231,40 +231,8 @@
"args": {
"output_rgb_array_name": "Feature Ids (Color)",
"selected_data_array_path": "DataContainer/CellData/FeatureIds",
"selected_preset": {
"ColorSpace": "RGB",
"Name": "hsv",
"RGBPoints": [
-1,
1,
0,
0,
-0.666666,
1,
0,
1,
-0.333333,
0,
0,
1,
0,
0,
1,
1,
0.33333,
0,
1,
0,
0.66666,
1,
1,
0,
1,
1,
0,
0
]
}
"selected_preset": "hsv",
"use_mask": false
},
"comments": "",
"filter": {
Expand Down
Loading

0 comments on commit d4264ca

Please sign in to comment.