Skip to content

Commit dd53936

Browse files
committed
Fix dimensionality check
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
1 parent 65b9bb5 commit dd53936

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/net/imagej/ops/filter/sharpen/DefaultSharpen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public RandomAccessibleInterval<T> calculate(
112112
// output image
113113
final RandomAccessibleInterval<T> output = (RandomAccessibleInterval<T>) ops().create().img(in());
114114

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

src/main/java/net/imagej/ops/filter/smooth/DefaultSmooth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public RandomAccessibleInterval<T> calculate(
112112
// output image
113113
final RandomAccessibleInterval<T> output = (RandomAccessibleInterval<T>) ops().create().img(in());
114114

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

0 commit comments

Comments
 (0)