4747import net .imglib2 .view .Views ;
4848
4949import org .junit .Test ;
50- import org .scijava .ops .core .builder .OpBuilder ;
5150import org .scijava .ops .function .Functions ;
5251import org .scijava .ops .types .Nil ;
5352import org .scijava .thread .ThreadService ;
@@ -148,7 +147,7 @@ public void testMTKTnone() {
148147 }
149148 Img <DoubleType > vImage1 = ArrayImgs .doubles (values1 , values1 .length );
150149 Img <DoubleType > vImage2 = ArrayImgs .doubles (values2 , values2 .length );
151- double result = new OpBuilder ( ops , "coloc.maxTKendallTau" ).input (vImage1 , vImage2 ).outType (Double .class ).apply ();
150+ double result = op ( "coloc.maxTKendallTau" ).input (vImage1 , vImage2 ).outType (Double .class ).apply ();
152151 assertEquals (4.9E-324 , result , 0.0 );
153152 }
154153
@@ -164,7 +163,7 @@ public void testMTKTall() {
164163 }
165164 Img <DoubleType > vImage1 = ArrayImgs .doubles (values1 , values1 .length );
166165 Img <DoubleType > vImage2 = ArrayImgs .doubles (values2 , values2 .length );
167- double result = (Double ) new OpBuilder ( ops , "coloc.maxTKendallTau" ).input (vImage1 , vImage2 ).apply ();
166+ double result = (Double ) op ( "coloc.maxTKendallTau" ).input (vImage1 , vImage2 ).apply ();
168167 assertEquals (1.0 , result , 0.0 );
169168 }
170169
@@ -178,7 +177,7 @@ public void testMTKTrandom() {
178177 0x01234567 );
179178 Img <FloatType > ch2 = ColocalisationTest .produceMeanBasedNoiseImage (new FloatType (), 24 , 24 , mean , spread , sigma ,
180179 0x98765432 );
181- double result = (Double ) new OpBuilder ( ops , "coloc.maxTKendallTau" ).input (ch1 , ch2 ).apply ();
180+ double result = (Double ) op ( "coloc.maxTKendallTau" ).input (ch1 , ch2 ).apply ();
182181 assertEquals (2.710687382741972 , result , 0.0 );
183182 }
184183
@@ -189,7 +188,7 @@ public void testMTKTimage() {
189188 new long [] { 0 , 0 , 0 }, new long [] { 20 , 20 , 0 });
190189 RandomAccessibleInterval <UnsignedByteType > cropCh2 = Views .interval (zeroCorrelationImageCh2 ,
191190 new long [] { 0 , 0 , 0 }, new long [] { 20 , 20 , 0 });
192- double result = (Double ) new OpBuilder ( ops , "coloc.maxTKendallTau" ).input (cropCh1 , cropCh2 ).apply ();
191+ double result = (Double ) op ( "coloc.maxTKendallTau" ).input (cropCh1 , cropCh2 ).apply ();
193192 assertEquals (2.562373279563565 , result , 0.0 );
194193 }
195194
@@ -211,7 +210,7 @@ public void testMTKTpValueNone() {
211210 BiFunction <RandomAccessibleInterval <DoubleType >, RandomAccessibleInterval <DoubleType >, Double > op =
212211 Functions .match (ops , "coloc.maxTKendallTau" , new Nil <RandomAccessibleInterval <DoubleType >>() {}, new Nil <RandomAccessibleInterval <DoubleType >>() {}, new Nil <Double >() {});
213212 PValueResult value = new PValueResult ();
214- new OpBuilder ( ops , "coloc.pValue" ).input (vImage1 , vImage2 , op , 5 , es , value ).apply ();
213+ op ( "coloc.pValue" ).input (vImage1 , vImage2 , op , 5 , es , value ).apply ();
215214 assertEquals (0.0 , value .getPValue (), 0.0 );
216215 }
217216
@@ -231,7 +230,7 @@ public void testMTKTpValueAll() {
231230 BiFunction <RandomAccessibleInterval <DoubleType >, RandomAccessibleInterval <DoubleType >, Double > op =
232231 Functions .match (ops , "coloc.maxTKendallTau" , new Nil <RandomAccessibleInterval <DoubleType >>() {}, new Nil <RandomAccessibleInterval <DoubleType >>() {}, new Nil <Double >() {});
233232 PValueResult value = new PValueResult ();
234- new OpBuilder ( ops , "coloc.pValue" ).input (vImage1 , vImage2 , op , 5 , es , value ).apply ();
233+ op ( "coloc.pValue" ).input (vImage1 , vImage2 , op , 5 , es , value ).apply ();
235234 assertEquals (0.0 , value .getPValue (), 0.0 );
236235 }
237236
@@ -249,7 +248,7 @@ public void testMTKTpValueRandom() {
249248 BiFunction <RandomAccessibleInterval <FloatType >, RandomAccessibleInterval <FloatType >, Double > op =
250249 Functions .match (ops , "coloc.maxTKendallTau" , new Nil <RandomAccessibleInterval <FloatType >>() {}, new Nil <RandomAccessibleInterval <FloatType >>() {}, new Nil <Double >() {});
251250 PValueResult value = new PValueResult ();
252- new OpBuilder ( ops , "coloc.pValue" ).input (ch1 , ch2 , op , 10 , es , value ).apply ();
251+ op ( "coloc.pValue" ).input (ch1 , ch2 , op , 10 , es , value ).apply ();
253252 assertEquals (0.2 , value .getPValue (), 0.0 );
254253 }
255254
@@ -271,7 +270,7 @@ public void testMTKTpValueImage() {
271270 RandomAccessibleInterval <UnsignedByteType > ch1 = ShuffledView .cropAtMin (cropCh1 , blockSize );
272271 RandomAccessibleInterval <UnsignedByteType > ch2 = ShuffledView .cropAtMin (cropCh2 , blockSize );
273272 PValueResult value = new PValueResult ();
274- new OpBuilder ( ops , "coloc.pValue" ).input (ch1 , ch2 , op , 5 , es , value ).apply ();
273+ op ( "coloc.pValue" ).input (ch1 , ch2 , op , 5 , es ). output ( value ).compute ();
275274 assertEquals (0.2 , value .getPValue (), 0.0 );
276275 }
277276}
0 commit comments