Skip to content

Commit

Permalink
ConvertOrientations: Fix issue when trying to convert to Stereographi…
Browse files Browse the repository at this point in the history
…c coords

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Sep 15, 2023
1 parent f93e3de commit d67753f
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,16 @@ void ConvertOrientations::dataCheck()
setErrorCondition(-1000, ss);
}

int32_t minIndex = OrientationConverter<FloatArrayType, float>::GetMinIndex();
int32_t maxIndex = OrientationConverter<FloatArrayType, float>::GetMaxIndex();

if(getInputType() < minIndex || getInputType() > maxIndex)
if(static_cast<int>(getInputType()) < 0 || getInputType() >= static_cast<int>(OrientationRepresentation::Type::Unknown))
{
QString ss = QObject::tr("There was an error with the selection of the input orientation type. The valid values range from 0 to %1").arg(maxIndex);
QString ss = QObject::tr("There was an error with the selection of the input orientation type. The valid values range from 0 to %1").arg(static_cast<int>(OrientationRepresentation::Type::Unknown));
setErrorCondition(-1001, ss);
}

if(getOutputType() < minIndex || getOutputType() > maxIndex)
if(static_cast<int>(getOutputType()) < 0 || getOutputType() >= static_cast<int>(OrientationRepresentation::Type::Unknown))
{
QString ss = QObject::tr("There was an error with the selection of the output orientation type. The valid values range from 0 to %1").arg(maxIndex);
QString ss = QObject::tr("There was an error with the selection of the output orientation type. The valid values range from 0 to %1").arg(static_cast<int>(OrientationRepresentation::Type::Unknown));
setErrorCondition(-1002, ss);
}

Expand Down

0 comments on commit d67753f

Please sign in to comment.