Skip to content

Commit

Permalink
fixed subpackages and added benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
dietzc committed Sep 11, 2013
1 parent b8d4c02 commit 10b6f80
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/test/java/net/imglib2/view/OpenAndDisplayRotated.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.display.ARGBScreenImage;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.img.array.ArrayImgFactory;
import net.imglib2.io.ImgIOException;
import net.imglib2.io.ImgOpener;
Expand All @@ -56,7 +56,7 @@ final static public void main( final String[] args )
0, 1 );

final ARGBScreenImage screenImage = new ARGBScreenImage( ( int )img.dimension( 0 ), ( int )img.dimension( 1 ) );
final XYProjector< FloatType, ARGBType > projector = new XYProjector< FloatType, ARGBType >( img, screenImage, new RealARGBConverter< FloatType >( 0, 127 ) );
final Projector2D< FloatType, ARGBType > projector = new Projector2D< FloatType, ARGBType >( 0, 1, img, screenImage, new RealARGBConverter< FloatType >( 0, 127 ) );

final ColorProcessor cp = new ColorProcessor( screenImage.image() );
final ImagePlus imp = new ImagePlus( "argbScreenProjection", cp );
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/tests/ImgPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

import net.imglib2.display.ARGBScreenImage;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.img.ImgPlus;
Expand Down Expand Up @@ -73,7 +73,7 @@ public class ImgData<T extends RealType<T> & NativeType<T>> {
public int width, height;
public ARGBScreenImage screenImage;
public RealARGBConverter<T> converter;
public XYProjector<T, ARGBType> projector;
public Projector2D<T, ARGBType> projector;

public ImgData(final String name, final ImgPlus<T> imgPlus,
final ImgPanel owner)
Expand All @@ -87,7 +87,7 @@ public ImgData(final String name, final ImgPlus<T> imgPlus,
final int min = 0, max = 255;
converter = new RealARGBConverter<T>(min, max);
projector =
new XYProjector<T, ARGBType>(imgPlus, screenImage, converter);
new Projector2D<T, ARGBType>(0, 1, imgPlus, screenImage, converter);
projector.map();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/tests/LanczosExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import net.imglib2.RandomAccessible;
import net.imglib2.display.ARGBScreenImage;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYRandomAccessibleProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.img.Img;
import net.imglib2.img.ImgPlus;
import net.imglib2.img.array.ArrayImgFactory;
Expand Down Expand Up @@ -84,7 +84,7 @@ final static public void main( final String[] args )
final AffineRandomAccessible< UnsignedShortType, AffineGet > mapping = new AffineRandomAccessible< UnsignedShortType, AffineGet >( interpolant, affine );

final ARGBScreenImage screenImage = new ARGBScreenImage( ( int )img.dimension( 0 ), ( int )img.dimension( 1 ) );
final XYRandomAccessibleProjector< UnsignedShortType, ARGBType > projector = new XYRandomAccessibleProjector< UnsignedShortType, ARGBType >( mapping, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );
final Projector2D< UnsignedShortType, ARGBType > projector = new Projector2D< UnsignedShortType, ARGBType >( 0, 1, mapping, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );

final ColorProcessor cp = new ColorProcessor( screenImage.image() );
final ImagePlus imp = new ImagePlus( "argbScreenProjection", cp );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import net.imglib2.RandomAccessible;
import net.imglib2.display.ARGBScreenImage;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYRandomAccessibleProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.img.Img;
import net.imglib2.img.ImgPlus;
import net.imglib2.img.array.ArrayImgFactory;
Expand Down Expand Up @@ -91,7 +91,7 @@ final static public void main( final String[] args )
final ARGBScreenImage screenImage = new ARGBScreenImage( cp.getWidth(), cp.getHeight(), ( int[] )cp.getPixels() );
// final XYProjector< UnsignedShortType, ARGBType > projector = new XYProjector< UnsignedShortType, ARGBType >( mapping, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );
// final XYProjector< UnsignedShortType, ARGBType > projector = new XYProjector< UnsignedShortType, ARGBType >( transformedPixels, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );
final XYRandomAccessibleProjector< UnsignedShortType, ARGBType > projector = new XYRandomAccessibleProjector< UnsignedShortType, ARGBType >( mapping, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );
final Projector2D< UnsignedShortType, ARGBType > projector = new Projector2D< UnsignedShortType, ARGBType >(0, 1, mapping, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );
// final XYRandomAccessibleProjector< UnsignedShortType, ARGBType > projector = new XYRandomAccessibleProjector< UnsignedShortType, ARGBType >( transformedPixels, screenImage, new RealARGBConverter< UnsignedShortType >( 0, 4095 ) );

final ImagePlus imp = new ImagePlus( "argbScreenProjection", cp );
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/tests/OpenAndDisplayScreenImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.display.ARGBScreenImage;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.img.array.ArrayImgFactory;
import net.imglib2.io.ImgIOException;
import net.imglib2.io.ImgOpener;
Expand All @@ -54,7 +54,7 @@ final static public void main( final String[] args )
RandomAccessibleInterval< FloatType > img = io.openImg( "/home/tobias/workspace/data/73_float.tif", new ArrayImgFactory<FloatType>(), new FloatType());

final ARGBScreenImage screenImage = new ARGBScreenImage( ( int )img.dimension( 0 ), ( int )img.dimension( 1 ) );
final XYProjector< FloatType, ARGBType > projector = new XYProjector< FloatType, ARGBType >( img, screenImage, new RealARGBConverter< FloatType >( 0, 127 ) );
final Projector2D< FloatType, ARGBType > projector = new Projector2D< FloatType, ARGBType >(0, 1, img, screenImage, new RealARGBConverter< FloatType >( 0, 127 ) );

final ColorProcessor cp = new ColorProcessor( screenImage.image() );
final ImagePlus imp = new ImagePlus( "argbScreenProjection", cp );
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/tests/XYProjectorBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import ij.ImageJ;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgFactory;
Expand Down Expand Up @@ -57,7 +57,7 @@ public XYProjectorBenchmark( final String filename ) throws ImgIOException, Inco

public void convert( final Img< UnsignedByteType > in, final Img< ARGBType > out )
{
final XYProjector< UnsignedByteType, ARGBType > projector = new XYProjector< UnsignedByteType, ARGBType >( in, out, new RealARGBConverter< UnsignedByteType >(0, 1000) );
final Projector2D< UnsignedByteType, ARGBType > projector = new Projector2D< UnsignedByteType, ARGBType >( 0, 1, in, out, new RealARGBConverter< UnsignedByteType >(0, 1000) );
for ( int iteration = 0; iteration < 10; ++iteration )
{
final long start = System.currentTimeMillis();
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/tests/XYRandomAccessibleProjectorBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import ij.ImageJ;
import net.imglib2.display.RealARGBConverter;
import net.imglib2.display.XYRandomAccessibleProjector;
import net.imglib2.display.projectors.Projector2D;
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgFactory;
Expand Down Expand Up @@ -57,7 +57,7 @@ public XYRandomAccessibleProjectorBenchmark( final String filename ) throws ImgI

public void convert( final Img< UnsignedByteType > in, final Img< ARGBType > out )
{
final XYRandomAccessibleProjector< UnsignedByteType, ARGBType > projector = new XYRandomAccessibleProjector< UnsignedByteType, ARGBType >( in, out, new RealARGBConverter< UnsignedByteType >(0, 1000) );
final Projector2D< UnsignedByteType, ARGBType > projector = new Projector2D< UnsignedByteType, ARGBType >( 0, 1, in, out, new RealARGBConverter< UnsignedByteType >(0, 1000) );
for ( int iteration = 0; iteration < 10; ++iteration )
{
final long start = System.currentTimeMillis();
Expand All @@ -71,6 +71,8 @@ public void convert( final Img< UnsignedByteType > in, final Img< ARGBType > out
public static void main( final String[] args ) throws IncompatibleTypeException, ImgIOException
{
new ImageJ();
new XYRandomAccessibleProjectorBenchmark( "/home/tobias/workspace/data/DrosophilaWing.tif" );
new XYRandomAccessibleProjectorBenchmark( "DrosophilaWing.tif" );
}
}


0 comments on commit 10b6f80

Please sign in to comment.