Skip to content

Commit 3584bce

Browse files
committed
Use Dimensions methods instead of creating arrays
1 parent 4fa639c commit 3584bce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/net/imglib2/algorithm/metrics/segmentation/MultiMetrics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public static < I extends IntegerType< I >, J extends IntegerType< J > > HashMap
339339

340340
// check if it is a time-lapse
341341
boolean timeLapse = false;
342-
if ( groundTruth.dimensionsAsLongArray().length > T_AXIS )
342+
if ( groundTruth.numDimensions() > T_AXIS )
343343
{
344344
timeLapse = groundTruth.dimension( T_AXIS ) > 1;
345345
}
@@ -377,7 +377,7 @@ protected static < I extends IntegerType< I >, J extends IntegerType< J > > Metr
377377
RandomAccessibleInterval< J > prediction,
378378
double threshold )
379379
{
380-
int nFrames = Intervals.dimensionsAsIntArray( groundTruth )[ T_AXIS ];
380+
int nFrames = ( int ) groundTruth.dimension( T_AXIS );
381381

382382
final MetricsSummary metrics = new MetricsSummary();
383383

src/main/java/net/imglib2/algorithm/metrics/segmentation/SEGMetrics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static < I extends IntegerType< I >, J extends IntegerType< J > > double
130130

131131
// check if it is a time-lapse
132132
boolean timeLapse = false;
133-
if ( groundTruth.dimensionsAsLongArray().length > T_AXIS )
133+
if ( groundTruth.numDimensions() > T_AXIS )
134134
{
135135
timeLapse = groundTruth.dimension( T_AXIS ) > 1;
136136
}
@@ -150,7 +150,7 @@ private static < I extends IntegerType< I >, J extends IntegerType< J > > double
150150
RandomAccessibleInterval< I > groundTruth,
151151
RandomAccessibleInterval< J > prediction )
152152
{
153-
int nFrames = Intervals.dimensionsAsIntArray( groundTruth )[ T_AXIS ];
153+
int nFrames = ( int ) groundTruth.dimension( T_AXIS );
154154

155155
double sumScores = 0.;
156156
double nGT = 0.;

0 commit comments

Comments
 (0)