Projects >> imglib2 >>0fb719022178d50d9e7ac1d7210ef18acdda34a1

Chunk
Conflicting content
		catch ( IncompatibleTypeException e )
		{
			if ( img.size() > Integer.MAX_VALUE / 2 )
<<<<<<< HEAD
				return new CellImgFactory< ComplexFloatType >( 1024 );
			else
				return new ArrayImgFactory< ComplexFloatType >();
=======
				return new CellImgFactory( 1024 );
			return new ArrayImgFactory< ComplexFloatType >();
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
		}
	}
}
Solution content
		catch ( IncompatibleTypeException e )
		{
			if ( img.size() > Integer.MAX_VALUE / 2 )
				return new CellImgFactory< ComplexFloatType >( 1024 );
			else
				return new ArrayImgFactory< ComplexFloatType >();
		}
	}
}
File
FFTConvolution.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
import net.imglib2.algorithm.MultiThreadedBenchmarkAlgorithm;
import net.imglib2.algorithm.OutputAlgorithm;
import net.imglib2.algorithm.region.localneighborhood.RectangleCursor;
<<<<<<< HEAD
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhood;
=======
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhoodGPL;
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.multithreading.Chunk;
Solution content
import net.imglib2.algorithm.MultiThreadedBenchmarkAlgorithm;
import net.imglib2.algorithm.OutputAlgorithm;
import net.imglib2.algorithm.region.localneighborhood.RectangleCursor;
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhoodGPL;
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.multithreading.Chunk;
File
MomentOfInertiaTensor2D.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import net.imglib2.algorithm.MultiThreadedBenchmarkAlgorithm;
import net.imglib2.algorithm.OutputAlgorithm;
import net.imglib2.algorithm.region.localneighborhood.RectangleCursor;
<<<<<<< HEAD
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhood;
=======
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhoodGPL;
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.multithreading.Chunk;
Solution content
import net.imglib2.algorithm.MultiThreadedBenchmarkAlgorithm;
import net.imglib2.algorithm.OutputAlgorithm;
import net.imglib2.algorithm.region.localneighborhood.RectangleCursor;
import net.imglib2.algorithm.region.localneighborhood.RectangleNeighborhoodGPL;
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.multithreading.Chunk;
File
MomentOfInertiaTensor3D.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
package net.imglib2.algorithm.region;

<<<<<<< HEAD
=======
import static org.junit.Assert.assertEquals;
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
import net.imglib2.Cursor;
import net.imglib2.Point;
import net.imglib2.RandomAccess;
Solution content
package net.imglib2.algorithm.region;

import static org.junit.Assert.assertEquals;
import net.imglib2.Cursor;
import net.imglib2.Point;
import net.imglib2.RandomAccess;
File
BresenhamLineTest.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
	public PlanarRandomAccess< T > randomAccess()
	{
		if ( n == 1 )
<<<<<<< HEAD
			return new PlanarRandomAccess1D< T >( this );
		else
			return new PlanarRandomAccess< T >( this );
=======
			return new PlanarRandomAccess1D( this );
		return new PlanarRandomAccess( this );
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
	}

	@Override
Solution content
	public PlanarRandomAccess< T > randomAccess()
	{
		if ( n == 1 )
			return new PlanarRandomAccess1D< T >( this );
		return new PlanarRandomAccess< T >( this );
	}

	@Override
File
PlanarImg.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
	}

	@Override
