axtimwalde/mpicbg

toMatrix in some models is wrong

Closed this issue · 3 comments

The function toMatrix in many models, such as RigidModel2D or SimilarityModel2D is wrong.

@Override
public void toMatrix( final double[][] data )
{
	data[ 0 ][ 0 ] = scos;
	data[ 0 ][ 1 ] = -ssin;
	data[ 0 ][ 2 ] = tx;
	data[ 1 ][ 0 ] = ssin;
	data[ 1 ][ 1 ] = scos;
	data[ 1 ][ 1 ] = ty;
}

Where it should be:

@Override
public void toMatrix( final double[][] data )
{
	data[ 0 ][ 0 ] = scos;
	data[ 0 ][ 1 ] = -ssin;
	data[ 0 ][ 2 ] = tx;
	data[ 1 ][ 0 ] = ssin;
	data[ 1 ][ 1 ] = scos;
	data[ 1 ][ 2 ] = ty; // Changed here
}

this causes a bug where the transformation matrix has one value at the wrong place and one empty (0) value.

Hi @npielawski ,

Thanks for the filing the issue - but what version of the code are you looking at?
I think these bugs were fixed in this commit e0627fe

Hi,
thanks for the quick answer.

Yes, you are right: I was looking at the wrong version. The problem is that Fiji is using this old version, but that's not on your side.

Sorry about the inconvenience.

pom-scijava points to version 1.3.0, so the next big round of updates (presumably soon by @ctrueden) will bring the latest version of mpicbg to Fiji.