Skip to content

Commit

Permalink
fix: AxisUtils defaultN5ViewerAxes up to 5d
Browse files Browse the repository at this point in the history
* handles some unusual cases
  • Loading branch information
bogovicj committed Jun 12, 2024
1 parent 05d9672 commit 66aae89
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ public static <T, M extends AxisMetadata & N5Metadata> RandomAccessibleInterval<
fillPermutation( p );

// TODO under what conditions can I return the image directly?

RandomAccessibleInterval<T> imgTmp = img;
while( imgTmp.numDimensions() < 5 )
imgTmp = Views.addDimension(imgTmp, 0, 0 );
Expand Down Expand Up @@ -436,12 +435,14 @@ public static DefaultAxisMetadata defaultN5ViewerAxes(final N5SpatialDatasetMeta
final int nd = meta.getAttributes().getNumDimensions();

final String[] labels;
if (nd == 2)
if (nd == 2)
labels = new String[]{"x", "y"};
else if (nd == 3)
else if (nd == 3)
labels = new String[]{"x", "y", "z"};
else if( nd == 4)
else if (nd == 4)
labels = new String[]{"x", "y", "z", "t"};
else if (nd == 5)
labels = new String[]{"x", "y", "z", "c", "t"};
else
return null;

Expand Down

0 comments on commit 66aae89

Please sign in to comment.