30 const std::string & key,
33 int status = EXIT_SUCCESS;
36#if defined ITK_FUTURE_LEGACY_REMOVE
38 !std::is_same_v<itk::Array<char>, T>,
39 "Should not use the ambiguous 'char' stored in meta data, because it is not-cross platform consistent.");
41 !std::is_same_v<char, T>,
42 "Should not use the ambiguous 'char' stored in meta data, because it is not-cross platform consistent.");
45 std::cerr <<
"Failure ExposeMetaData for key '" << key <<
"'" << std::endl;
46 status = EXIT_FAILURE;
49 if constexpr (std::is_same_v<itk::Array<char>, T>)
59 if constexpr (std::is_signed_v<char>)
64 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
65 status = EXIT_FAILURE;
67 exposedValue = temp_value;
74 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
75 status = EXIT_FAILURE;
77 exposedValue = temp_value;
81 else if constexpr (std::is_same_v<char, T>)
91 if constexpr (std::is_signed_v<char>)
93 signed char temp_value{};
97 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
98 status = EXIT_FAILURE;
100 exposedValue =
static_cast<T
>(temp_value);
104 unsigned char temp_value{};
107 std::cerr <<
"Failure ExposeMetaData '" << key <<
"'" << std::endl;
108 status = EXIT_FAILURE;
110 exposedValue =
static_cast<T
>(temp_value);
116 std::cerr <<
"Failure ExposeMetaData of boolean type '" << key <<
"'" << std::endl;
117 status = EXIT_FAILURE;
122 if constexpr (std::is_floating_point_v<T>)
126 std::cerr <<
"Incorrect meta value read in for " << key <<
" '" << exposedValue <<
"' != '" << knownValue <<
"'"
128 status = EXIT_FAILURE;
133 if (exposedValue != knownValue)
135 std::cerr <<
"Incorrect meta value read in for " << key <<
" '" << exposedValue <<
"' != '" << knownValue <<
"'"
137 status = EXIT_FAILURE;
140 if (status == EXIT_FAILURE)
142 std::cerr <<
"========================================" << std::endl;
143 metaDict.
Print(std::cerr);
144 std::cerr <<
"========================================" << std::endl;