Skip to content

Commit 012c5eb

Browse files
committed
BIG WIP: lots of stuff
1 parent dc8418e commit 012c5eb

File tree

59 files changed

+137
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+137
-190
lines changed

src/main/java/net/imagej/ops/copy/CopyII.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class CopyII<T> implements Computers.Arity1<IterableInterval<T>, Iterable
6363
public void compute(final IterableInterval<T> input, final IterableInterval<T> output) {
6464
if (!input.iterationOrder().equals(output.iterationOrder()))
6565
throw new IllegalArgumentException("input and output must be of the same dimensions!");
66-
Computers.Arity1<Iterable<T>, Iterable<T>> mapped = Maps.Computers.Iterables.liftBoth(copyOp);
66+
Computers.Arity1<Iterable<T>, Iterable<T>> mapped = Maps.ComputerMaps.Iterables.liftBoth(copyOp);
6767
mapped.compute(input, output);
6868
}
6969
}

src/main/java/net/imagej/ops/deconvolve/RichardsonLucyCorrection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.scijava.ops.OpDependency;
4848
import org.scijava.ops.core.Op;
4949
import org.scijava.ops.function.Computers;
50-
import org.scijava.ops.function.Computers;
5150
import org.scijava.ops.function.Inplaces;
5251
import org.scijava.param.Parameter;
5352
import org.scijava.plugin.Plugin;
@@ -98,7 +97,6 @@ public class RichardsonLucyCorrection<I extends RealType<I>, O extends RealType<
9897
Double val1 = ioCursor.next().getRealDouble();
9998
inRA.setPosition(ioCursor);
10099
Double val2 = inRA.get().getRealDouble();
101-
if(val2 != 0) System.out.println(val2);
102100
if(val1 == 0) ioCursor.next().setReal(in3);
103101
else ioCursor.next().setReal(val2 / val1);
104102
}

src/main/java/net/imagej/ops/deconvolve/accelerate/VectorAccelerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class VectorAccelerator<T extends RealType<T> & NativeType<T>> implements
8888
public void mutate(RandomAccessibleInterval<T> yk_iterated) {
8989
T type = Util.getTypeFromInterval(yk_iterated);
9090
factory = new ArrayImgFactory<>(type);
91-
createReduced = Adapt.Functions.asFunction(create, type, factory);
91+
createReduced = Adapt.FunctionAdapt.asFunction(create, type, factory);
9292
accelerate(yk_iterated);
9393
}
9494

src/main/java/net/imagej/ops/filter/derivative/PartialDerivativeRAI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.scijava.ops.OpDependency;
4444
import org.scijava.ops.core.Op;
4545
import org.scijava.ops.function.Computers;
46-
import org.scijava.ops.function.Computers;
4746
import org.scijava.param.Parameter;
4847
import org.scijava.plugin.Plugin;
4948
import org.scijava.struct.ItemIO;
@@ -84,6 +83,7 @@ public class PartialDerivativeRAI<T extends RealType<T>>
8483
private Function<T, RandomAccessibleInterval<T>> sobelKernelCreator;
8584

8685
// TODO: is there any way to speed this up?
86+
@SuppressWarnings("unchecked")
8787
public void setupConvolves(RandomAccessibleInterval<T> input, Integer dimension) {
8888
RandomAccessibleInterval<T> kernel = sobelKernelCreator.apply(Util.getTypeFromInterval(input));
8989

@@ -140,7 +140,7 @@ public void setupConvolves(RandomAccessibleInterval<T> input, Integer dimension)
140140
dims = null;
141141

142142
// rotate kernel A to all other dimensions
143-
kernelAConvolveOps = new Computer[input.numDimensions()];
143+
kernelAConvolveOps = new Computers.Arity1[input.numDimensions()];
144144
if (dimension != 0) {
145145
// HACK needs to be final so that the compiler can encapsulate it.
146146
final RandomAccessibleInterval<T> finalKernelA = kernelA;

src/main/java/net/imagej/ops/filter/pad/DefaultPadInputFFT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class DefaultPadInputFFT<T extends ComplexType<T>, I extends RandomAccess
6666

6767
@Override
6868
protected Function<Dimensions, long[][]> getFFTSizeOp(boolean fast) {
69-
return Adapt.Functions.asFunction(fftSizeOp, fast);
69+
return Adapt.FunctionAdapt.asFunction(fftSizeOp, fast);
7070
}
7171

7272
}

src/main/java/net/imagej/ops/filter/pad/DefaultPadShiftKernelFFT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class DefaultPadShiftKernelFFT<T extends ComplexType<T>, I extends Random
6565

6666
@Override
6767
protected Function<Dimensions, long[][]> getFFTSizeOp() {
68-
return Adapt.Functions.asFunction(fftSizeOp, true);
68+
return Adapt.FunctionAdapt.asFunction(fftSizeOp, true);
6969
}
7070

7171

src/main/java/net/imagej/ops/filter/pad/PadInputFFTMethods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ public class PadInputFFTMethods<T extends ComplexType<T>, I extends RandomAccess
6666

6767
@Override
6868
protected Function<Dimensions, long[][]> getFFTSizeOp(boolean fast) {
69-
return Adapt.Functions.asFunction(fftSizeOp, true, fast);
69+
return Adapt.FunctionAdapt.asFunction(fftSizeOp, true, fast);
7070
}
7171
}

