Skip to content
Snippets Groups Projects
Commit 04897748 authored by Julien Malik's avatar Julien Malik
Browse files

WRG: tentative fix for warning: case value '0' not in enumerated type

parent e5f270a2
No related branches found
No related tags found
No related merge requests found
......@@ -163,48 +163,37 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation>
SubsampledImageRegionConstIterator<InputImageType> inputIter
(this->GetInput(), inputRegionForThread);
switch (DirectionOfTransformation)
if (static_cast<int>(itkGetStaticConstMacro(DirectionOfTransformation))
== static_cast<int>(Wavelet::FORWARD))
{
case static_cast<int>(Wavelet::FORWARD):
{
inputIter.SetSubsampleFactor(GetSubsampleFactor());
inputIter.GoToBegin();
while (!inputIter.IsAtEnd())
{
outputIter.SetOffset(
static_cast<typename SubsampledImageRegionIterator<OutputImageType>::OffsetType>
(inputIter.GetOffset()));
outputIter.Set(static_cast<OutputPixelType>(inputIter.Get()));
++inputIter;
}
inputIter.SetSubsampleFactor(GetSubsampleFactor());
inputIter.GoToBegin();
break;
}
case static_cast<int>(Wavelet::INVERSE):
while (!inputIter.IsAtEnd())
{
inputIter.SetSubsampleFactor(1);
inputIter.GoToBegin();
outputIter.SetOffset(
static_cast<typename SubsampledImageRegionIterator<OutputImageType>::OffsetType>
(inputIter.GetOffset()));
outputIter.Set(static_cast<OutputPixelType>(inputIter.Get()));
++inputIter;
}
}
else
{
inputIter.SetSubsampleFactor(1);
inputIter.GoToBegin();
while (!inputIter.IsAtEnd())
while (!inputIter.IsAtEnd())
{
InputImageIndexType inputIndex = inputIter.GetIndex();
OutputImageIndexType outputIndex;
for (unsigned int i = 0; i < OutputImageDimension; i++)
{
InputImageIndexType inputIndex = inputIter.GetIndex();
OutputImageIndexType outputIndex;
for (unsigned int i = 0; i < OutputImageDimension; i++)
{
outputIndex[i] = inputIndex[i] * m_SubsampleFactor[i];
}
outputIter.SetIndex(outputIndex);
outputIter.Set(static_cast<OutputPixelType>(inputIter.Get()));
++inputIter;
outputIndex[i] = inputIndex[i] * m_SubsampleFactor[i];
}
break;
}
default:
{
itkExceptionMacro(<< "otb::SubsampleImageFilter have to be Wavelet::FORWARD or Wavelet::INVERSE only!!");
break;
outputIter.SetIndex(outputIndex);
outputIter.Set(static_cast<OutputPixelType>(inputIter.Get()));
++inputIter;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment