Skip to content

Commit 6dbef1a

Browse files
authored
Merge pull request #1446 from N-Dekker/style-SupportInputImageTypes-passThrough
Style improvements SupportInputImageTypes passThrough
2 parents 16d2e0c + 3a2c3ad commit 6dbef1a

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

include/itkSupportInputImageTypes.h

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,14 @@ class SupportInputImageTypes
9797

9898
const auto iwpArgc = pipeline.get_argc();
9999
const auto iwpArgv = pipeline.get_argv();
100-
bool passThrough = false;
101100
for (int ii = 0; ii < iwpArgc; ++ii)
102101
{
103102
const std::string arg(iwpArgv[ii]);
104103
if (arg == "-h" || arg == "--help" || arg == "--interface-json" || arg == "--version")
105104
{
106-
passThrough = true;
105+
return IterateDimensions<VDimensions...>(pipeline, imageType, true);
107106
}
108107
}
109-
if (passThrough)
110-
{
111-
return IterateDimensions<VDimensions...>(pipeline, imageType, passThrough);
112-
}
113108

114109
auto tempOption = pipeline.add_option(inputImageOptionName, imageType, "Read image type.");
115110

@@ -130,15 +125,13 @@ class SupportInputImageTypes
130125
using ConvertPixelTraits = DefaultConvertPixelTraits<PixelType>;
131126

132127
if (passThrough ||
133-
imageType.componentType == MapComponentType<typename ConvertPixelTraits::ComponentType>::JSONComponentEnum &&
134-
imageType.pixelType == MapPixelType<PixelType>::JSONPixelEnum)
135-
{
136-
if (passThrough || imageType.pixelType == JSONPixelTypesEnum::VariableLengthVector ||
128+
(imageType.componentType == MapComponentType<typename ConvertPixelTraits::ComponentType>::JSONComponentEnum &&
129+
imageType.pixelType == MapPixelType<PixelType>::JSONPixelEnum &&
130+
(imageType.pixelType == JSONPixelTypesEnum::VariableLengthVector ||
137131
imageType.pixelType == JSONPixelTypesEnum::VariableSizeMatrix ||
138-
imageType.components == ConvertPixelTraits::GetNumberOfComponents())
139-
{
140-
return SpecializedImagePipelineFunctor<TPipelineFunctor, Dimension, PixelType>()(pipeline);
141-
}
132+
imageType.components == ConvertPixelTraits::GetNumberOfComponents())))
133+
{
134+
return SpecializedImagePipelineFunctor<TPipelineFunctor, Dimension, PixelType>()(pipeline);
142135
}
143136

144137
if constexpr (sizeof...(TPixelsRest) > 0)

0 commit comments

Comments
 (0)