[Insight-users] help in registration
Karthik Krishnan
Karthik.Krishnan at kitware.com
Thu Jun 2 14:27:37 EDT 2005
Take a look at
http://public.kitware.com/pipermail/insight-users/2004-October/010704.html
You might want to use the LBFGSB optimizer.. Here are the parameters I
used to register the two files you've mentioned Ratlungslice1 and
Ratlungslice2. I increased the number control points to 15x15 cause a
small number of control points wasn't enough to capture the movement of
the diaphragm
const unsigned int ImageDimension = 2; // change dimension to 2.
Parameters:
optimizer->SetCostFunctionConvergenceFactor( 1e+7 );
optimizer->SetProjectedGradientTolerance( 1e-5 );
optimizer->SetMaximumNumberOfIterations( 500 );
optimizer->SetMaximumNumberOfEvaluations( 500 );
optimizer->SetMaximumNumberOfCorrections( 5 );
gridSizeOnImage.Fill( 15 );
Try d:
--------
Starting Registration
0 153.058 1.82325
1 129.986 2.02804
2 122.484 1.88642
3 107.464 2.18149
4 98.0134 1.02683
5 94.0379 0.775746
6 91.0169 0.43056
7 89.0736 0.491479
8 88.2219 0.264362
9 88.2013 0.278652
10 88.0812 0.200305
11 87.9227 0.320091
12 87.2545 0.17404
13 87.2082 0.166056
14 86.8054 0.175671
15 86.7547 0.151149
16 86.7054 0.139415
17 86.6884 0.133719
18 86.6849 0.130897
19 86.6745 0.100655
20 86.6742 0.100347
21 86.6462 0.093127
22 86.6136 0.220999
23 86.6063 0.244055
24 86.4418 0.1303
25 86.4355 0.129761
26 86.3509 0.123786
27 86.3043 0.12099
28 86.2718 0.112004
29 86.2246 0.0991365
30 86.2215 0.0965748
31 86.0039 0.170438
32 85.8175 0.204844
33 85.4947 0.20192
34 85.4912 0.187093
Last Transform Parameters
[-0.000376881, -0.0225773, 0.000949991, 0.0492595, -0.0127637,
-0.0129418, -0.0190772, -0.0134026, -0.0038651, -0.00991396, 0.0161965,
0.0107845, 0.0128269, -0.037278, -0.0471152, -0.00630536, -0.000283899,
-1.39109e-07, -0.00264246, -0.461859, 0.248221, 0.329714, -0.444224,
-0.334155, -0.303841, -0.0849232, 0.00782201, 0.128382, 0.30108,
0.504582, 0.808747, -0.119522, -0.610876, -0.0594564, -0.00750558,
-5.49359e-06, -0.00146159, -1.18952, 0.783295, -0.205188, -0.873403,
-1.64594, -0.878374, -0.343478, -0.118055, 1.28105, 0.684245, 0.535446,
1.22785, -0.120083, -0.471858, -0.0631163, -0.0161013, -1.19788e-05,
0.00188401, -0.768887, 0.191434, 0.0756016, -0.209025, -1.91474,
-0.829723, -0.346959, 0.277545, 0.829551, 0.276693, -0.499978, 0.947259,
-1.00869, 0.284099, -0.0321756, -0.00515283, -4.11482e-06, 0.0206021,
-0.183156, 0.63824, -0.351804, 0.789966, -0.677999, 0.0304661, 0.521419,
0.29971, 1.05238, -0.133179, 0.137437, -0.168285, -0.459678, -0.529486,
-0.0431969, 0.0289388, 2.04617e-05, 0.0280142, -0.715932, 0.531834,
-0.584248, 0.218186, 0.926228, -0.249437, 0.661517, 0.601669, -0.981489,
-0.675015, -0.177092, 0.00114115, 1.00788, -0.764434, -0.116514,
0.00443719, 4.10449e-05, 9.4034e-05, -0.662835, 0.242385, -0.4678,
-0.151031, 1.02941, -0.399058, -1.12055, 0.57191, -2.49263, 0.216108,
-0.339942, 0.653288, 0.982553, -0.356136, 0.308825, -0.00156315,
1.4552e-05, -0.0519951, -0.645891, 0.129606, -0.597026, 1.19708,
0.343841, -0.772196, 0.0943346, 0.108293, -2.37537, 0.72042, 1.50979,
-2.02669, 0.221597, -0.664613, 0.414431, 0.00235245, -3.49536e-06,
-0.0808538, 0.0582828, -0.468584, 0.469998, 0.909596, -1.02552,
-0.332777, -0.815379, -0.402064, -1.64172, 0.133707, -0.215027,
0.126744, 0.831735, -0.37286, 0.096733, -0.0079604, -9.28723e-06,
-0.193428, 0.628709, -1.16856, 0.233488, 0.515385, -0.756095, -0.243959,
-0.650767, 0.208457, -0.844665, 0.335868, 1.20398, -1.81265, 0.330728,
-0.191193, -0.112958, 0.0066618, 1.77531e-06, -0.36895, -0.83802,
0.0842843, 0.396595, 0.81202, -0.70048, 0.0564285, -1.56838, 0.940351,
-0.0466342, -1.9184, 1.97459, -0.0357132, -0.462485, 0.413828,
-0.114302, 0.00488724, 7.56996e-07, -0.14177, 0.0362493, -0.088974,
-1.28195, -1.12954, -1.55284, -0.600239, -1.22166, 1.03936, 1.17049,
0.888688, 0.363526, 0.722656, -0.0622052, 0.309255, 0.0219892,
-0.00542655, -1.45892e-06, -0.0722719, -0.445469, 0.25325, -0.649666,
-2.751, -0.717562, -0.397076, 0.131973, 1.04796, 0.547192, 1.73964,
0.482287, -0.565642, 0.247843, -0.214702, 0.0868776, -0.00037942,
-2.07019e-06, 0.045701, -0.354766, 0.0674399, -0.563632, -2.61721,
-0.578421, -0.45991, 0.497754, 1.00102, -0.902679, 0.129075, 0.97591,
0.793816, -0.545196, 0.0436325, 0.0260025, 0.00235849, -6.59788e-06,
0.0270331, -0.401648, 0.0578785, -0.839833, -1.96666, -0.775796,
-0.0123317, 0.192046, 0.90806, -0.955563, -0.22219, -0.871974,
-0.962474, 0.211617, -0.144424, -0.0257135, -0.00448564, -9.74679e-06,
0.0228883, -0.00724671, -0.191918, -0.300322, -0.511769, 0.195759,
0.262178, -0.119603, 0.697238, -0.102748, -1.22286, -0.548903,
-0.764931, 0.287455, -0.145756, -0.0279436, 0.000375926, -2.53272e-06,
0.000286582, -0.020513, -0.0558143, 0.000692791, 0.00594485, 0.0630156,
-0.000276561, -0.0428063, 0.0195294, 0.0226686, -0.0857086, -0.0247853,
-0.0136983, 0.0231316, -0.0442752, -0.0060981, 0.000264624,
-1.07609e-07, 1.60098e-07, -8.28311e-06, -3.42933e-05, 7.77253e-06,
1.40611e-05, 1.85389e-05, -3.26108e-05, -2.5401e-05, -2.4762e-05,
2.12064e-06, -2.82626e-06, -3.08909e-06, 6.05367e-06, 2.7739e-05,
-1.5571e-05, -3.18683e-06, -9.66605e-09, -6.82522e-11, 0.000216246,
-0.00578175, -0.0866556, -0.125287, -0.115487, -0.108303, -0.0831169,
-0.0149714, 0.0225747, 0.0549461, 0.0556154, 0.0913097, 0.0505773,
-0.00137677, 0.0125325, 0.00263585, 0.000117165, 3.74071e-09,
0.00155006, 0.0897515, 1.25745, 1.11912, 0.239452, 0.207845, 0.217998,
0.38012, 0.609363, 0.959053, 0.314226, 0.921285, 1.1076, 0.698445,
0.192726, 0.00578718, -0.00109144, -8.56693e-07, 0.00114573, 0.00217022,
0.0214546, -1.0604, 1.55978, 1.98341, 1.25645, 1.08157, 1.53219,
2.42442, 1.10846, 1.49241, 0.987327, 0.092515, -0.146895, -0.00498517,
-0.00116632, -6.96193e-07, -0.000284527, 0.0194153, 0.390778, -0.524838,
0.815991, 1.52191, -0.76247, -1.85009, -0.0947351, 1.27245, 0.573649,
0.0546368, -0.777628, 0.0150684, -0.00321047, 0.00980113, 0.00209062,
1.34108e-06, -0.00103407, -0.033523, 0.382664, 2.22438, -0.288519,
1.10535, -0.474073, 0.0911221, 1.1136, 0.0138673, 0.919082, 0.585985,
0.0886755, -0.556469, -0.240914, 0.0158809, 0.00458862, 3.65216e-06,
-0.0141454, -0.258237, -1.02332, -0.0224034, 0.968077, 1.07339, 1.12506,
0.820901, -0.581849, -0.48343, 0.360016, -1.50492, -2.07825, 0.0302389,
0.376407, -0.0366035, -0.015817, 7.59822e-06, -0.0204939, -0.017772,
0.4702, -0.562514, -0.047072, -1.72258, -1.45948, -1.87941, -0.586159,
-0.831484, -0.830515, 0.879703, 3.03072, -1.45133, -0.0405614, 0.125906,
0.0217084, 2.38833e-05, -0.00852855, -0.241373, -1.06653, -0.82358,
-0.207842, -0.598649, -1.45758, -1.16872, 0.901248, -0.877875,
-0.272916, 1.15781, 0.11528, -1.72551, -0.142835, 0.120855, 0.00648877,
6.44017e-06, -0.0110594, -0.0294392, -0.0669895, -1.32731, -2.2879,
-2.34613, -2.3639, -2.88187, -1.95164, -1.98362, 0.321807, 0.58593,
-1.53269, 0.387783, 0.0160839, -0.0302832, -0.00472067, 2.76806e-06,
-0.0451484, 0.40683, 3.46327, -2.93446, -3.15589, -2.7798, -1.31288,
-0.720446, -1.42258, -2.60768, -3.71667, 0.770287, -0.346928, -0.844652,
-0.150528, -0.0706276, -0.00963129, -9.03577e-07, -0.092278, -0.272535,
-1.99811, -7.4366, -0.580627, -2.51264, -2.02042, -2.89231, -2.79413,
-2.40105, -3.44118, -2.4638, -0.531029, -0.169836, -0.331797, -0.027736,
-0.00318505, -2.23232e-06, -0.0912342, -1.18418, -0.50462, -0.981647,
-2.01179, -2.42124, -1.67121, -1.67571, -1.87495, -1.55492, -0.461948,
0.374433, -0.591375, -0.521675, -0.334974, 0.0107467, 0.00395388,
-8.75445e-07, -0.10146, -1.7005, -0.807723, -0.753098, -1.99814,
-1.00426, -1.70709, -2.63417, -0.898004, -1.38571, -0.925937, -0.814813,
0.0647395, -1.73917, -0.732069, -0.0464695, -0.00954526, -3.33819e-06,
-0.0658542, -0.927415, -0.0786925, -0.74166, -1.69973, -1.68811,
-2.14543, -1.5127, -0.260833, -1.69752, -1.14058, -0.277433, -0.289712,
0.567185, -0.882694, -0.0869696, -0.0141787, -9.05679e-06, -0.0517344,
-0.485862, -0.612929, -1.33404, -1.48799, -1.92007, -2.38532, -1.39918,
-1.95345, -1.28101, -1.38952, -1.2221, -3.53429, -0.989933, 0.155256,
-0.0750811, -0.0175645, -1.23108e-05, -0.0108245, -0.114096, -0.64747,
-0.369642, -0.511851, -0.376192, -0.880062, -0.634291, -1.16488,
-1.09484, -2.25745, -2.0828, -1.1188, 0.277001, 0.47588, -0.00300258,
-0.00458567, -4.509e-06, 0.000155398, -0.005097, -0.0530544, 0.122085,
0.0849728, 0.168098, 0.0910282, 0.0225546, -0.0242776, -0.119213,
-0.161358, -0.05997, -0.00164215, 0.238926, 0.140619, 0.00563574,
4.60269e-05, -1.55411e-07, 3.30458e-07, 1.09182e-06, 2.75537e-05,
0.000141169, 0.000128789, 0.000156862, 0.000151835, 6.56426e-05,
4.81922e-05, 3.60514e-05, 3.76899e-05, 2.96347e-05, 1.60304e-05,
0.000129355, 6.31332e-05, 1.55254e-06, -5.93456e-08, -1.35439e-11]
The registered image is attached.
HTH
karthik
hariharan ganesh lalgudi wrote:
>
> Hii,
>
> I am a new user of ITK and was wondering if someone could help me in
> some of the basic problems that I am facing. My goal is to register 3D
> cardiac CT/MR images across time using some of the registration
> algorithms in ITK. To get started, I tried to run the "RatLungSlice"
> example with different deformable registration algorithms (FEM,
> Bspline, Demons..).
>
> Problem 1:
>
> When I use Bsline (DeformableRegistration4) it gives me the error:
>
> "IFLAG= -1. LINE SEARCH FAILED. SEE DOCUMENTATION OF ROUTINE MCSRCH
> ERROR RETURN OF LINE SEARCH: INFO=3 POSSIBLE CAUSES: FUNCTION OR
> GRADIENT
> ARE INCORRECT OR INCORRECT TOLERANCES"
>
> Based on some previous discussion in the list I guess that it has got
> to do with parameters of the optimization:
>
> " optimizer->SetGradientConvergenceTolerance( 0.05 );
> optimizer->SetLineSearchAccuracy( 0.9 );
> optimizer->SetDefaultStepLength( 1.5 );
> optimizer->TraceOn();
> optimizer->SetMaximumNumberOfFunctionEvaluations( 1000 ); "
>
> But I guess these should be correct for the given example.
>
> I got confused as to whether my building process was right. I compiled
> the examples again. I tried both in windows and Linux. It gives me the
> same error.
>
> Problem 2:
>
> When I try to use the Demons algorithm (DeformableRegistration2)
> with "RatSlice" example it simply "aborts" after some iterations
>
> Prob 3:
>
> I also tried FEM ( DeformableRegistration1). This works. But the
> Mean absolute error only reduces only by 20% after registration. The
> difference image before and after registration doesn't look much
> different.
>
> Question:
>
> I looked at some papers in cardiac Image registraion to know which
> registration algorithm I should use. It is very inconclusive and
> people claim different methods for different applications. I was
> wondering if B-spline registration would work well for cardiac CT/MR.
> I actually tried registering 2 cardiac cubes in the time cycle (with
> Bspline for 3D). But it kept running for 50 mins. Does it generally
> take that long?
>
>
> I am sure some of the questions that I am posting would be very basic.
> I am in the process of learning and hope someone could clarify the
> issues that I have.
>
> Thanks
> Hari
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rat2RegisteredToRat1d.jpg
Type: image/jpeg
Size: 10753 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20050602/c3a0c638/Rat2RegisteredToRat1d-0001.jpg
More information about the Insight-users
mailing list