Hi @gselzer,
The DimensionIterable class in DefaultProjectParallel (see below) does not project any data from negative coordinates in the projection dimension, basically assuming that the RAI has a zero valued origin. This causes the projection to be incomplete if the data spans into negative coordinates. In line 109, k is statically set to -1, when it should probably be set to the min value for that dimension. I think this would require another parameter (starting position?), and passing it a value of input.min(dim), then subtracting 1 from that. Luckily this is a nested class and this change doesn't seem like it should affect the Op call.
This issue also seems to be present in ImageJ ops, but I know we're not updating that any more.
|
final class DimensionIterable implements Iterable<T> { |
|
|
|
private final long size; |
|
private final int dim; |
|
private final RandomAccess<T> access; |
|
|
|
public DimensionIterable(final long size, final int dim, |
|
final RandomAccess<T> access) |
|
{ |
|
this.size = size; |
|
this.dim = dim; |
|
this.access = access; |
|
} |
|
|
|
@Override |
|
public Iterator<T> iterator() { |
|
return new Iterator<T>() { |
|
|
|
int k = -1; |
|
|
|
@Override |
|
public boolean hasNext() { |
|
return k < size - 1; |
|
} |
|
|
|
@Override |
|
public T next() { |
|
k++; |
|
access.setPosition(k, dim); |
|
return access.get(); |
|
} |
|
|
|
@Override |
|
public void remove() { |
|
throw new UnsupportedOperationException("Not supported"); |
|
} |
|
}; |
|
} |
|
} |
Hi @gselzer,
The
DimensionIterableclass in DefaultProjectParallel (see below) does not project any data from negative coordinates in the projection dimension, basically assuming that the RAI has a zero valued origin. This causes the projection to be incomplete if the data spans into negative coordinates. In line 109,kis statically set to -1, when it should probably be set to the min value for that dimension. I think this would require another parameter (starting position?), and passing it a value ofinput.min(dim), then subtracting 1 from that. Luckily this is a nested class and this change doesn't seem like it should affect the Op call.This issue also seems to be present in ImageJ ops, but I know we're not updating that any more.
scijava/scijava-ops-image/src/main/java/org/scijava/ops/image/transform/project/project/DefaultProjectParallel.java
Lines 91 to 129 in 82d58a2