Skip to content

Commit

Permalink
Fix dimensionality check
Browse files Browse the repository at this point in the history
The dimensionality check seemed to fail the Op when the input had MORE
than two dimensions. It should fail the Op when the input has LESS than
two dimensions
  • Loading branch information
gselzer committed May 19, 2020
1 parent 65b9bb5 commit dd53936
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public RandomAccessibleInterval<T> calculate(
// output image
final RandomAccessibleInterval<T> output = (RandomAccessibleInterval<T>) ops().create().img(in());

if(input.numDimensions() > 2) {
if(input.numDimensions() < 2) {
throw new IllegalArgumentException("Input has too few dimensions! Only 2+ dimensional images allowed!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public RandomAccessibleInterval<T> calculate(
// output image
final RandomAccessibleInterval<T> output = (RandomAccessibleInterval<T>) ops().create().img(in());

if(input.numDimensions() > 2) {
if(input.numDimensions() < 2) {
throw new IllegalArgumentException("Input has too few dimensions! Only 2+ dimensional images allowed!");
}

Expand Down

0 comments on commit dd53936

Please sign in to comment.