[Insight-users] ImageRegistration9.exe - 2DAffine
Ganesh Narayanasamy
nganesh76 at hotmail.com
Thu Mar 11 14:02:16 EST 2010
I would like to make a 3D Affine image registration code, if there is none. I found a similar code in ImageRegistration9.cxx and would like to alter to make it applicable for 3D images. Are these the only changes needed or is there anything else that I need to make.
After Line#529, I dont know if there is anything to change.
Thanks,
Ganesh
****
Line 146: const unsigned int Dimension = 3;
Line 285 to 290: Need to remove lines 289, 290 and add 6 more lines to make a (4x3) matrix for 3D images.
optimizerScales[4] = 1.0; optimizerScales[5] = 1.0;
optimizerScales[6] = 1.0; optimizerScales[7] = 1.0;
optimizerScales[8] = 1.0;
optimizerScales[9] = translationScale;
optimizerScales[10] = translationScale;
optimizerScales[11] = translationScale;
After line 395, add
const double finalRotationCenterZ=transform->GetCenter()[2];
After line 397, add
const double finalTranslationZ =finalParameters[6];
After line 408, add
std::cout << " Center Z = " << finalRotationCenterZ << std::endl;
After line 410, add
std::cout << " Translation Z = " << finalTranslationZ << std::endl;
Change line 418 into
vnl_matrix<double> p(3, 3);
After line 420 add
p[0][2] = (double) finalParameters[2]; p[1][0] = (double) finalParameters[3]; p[1][1] = (double) finalParameters[4];
p[1][2] = (double) finalParameters[5]; p[2][0] = (double) finalParameters[6]; p[2][1] = (double) finalParameters[7];
p[2][2] = (double) finalParameters[8];
Change line 425 into
vnl_matrix<double> r(3, 3);
Add after line 432
std::cout << " Scale 3 = " << svd.W(2)<< std::endl;
***
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469226/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100311/e29c45a5/attachment.htm>
More information about the Insight-users
mailing list