18#ifndef itkSupportInputPolyDataTypes_h
19#define itkSupportInputPolyDataTypes_h
30#include "WebAssemblyInterfaceExport.h"
37WebAssemblyInterface_EXPORT
bool
86template <
template <
typename TPolyData>
class TPipelineFunctor>
90 template <
typename... TPixels>
96 const auto iwpArgc = pipeline.
get_argc();
97 const auto iwpArgv = pipeline.
get_argv();
98 bool passThrough =
false;
99 for (
int ii = 0; ii < iwpArgc; ++ii)
101 const std::string arg(iwpArgv[ii]);
102 if (arg ==
"-h" || arg ==
"--help" || arg ==
"--interface-json" || arg ==
"--version")
112 auto tempOption = pipeline.add_option(inputPolyDataOptionName, polyDataType,
"Read PolyData type.");
116 pipeline.remove_option(tempOption);
122 template <
typename TPixel,
typename... TPixelsRest>
126 using PixelType = TPixel;
129 const auto components =
132 if (passThrough || components == 0 ||
146 else if (passThrough || components == ConvertPixelTraits::GetNumberOfComponents() || components == 0)
150 using PipelineType = TPipelineFunctor<PolyDataType>;
151 return PipelineType()(pipeline);
155 if constexpr (
sizeof...(TPixelsRest) > 0)
160 std::ostringstream ostrm;
161 std::string polyDataTypeString = glz::write_json(polyDataType).value_or(
"error");
162 ostrm <<
"Unsupported polyData type: " << polyDataTypeString << std::endl;
163 CLI::Error err(
"Runtime error", ostrm.str(), 1);
164 return pipeline.
exit(err);
Traits class used to by ConvertPixels to convert blocks of pixels.
Geometry class compatible with vtk.js PolyData.
auto exit(const CLI::Error &e) -> int
#define ITK_WASM_PRE_PARSE(pipeline)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
WebAssemblyInterface_EXPORT bool lexical_cast(const std::string &input, ImageTypeJSON &imageType)
PolyData type JSON representation data structure.
unsigned int pointPixelComponents
JSONPixelTypesEnum pointPixelType
JSONComponentTypesEnum pointPixelComponentType
unsigned int cellPixelComponents
static constexpr JSONComponentTypesEnum JSONComponentEnum
static constexpr JSONPixelTypesEnum JSONPixelEnum