18#ifndef itkSupportInputPointSetTypes_h
19#define itkSupportInputPointSetTypes_h
30#include "WebAssemblyInterfaceExport.h"
37WebAssemblyInterface_EXPORT
bool
90template <
template <
typename TPo
intSet>
class TPipelineFunctor,
typename... TPixels>
94 template <
unsigned int... VDimensions>
100 const auto iwpArgc = pipeline.
get_argc();
101 const auto iwpArgv = pipeline.
get_argv();
102 bool passThrough =
false;
103 for (
int ii = 0; ii < iwpArgc; ++ii)
105 const std::string arg(iwpArgv[ii]);
106 if (arg ==
"-h" || arg ==
"--help" || arg ==
"--interface-json" || arg ==
"--version")
116 auto tempOption = pipeline.add_option(inputPointSetOptionName, pointSetType,
"Read pointSet type.");
120 pipeline.remove_option(tempOption);
126 template <
unsigned int VDimension,
typename TPixel,
typename... TPixelsRest>
130 constexpr unsigned int Dimension = VDimension;
131 using PixelType = TPixel;
136 if (passThrough || components == 0 ||
150 else if (passThrough || components == ConvertPixelTraits::GetNumberOfComponents() || components == 0)
154 using PipelineType = TPipelineFunctor<PointSetType>;
155 return PipelineType()(pipeline);
159 if constexpr (
sizeof...(TPixelsRest) > 0)
164 std::ostringstream ostrm;
165 std::string pointSetTypeString = glz::write_json(pointSetType).value_or(
"error");
166 ostrm <<
"Unsupported pointSet type: " << pointSetTypeString << std::endl;
167 CLI::Error err(
"Runtime error", ostrm.str(), 1);
168 return pipeline.
exit(err);
171 template <
unsigned int VDimension,
unsigned int... VDimensions>
175 if (passThrough || VDimension == pointSetType.
dimension)
180 if constexpr (
sizeof...(VDimensions) > 0)
185 std::ostringstream ostrm;
186 ostrm <<
"Unsupported pointSet dimension: " << pointSetType.
dimension;
187 CLI::Error err(
"Runtime error", ostrm.str(), 1);
188 return pipeline.
exit(err);
Traits class used to by ConvertPixels to convert blocks of pixels.
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
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)
PointSet type JSON representation data structure.
unsigned int pointPixelComponents
JSONPixelTypesEnum pointPixelType
JSONComponentTypesEnum pointPixelComponentType
static constexpr JSONComponentTypesEnum JSONComponentEnum
static constexpr JSONPixelTypesEnum JSONPixelEnum