<<<<<<< HEAD:imglib2/ops/src/main/java/net/imglib2/ops/img/UnaryOperationBridge.java
	public UnaryObjectFactory bufferFactory() {
		return new UnaryObjectFactory() {
=======
	public Img< O > createEmptyOutput( IN in )
	{
		if ( m_operations.length > 1 )
		{
			final long[] dims = new long[ in.numDimensions() + 1 ];
			for ( int d = 0; d < in.numDimensions(); d++ )
			{
				dims[ d ] = in.dimension( d );
			}
			dims[ dims.length - 1 ] = m_operations.length;
			return m_fac.create( dims, m_resType );
		}
		return m_fac.create( in, m_resType );
	}
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57:imglib2/ops/src/main/java/net/imglib2/ops/img/ResultAsAdditionalDimOp.java

			@Override
			public C instantiate(A a) {
Solution content
	}

	@Override
	public UnaryObjectFactory< A, C > bufferFactory()
	{
		return new UnaryObjectFactory< A, C >()
		{
			@Override
File
UnaryOperationBridge.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Method invocation
Method signature
Return statement
Chunk
Conflicting content
import net.imglib2.ops.img.UnaryObjectFactory;

/**
<<<<<<< HEAD
 * tbd.
=======
 * Class should only be used if the output can't be known by the user in
 * advance. For example if the operation produces an double[] of unknown size,
 * this algorithm should know what to do.
 * 

* If the output can be known, e.g. {@link net.imglib2.img.Img} to * {@link net.imglib2.img.Img} of same dimensionality {@link UnaryOperation} * should be used. *

>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57 * * @author Christian Dietz (University of Konstanz) */
Solution content
import net.imglib2.ops.img.UnaryObjectFactory;

/**
 * tbd.
 * 
 * @author Christian Dietz (University of Konstanz)
 */
File
UnaryOutputOperation.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
public interface UnaryOutputOperation< A, B > extends UnaryOperation< A, B >
{

<<<<<<< HEAD
	UnaryObjectFactory< A, B > bufferFactory();
	
	UnaryOutputOperation< A, B > copy();
=======
	/**
	 * {@inheritDoc}
	 */
	@Override
	UnaryOutputOperation< INPUT_TYPE, OUTPUT_TYPE > copy();
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
}
Solution content
public interface UnaryOutputOperation< A, B > extends UnaryOperation< A, B >
{

	UnaryObjectFactory< A, B > bufferFactory();
	
	UnaryOutputOperation< A, B > copy();
}
File
UnaryOutputOperation.java
Developer's decision
Version 1
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
	 * {@inheritDoc}
	 */
	@Override
<<<<<<< HEAD
	public UnaryObjectFactory< Img< I >, Img< O > > bufferFactory()
	{
		return new UnaryObjectFactory< Img< I >, Img< O > >()
		{
			@Override
			public Img< O > instantiate( Img< I > a )
			{
				try
				{
					long[] dims = new long[ a.numDimensions() ];
					a.dimensions( dims );
					return a.factory().imgFactory( m_outType ).create( dims, m_outType.createVariable() );
				}
				catch ( IncompatibleTypeException e )
				{
					throw new RuntimeException( e );
				}
			}

		};
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
=======
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
	public Img< O > compute( Img< I > img, Img< O > r )
	{
Solution content
	 * {@inheritDoc}
	 */
	@Override
	public UnaryObjectFactory< Img< I >, Img< O > > bufferFactory()
	{
		return new UnaryObjectFactory< Img< I >, Img< O > >()
		{
			@Override
			public Img< O > instantiate( Img< I > a )
			{
				try
				{
					long[] dims = new long[ a.numDimensions() ];
					a.dimensions( dims );
					return a.factory().imgFactory( m_outType ).create( dims, m_outType.createVariable() );
				}
				catch ( IncompatibleTypeException e )
				{
					throw new RuntimeException( e );
				}
			}

		};
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Img< O > compute( Img< I > img, Img< O > r )
	{
File
ImgConvert.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration
Chunk
Conflicting content
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
<<<<<<< HEAD
import net.imglib2.ops.img.UnaryObjectFactory;
=======
import net.imglib2.img.array.ArrayImgFactory;
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
import net.imglib2.ops.img.UnaryOperationAssignment;
import net.imglib2.ops.operation.UnaryOutputOperation;
import net.imglib2.ops.operation.iterableinterval.unary.MinMax;
Solution content
import net.imglib2.exception.IncompatibleTypeException;
import net.imglib2.img.Img;
import net.imglib2.ops.img.UnaryObjectFactory;
import net.imglib2.ops.img.UnaryOperationAssignment;
import net.imglib2.ops.operation.Operations;
import net.imglib2.ops.operation.UnaryOutputOperation;
import net.imglib2.ops.operation.iterableinterval.unary.MinMax;
File
ImgConvert.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
	{
		return new ImgConvert< I, O >( m_inType.copy(), m_outType.copy(), m_conversionType );
	}
<<<<<<< HEAD
=======

	@Override
	public Img< O > createEmptyOutput( Img< I > in )
	{
		try
		{
			return in.factory().imgFactory( m_outType ).create( in, m_outType );
		}
		catch ( IncompatibleTypeException e )
		{
			return new ArrayImgFactory< O >().create( in, m_outType );
		}
	}

	@Override
	public Img< O > compute( Img< I > in )
	{
		return compute( in, createEmptyOutput( in ) );
	}
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
}
Solution content
	{
		return new ImgConvert< I, O >( m_inType.copy(), m_outType.copy(), m_conversionType );
	}
}
File
ImgConvert.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
	@Override
	public UnaryObjectFactory< Img< T >, Img< T > > bufferFactory()
	{
<<<<<<< HEAD

		return new UnaryObjectFactory< Img< T >, Img< T > >()
		{

			@Override
			public Img< T > instantiate( Img< T > a )
			{
				if ( m_keepSize )
				{
					return a.factory().create( a, a.randomAccess().get().createVariable() );
				}
				else
				{
					// rotate all for egde points and take the maximum
					// coordinate to
					// determine the new image size
					long[] min = new long[ a.numDimensions() ];
					long[] max = new long[ a.numDimensions() ];

					a.min( min );
					a.max( max );
					min[ m_dimIdx1 ] = min[ m_dimIdx2 ] = Long.MAX_VALUE;
					max[ m_dimIdx1 ] = max[ m_dimIdx2 ] = Long.MIN_VALUE;

					double[] center = calcCenter( a );

					double x;
					double y;

					for ( Long orgX : new long[] { 0, a.max( m_dimIdx1 ) } )
					{
						for ( Long orgY : new long[] { 0, a.max( m_dimIdx2 ) } )
						{
							x = ( orgX - center[ m_dimIdx1 ] ) * Math.cos( m_angle ) - ( orgY - center[ m_dimIdx2 ] ) * Math.sin( m_angle );

							y = ( orgX - center[ m_dimIdx1 ] ) * Math.sin( m_angle ) + ( orgY - center[ m_dimIdx2 ] ) * Math.cos( m_angle );
							min[ m_dimIdx1 ] = ( int ) Math.round( Math.min( x, min[ m_dimIdx1 ] ) );
							min[ m_dimIdx2 ] = ( int ) Math.round( Math.min( y, min[ m_dimIdx2 ] ) );
							max[ m_dimIdx1 ] = ( int ) Math.round( Math.max( x, max[ m_dimIdx1 ] ) );
							max[ m_dimIdx2 ] = ( int ) Math.round( Math.max( y, max[ m_dimIdx2 ] ) );
						}
					}

					long[] dims = new long[ min.length ];
					for ( int i = 0; i < dims.length; i++ )
					{
						dims[ i ] = max[ i ] - min[ i ];
					}

					return a.factory().create( new FinalInterval( dims ), a.randomAccess().get().createVariable() );
				}
			}
		};
=======
		if ( m_keepSize )
		{
			return op.factory().create( op, op.randomAccess().get().createVariable() );
		}
		// rotate all for egde points and take the maximum
		// coordinate to
		// determine the new image size
		long[] min = new long[ op.numDimensions() ];
		long[] max = new long[ op.numDimensions() ];

		op.min( min );
		op.max( max );
		min[ m_dimIdx1 ] = min[ m_dimIdx2 ] = Long.MAX_VALUE;
		max[ m_dimIdx1 ] = max[ m_dimIdx2 ] = Long.MIN_VALUE;

		double[] center = calcCenter( op );

		double x;
		double y;

		for ( Long orgX : new long[] { 0, op.max( m_dimIdx1 ) } )
		{
			for ( Long orgY : new long[] { 0, op.max( m_dimIdx2 ) } )
			{
				x = ( orgX - center[ m_dimIdx1 ] ) * Math.cos( m_angle ) - ( orgY - center[ m_dimIdx2 ] ) * Math.sin( m_angle );

				y = ( orgX - center[ m_dimIdx1 ] ) * Math.sin( m_angle ) + ( orgY - center[ m_dimIdx2 ] ) * Math.cos( m_angle );
				min[ m_dimIdx1 ] = ( int ) Math.round( Math.min( x, min[ m_dimIdx1 ] ) );
				min[ m_dimIdx2 ] = ( int ) Math.round( Math.min( y, min[ m_dimIdx2 ] ) );
				max[ m_dimIdx1 ] = ( int ) Math.round( Math.max( x, max[ m_dimIdx1 ] ) );
				max[ m_dimIdx2 ] = ( int ) Math.round( Math.max( y, max[ m_dimIdx2 ] ) );
			}
		}

		long[] dims = new long[ min.length ];
		for ( int i = 0; i < dims.length; i++ )
		{
			dims[ i ] = max[ i ] - min[ i ];
		}

		return op.factory().create( new FinalInterval( dims ), op.randomAccess().get().createVariable() );
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
	}

	/**
Solution content
	@Override
	public UnaryObjectFactory< Img< T >, Img< T > > bufferFactory()
	{
		return new UnaryObjectFactory< Img< T >, Img< T > >()
		{

			@Override
			public Img< T > instantiate( Img< T > a )
			{
				if ( m_keepSize )
				{
					return a.factory().create( a, a.randomAccess().get().createVariable() );
				}
				else
				{
					// rotate all for egde points and take the maximum
					// coordinate to
					// determine the new image size
					long[] min = new long[ a.numDimensions() ];
					long[] max = new long[ a.numDimensions() ];

					a.min( min );
					a.max( max );
					min[ m_dimIdx1 ] = min[ m_dimIdx2 ] = Long.MAX_VALUE;
					max[ m_dimIdx1 ] = max[ m_dimIdx2 ] = Long.MIN_VALUE;

					double[] center = calcCenter( a );

					double x;
					double y;

					for ( Long orgX : new long[] { 0, a.max( m_dimIdx1 ) } )
					{
						for ( Long orgY : new long[] { 0, a.max( m_dimIdx2 ) } )
						{
							x = ( orgX - center[ m_dimIdx1 ] ) * Math.cos( m_angle ) - ( orgY - center[ m_dimIdx2 ] ) * Math.sin( m_angle );

							y = ( orgX - center[ m_dimIdx1 ] ) * Math.sin( m_angle ) + ( orgY - center[ m_dimIdx2 ] ) * Math.cos( m_angle );
							min[ m_dimIdx1 ] = ( int ) Math.round( Math.min( x, min[ m_dimIdx1 ] ) );
							min[ m_dimIdx2 ] = ( int ) Math.round( Math.min( y, min[ m_dimIdx2 ] ) );
							max[ m_dimIdx1 ] = ( int ) Math.round( Math.max( x, max[ m_dimIdx1 ] ) );
							max[ m_dimIdx2 ] = ( int ) Math.round( Math.max( y, max[ m_dimIdx2 ] ) );
						}
					}

					long[] dims = new long[ min.length ];
					for ( int i = 0; i < dims.length; i++ )
					{
						dims[ i ] = max[ i ] - min[ i ];
					}

					return a.factory().create( new FinalInterval( dims ), a.randomAccess().get().createVariable() );
				}
			}
		};
	}

	/**
File
ImgRotate2D.java
Developer's decision
Version 1
Kind of conflict
Array access
Attribute
Comment
For statement
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
public class IntervalsFromDimSelection {

<<<<<<< HEAD
	public static Interval[] compute(int[] selectedDims,
			Interval incomingInterval) {

		int totalSteps = getNumIterationSteps(selectedDims, incomingInterval);
		Interval[] res = new Interval[totalSteps];
=======
	@Override
	public Interval[] createEmptyOutput( int[] op0, Interval[] op1 )
	{

		int totalSteps = 0;
		for ( int i = 0; i < op1.length; i++ )
		{
			totalSteps += getNumIterationSteps( op0, op1[ i ] );
		}
		return new Interval[ totalSteps ];
	}

	@Override
	public Interval[] compute( int[] selectedDims, Interval[] incomingIntervals, Interval[] resIntervals )
	{
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57

		int offset = 0;
Solution content
public class IntervalsFromDimSelection {

	public static Interval[] compute(int[] selectedDims,
			Interval incomingInterval) {

		int totalSteps = getNumIterationSteps(selectedDims, incomingInterval);
		Interval[] res = new Interval[totalSteps];

		int offset = 0;
File
IntervalsFromDimSelection.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
					pointCtr[unselectedDims[j]] = 0;
			}

<<<<<<< HEAD
			for (int u : unselectedDims) {
				max[u] = pointCtr[u] + min[u];
				min[u] = max[u];
			}

			res[offset + n] = new FinalInterval(min, max);
			interval.min(min);
		}
		return res;
	}

	/**
	 * @param dims
	 * @return
	 */
	private final static synchronized int getNumIterationSteps(
			int[] selectedDims, Interval interval) {
=======
	@Override
	public Interval[] compute( int[] in1, Interval[] in2 )
	{
		return compute( in1, in2, createEmptyOutput( in1, in2 ) );
	}

	private final static synchronized int getNumIterationSteps( int[] selectedDims, Interval interval )
	{
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57

		long[] dims = new long[interval.numDimensions()];
		interval.dimensions(dims);
Solution content
					pointCtr[unselectedDims[j]] = 0;
			}

			for (int u : unselectedDims) {
				max[u] = pointCtr[u] + min[u];
				min[u] = max[u];
			}

			res[offset + n] = new FinalInterval(min, max);
			interval.min(min);
		}
		return res;
	}

	/**
	 * @param dims
	 * @return
	 */
	private final static synchronized int getNumIterationSteps(
			int[] selectedDims, Interval interval) {

		long[] dims = new long[interval.numDimensions()];
		interval.dimensions(dims);
File
IntervalsFromDimSelection.java
Developer's decision
Version 1
Kind of conflict
Annotation
Array access
Comment
For statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
		return steps;
	}

<<<<<<< HEAD
	/**
	 * @return
	 */
	private final static synchronized int[] getUnselectedDimIndices(
			int[] selectedDims, int numDims) {
		final boolean[] tmp = new boolean[numDims];
=======
	private final static synchronized int[] getUnselectedDimIndices( int[] selectedDims, int numDims )
	{
		final boolean[] tmp = new boolean[ numDims ];
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
		int i;
		for (i = 0; i < selectedDims.length; i++) {
			if (selectedDims[i] >= numDims) {
Solution content
		return steps;
	}

	/**
	 * @return
	 */
	private final static synchronized int[] getUnselectedDimIndices(
			int[] selectedDims, int numDims) {
		final boolean[] tmp = new boolean[numDims];
		int i;
		for (i = 0; i < selectedDims.length; i++) {
			if (selectedDims[i] >= numDims) {
File
IntervalsFromDimSelection.java
Developer's decision
Version 1
Kind of conflict
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
		assert (in.iterationOrder().equals(r.iterationOrder()));

<<<<<<< HEAD
		int[] histo = Operations.compute( new MakeHistogram< T >(), in ).hist();
=======
		int[] histo = new MakeHistogram().compute(in).hist();
>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57

		T val = r.firstElement().createVariable();
Solution content
		assert (in.iterationOrder().equals(r.iterationOrder()));

		int[] histo = Operations.compute( new MakeHistogram< T >(), in ).hist();

		T val = r.firstElement().createVariable();
File
EqualizeHistogram.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		this( 0, null );
	}

<<<<<<< HEAD
	/**
	 * {@inheritDoc}
	 * 
	 * @return
	 */
=======
	@Override
	public Pair< T, T > createEmptyOutput( IterableInterval< T > op )
	{
		final T t = op.iterator().next();
		return new Pair< T, T >( t.createVariable(), t.createVariable() );
	}

>>>>>>> 0d084aa6bc71b46b37b97b17bca52e08a420fd57
	@Override
	public Pair< T, T > compute( IterableInterval< T > op, Pair< T, T > r )
	{
Solution content
		this( 0, null );
	}

	@Override
	public Pair< T, T > compute( IterableInterval< T > op, Pair< T, T > r )
	{
File
MinMax.java
Developer's decision
None
Kind of conflict
Annotation
Comment
Method declaration