Skip to content

Commit dc0e971

Browse files
committed
Fix a bunch of deprecated ImgFactory calls
Accomplished via: sed -i '' -e 's/\(new [A-Za-z]*ImgFactory<\)[^>]*>().create(\(.*\), \(new [A-Za-z]*Type()\));/\1>(\3).create(\2);/' $(git grep -l 'new .*ImgFactory<[^>]*>()')
1 parent 5c978af commit dc0e971

File tree

28 files changed

+45
-45
lines changed

28 files changed

+45
-45
lines changed

src/test/java/net/imagej/ops/copy/CopyIITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class CopyIITest extends AbstractOpTest {
5656

5757
@Before
5858
public void createData() {
59-
input = new PlanarImgFactory<DoubleType>().create(new int[] { 120, 100 }, new DoubleType());
59+
input = new PlanarImgFactory<>(new DoubleType()).create(new int[] { 120, 100 });
6060

6161
final MersenneTwisterFast r = new MersenneTwisterFast(System.currentTimeMillis());
6262

@@ -85,7 +85,7 @@ public void copyRAINoOutputTest() {
8585

8686
@Test
8787
public void copyTypeTest() {
88-
Img<FloatType> inputFloat = new ArrayImgFactory<FloatType>().create(new int[] { 120, 100 }, new FloatType());
88+
Img<FloatType> inputFloat = new ArrayImgFactory<>(new FloatType()).create(new int[] { 120, 100 });
8989

9090
@SuppressWarnings("unchecked")
9191
Img<FloatType> output = (Img<FloatType>) ops.run("copy.iterableInterval", inputFloat);

src/test/java/net/imagej/ops/copy/CopyRAITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class CopyRAITest extends AbstractOpTest {
7878

7979
@Before
8080
public void createData() {
81-
input = new ArrayImgFactory<UnsignedByteType>().create(new int[] { 120, 100 }, new UnsignedByteType());
81+
input = new ArrayImgFactory<>(new UnsignedByteType()).create(new int[] { 120, 100 });
8282

8383
final MersenneTwisterFast r = new MersenneTwisterFast(System.currentTimeMillis());
8484

src/test/java/net/imagej/ops/deconvolve/DeconvolveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void testDeconvolve() {
6565
int[] size = new int[] { 225, 167 };
6666

6767
// create an input with a small sphere at the center
68-
Img<FloatType> in = new ArrayImgFactory<FloatType>().create(size, new FloatType());
68+
Img<FloatType> in = new ArrayImgFactory<>(new FloatType()).create(size);
6969
placeSphereInCenter(in);
7070

7171
// crop the image so the sphere is truncated at the corner

src/test/java/net/imagej/ops/transform/addDimensionView/AddDimensionViewTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class AddDimensionViewTest extends AbstractTestEnvironment {
6060

6161
@Test
6262
public void addDimensionTest() {
63-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
63+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
6464

6565
MixedTransformView<DoubleType> il2 = Views.addDimension((RandomAccessible<DoubleType>) img);
6666

@@ -84,7 +84,7 @@ public void addDimensionTest() {
8484

8585
@Test
8686
public void addDimensionMinMaxTest() {
87-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
87+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
8888
long max = 20;
8989
long min = 0;
9090

src/test/java/net/imagej/ops/transform/collapseView/CollapseViewTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class CollapseViewTest extends AbstractTestEnvironment {
6161

6262
@Test
6363
public void defaultCollapseTest() {
64-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
64+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
6565

6666
Function<RandomAccessibleInterval<DoubleType>, CompositeIntervalView<DoubleType, ? extends GenericComposite<DoubleType>>> collapseFunc = Functions
6767
.unary(ops, "transform.collapseView", new Nil<RandomAccessibleInterval<DoubleType>>() {
@@ -77,7 +77,7 @@ public void defaultCollapseTest() {
7777
@Test
7878
public void collapseRATest() {
7979

80-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10, 10 }, new DoubleType());
80+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10, 10 });
8181

8282
Function<RandomAccessible<DoubleType>, CompositeView<DoubleType, ? extends GenericComposite<DoubleType>>> collapseFunc = Functions
8383
.unary(ops, "transform.collapseView", new Nil<RandomAccessible<DoubleType>>() {

src/test/java/net/imagej/ops/transform/dropSingleDimensionsView/DropSingletonDimensionsViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void dropSingletonDimensionsTest() {
6363
}, new Nil<RandomAccessibleInterval<DoubleType>>() {
6464
});
6565

66-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 1, 10 }, new DoubleType());
66+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 1, 10 });
6767

6868
RandomAccessibleInterval<DoubleType> il2 = Views.dropSingletonDimensions(img);
6969

src/test/java/net/imagej/ops/transform/extendBorderView/ExtendBorderViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void extendBorderTest() {
6767
new Nil<RandomAccessible<DoubleType>>() {
6868
});
6969

70-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
70+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
7171

7272
RandomAccess<DoubleType> il2 = Views.extendBorder(img).randomAccess();
7373

src/test/java/net/imagej/ops/transform/extendMirrorDoubleView/ExtendMirrorDoubleViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void extendMirrorDoubleTest() {
6767
new Nil<RandomAccessible<DoubleType>>() {
6868
});
6969

70-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
70+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
7171

7272
RandomAccess<DoubleType> il2 = Views.extendMirrorDouble(img).randomAccess();
7373

src/test/java/net/imagej/ops/transform/extendMirrorSingleView/ExtendMirrorSingleViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void extendMirrorSingleTest() {
6767
new Nil<RandomAccessible<DoubleType>>() {
6868
});
6969

70-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
70+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
7171

7272
RandomAccess<DoubleType> il2 = Views.extendMirrorSingle(img).randomAccess();
7373

src/test/java/net/imagej/ops/transform/extendPeriodicView/ExtendPeriodicViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void extendPeriodicTest() {
6767
new Nil<RandomAccessible<DoubleType>>() {
6868
});
6969

70-
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
70+
Img<DoubleType> img = new ArrayImgFactory<>(new DoubleType()).create(new int[] { 10, 10 });
7171

7272
RandomAccess<DoubleType> il2 = Views.extendPeriodic(img).randomAccess();
7373

0 commit comments

Comments
 (0)