Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Pisarev committed Apr 9, 2018
1 parent fbfe701 commit 08a57ca
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public class N5ExportMetadataReader

public int getNumChannels() throws IOException
{
return n5Reader.list( "" ).length;
return n5Reader.list( "/" ).length;
}

public String getName() throws IOException { return getAttribute( nameKey, String.class ); }
public String getName() throws IOException
{
return getAttribute( nameKey, String.class );
}

public AffineTransform3D getAffineTransform( final int channel ) throws IOException { return getAttribute( channel, affineTransformKey, AffineTransform3D.class ); }
public double[][] getScales( final int channel ) throws IOException
{
// check the root scales attribute
Expand Down Expand Up @@ -111,10 +113,14 @@ else if ( !Arrays.equals( pixelResolutionArr, pixelResolutionDatasetArr ) )
return pixelResolution;
}

public AffineTransform3D getAffineTransform( final int channel ) throws IOException
{
return getAttribute( channel, affineTransformKey, AffineTransform3D.class );
}

private < T > T getAttribute( final String key, final Class< T > clazz ) throws IOException
{
return n5Reader.getAttribute( "", key, clazz );
return n5Reader.getAttribute( "/", key, clazz );
}

private < T > T getAttribute( final int channel, final String key, final Class< T > clazz ) throws IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,44 @@ public class N5ExportMetadataWriter extends N5ExportMetadataReader
this.n5Writer = n5Writer;
}

public void setName( final String name ) throws IOException { setAttribute( nameKey, name ); }
public void setName( final String name ) throws IOException
{
setAttribute( nameKey, name );
}

public void setDefaultScales( final double[][] scales ) throws IOException
{
setAttribute( scalesKey, scales );
}

public void setDefaultPixelResolution( final VoxelDimensions pixelResolution ) throws IOException
{
setAttribute( pixelResolutionKey, pixelResolution );
}

public void setDefaultAffineTransform( final AffineTransform3D affineTransform ) throws IOException
{
setAttribute( affineTransformKey, affineTransform );
}

public void setDefaultScales( final double[][] scales ) throws IOException { setAttribute( scalesKey, scales ); }
public void setDefaultPixelResolution( final VoxelDimensions pixelResolution ) throws IOException { setAttribute( pixelResolutionKey, pixelResolution ); }
public void setDefaultAffineTransform( final AffineTransform3D affineTransform ) throws IOException { setAttribute( affineTransformKey, affineTransform ); }
public void setScales( final int channel, final double[][] scales ) throws IOException
{
setAttribute( channel, scalesKey, scales );
}

public void setScales( final int channel, final double[][] scales ) throws IOException { setAttribute( channel, scalesKey, scales ); }
public void setPixelResolution( final int channel, final VoxelDimensions pixelResolution ) throws IOException { setAttribute( channel, pixelResolutionKey, pixelResolution ); }
public void setAffineTransform( final int channel, final AffineTransform3D affineTransform ) throws IOException { setAttribute( channel, affineTransformKey, affineTransform ); }
public void setPixelResolution( final int channel, final VoxelDimensions pixelResolution ) throws IOException
{
setAttribute( channel, pixelResolutionKey, pixelResolution );
}

public void setAffineTransform( final int channel, final AffineTransform3D affineTransform ) throws IOException
{
setAttribute( channel, affineTransformKey, affineTransform );
}

private < T > void setAttribute( final String key, final T value ) throws IOException
{
n5Writer.setAttribute( "", key, value );
n5Writer.setAttribute( "/", key, value );
}

private < T > void setAttribute( final int channel, final String key, final T value ) throws IOException
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/janelia/saalfeldlab/n5/bdv/N5Viewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ final public static < T extends NumericType< T > & NativeType< T >, V extends Vo
final BdvOptions bdvOptions = BdvOptions.options();
bdvOptions.frameTitle( "N5 Viewer" );

Prefs.showScaleBar(true);
Prefs.showScaleBar( true );

final SharedQueue sharedQueue = new SharedQueue( Math.max( 1, Runtime.getRuntime().availableProcessors() / 2 ) );

Expand Down

0 comments on commit 08a57ca

Please sign in to comment.