src/main/java/net/imagej/ops/filter/pad/PadShiftKernelFFTMethods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class PadShiftKernelFFTMethods<T extends ComplexType<T>, I extends Random
6767

6868
@Override
6969
protected Function<Dimensions, long[][]> getFFTSizeOp(){
70-
return Adapt.Functions.asFunction(fftSizeOp, true, true);
70+
return Adapt.FunctionAdapt.asFunction(fftSizeOp, true, true);
7171
}
7272

7373
}

src/main/java/net/imagej/ops/geom/geom3d/mesh/RAIToMeshConverter.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@
3030
package net.imagej.ops.geom.geom3d.mesh;
3131

3232
import java.lang.reflect.Type;
33+
import java.util.function.Function;
3334

3435
import net.imagej.mesh.Mesh;
35-
import net.imagej.ops.OpService;
36-
import net.imagej.ops.Ops;
37-
import net.imagej.ops.special.function.Functions;
38-
import net.imagej.ops.special.function.UnaryFunctionOp;
3936
import net.imglib2.IterableInterval;
4037
import net.imglib2.RandomAccessibleInterval;
38+
import net.imglib2.type.BooleanType;
4139

4240
import org.scijava.Priority;
4341
import org.scijava.convert.AbstractConverter;
4442
import org.scijava.convert.ConversionRequest;
4543
import org.scijava.convert.Converter;
44+
import org.scijava.ops.OpService;
45+
import org.scijava.ops.function.Functions;
46+
import org.scijava.ops.types.Nil;
4647
import org.scijava.plugin.Parameter;
4748
import org.scijava.plugin.Plugin;
4849

@@ -53,25 +54,24 @@
5354
*/
5455
@SuppressWarnings("rawtypes")
5556
@Plugin(type = Converter.class, priority = Priority.VERY_HIGH)
56-
public class RAIToMeshConverter extends
57-
AbstractConverter<RandomAccessibleInterval, Mesh>
57+
public class RAIToMeshConverter <B extends BooleanType<B>> extends
58+
AbstractConverter<RandomAccessibleInterval<B>, Mesh>
5859
{
5960

6061
@Parameter(required = false)
6162
private OpService ops;
6263

63-
private UnaryFunctionOp<RandomAccessibleInterval, Mesh> marchingCubesFunc;
64+
private Function<RandomAccessibleInterval<B>, Mesh> marchingCubesFunc;
6465

6566
@SuppressWarnings("unchecked")
6667
@Override
6768
public <T> T convert(Object src, Class<T> dest) {
6869
if (marchingCubesFunc == null) {
69-
marchingCubesFunc = Functions.match(ops,
70-
Ops.Geometric.MarchingCubes.class, Mesh.class,
71-
(RandomAccessibleInterval) src);
70+
marchingCubesFunc = Functions.match(ops, "geom.marchingCubes", new Nil<RandomAccessibleInterval<B>>() {},
71+
new Nil<Mesh>() {});
7272
}
7373
if (src instanceof IterableInterval<?>) {
74-
return (T) marchingCubesFunc.calculate((RandomAccessibleInterval) src);
74+
return (T) marchingCubesFunc.apply((RandomAccessibleInterval) src);
7575
}
7676
return null;
7777
}
@@ -81,9 +81,10 @@ public Class<Mesh> getOutputType() {
8181
return Mesh.class;
8282
}
8383

84+
@SuppressWarnings("unchecked")
8485
@Override
85-
public Class<RandomAccessibleInterval> getInputType() {
86-
return RandomAccessibleInterval.class;
86+
public Class<RandomAccessibleInterval<B>> getInputType() {
87+
return (Class) RandomAccessibleInterval.class;
8788
}
8889

8990
@Override

src/main/java/net/imagej/ops/logic/Ternary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* @author Leon Yang
4747
*/
48-
@Plugin(type = Op.class, name = "logic.ternary")
48+
@Plugin(type = Op.class, name = "logic.match")
4949
@Parameter(key = "input")
5050
@Parameter(key = "ifTrueVal")
5151
@Parameter(key = "ifFalseVal")

0 commit comments

Comments
 (0)