This test runs a two-stages registration process including following stages:
1) Affine
2) Displacement Field
That the affine stage is run in 3 resolution levels, but the displacement field registration is run only in full resolution.
For evalution the checker board result before and after regsitration are shown.
In [1]:
## Boiler plate code common to many notebooks. See the TestFilesCommonCode.ipynb for details
from __future__ import print_function
%run TestFilesCommonCode.ipynb
SimpleITK Version: 0.9.0.dev2042-g22c5b
Compiled: Aug 14 2014 10:17:06
In [2]:
fixedImageFilename = fdata('ITK/Modules/Registration/RegistrationMethodsv4/test/Input/r16slice_rigid.nii.gz')
movingImageFilename = fdata('ITK/Modules/Registration/RegistrationMethodsv4/test/Input/r64slice.nii.gz')
fixed = sitk.ReadImage(fixedImageFilename,sitk.sitkFloat32)
moving = sitk.ReadImage(movingImageFilename, sitk.sitkFloat32)
myshow3d(fixed, xslices=[], yslices=[], zslices=[], title="fixed")
myshow3d(moving, xslices=[], yslices=[], zslices=[], title="moving")
In [3]:
cshow(fixed,moving)
<bound method ResampleImageFilter.GetTransform of <SimpleITK.SimpleITK.ResampleImageFilter; proxy of <Swig Object of type 'itk::simple::ResampleImageFilter::Self *' at 0x119ad5d50> >>
In [4]:
# Set the first stage
tx1 = sitk.AffineTransform(fixed.GetDimension())
In [5]:
ctx = sitk.Transform(tx1) # Set composite transform
# This composite transform is update at each stage
# and finally will be considered as the output of
# the registration process since the InPlace is TRUE.
ctx.SetFixedParameters(ctx.GetFixedParameters()) # hack to force deep copy, as registion is done in place..
# Set the registration filter
R = sitk.ImageRegistrationMethod()
R.SetMetricAsJointHistogramMutualInformation()
R.SetOptimizerAsGradientDescent(learningRate=1.0,
numberOfIterations=100,
convergenceMinimumValue = 1e-6,
convergenceWindowSize = 10,
estimateLearningRate = R.EachIteration,
maximumStepSizeInPhysicalUnits = 1.0)
R.SetOptimizerScalesFromPhysicalShift()
R.SetShrinkFactorsPerLevel([3,2,1])
R.SetSmoothingSigmasPerLevel([2,1,1])
R.SetInitialTransform(ctx)
R.SetInterpolator(sitk.sitkLinear)
R.SetMetricSamplingPercentage(0.5)
R.SetMetricSamplingStrategy(R.RANDOM)
Out[5]:
<SimpleITK.SimpleITK.ImageRegistrationMethod; proxy of <Swig Object of type 'itk::simple::ImageRegistrationMethod *' at 0x119afeb10> >
In [6]:
R.RemoveAllCommands()
R.AddCommand( sitk.sitkIterationEvent, lambda: command_iteration(R) )
affineOut = R.Execute(fixed,moving)
print("-------")
print(affineOut)
print("Optimizer stop condition: {0}".format(R.GetOptimizerStopConditionDescription()))
print(" Iteration: {0}".format(R.GetOptimizerIteration()))
print(" Metric value: {0}".format(R.GetMetricValue()))
0 = -0.270647627741 : (1.001306885818428, 0.0008214603217921771, 6.99574560723524e-05, 1.000590718630546, 0.4426852974231777, 0.05784754646164925)
1 = -0.276300690468 : (1.0026360381020551, 0.0016137327906858966, 0.00012497687090230134, 1.0011893238459002, 0.8883539341641569, 0.11259452715327137)
2 = -0.281481126518 : (1.0040047229086972, 0.00231445325885333, 0.00020030372842710898, 1.0019460489762069, 1.3278774750614866, 0.1957951957804001)
3 = -0.287467048396 : (1.005443199637179, 0.002922359534927167, 0.00017794376376373074, 1.0028131793730928, 1.776801219059672, 0.26175615890028636)
4 = -0.291728434987 : (1.0068759181674456, 0.00355875614073626, 9.476475087280798e-05, 1.0035737752147404, 2.2368875579617025, 0.3013146339697172)
5 = -0.297185934378 : (1.0082691661063463, 0.004243609757382206, 6.17263415820648e-05, 1.0042747061546868, 2.6915860581606794, 0.3590483944991801)
6 = -0.302060262905 : (1.0096093571890443, 0.004883076409746718, 0.00022885292488917397, 1.0051644430617586, 3.108574781515776, 0.505004392504172)
7 = -0.309885296627 : (1.010811593667599, 0.005415510212564434, 0.0005936412021403025, 1.0062973243211855, 3.4710418944694785, 0.7341530085577741)
8 = -0.317549447099 : (1.0119904303156235, 0.00599595349641342, 0.0009663821524702351, 1.007375438746922, 3.8404892710461627, 0.9572973157989162)
9 = -0.324968005134 : (1.0132092202622907, 0.006617649758126018, 0.0013011216322604921, 1.0083471067103473, 4.227365646434775, 1.1611129728284493)
10 = -0.333047223222 : (1.0144250774273864, 0.0072054694994549175, 0.001616443622802593, 1.0093689921323872, 4.614717534184953, 1.370783648629959)
11 = -0.341920095665 : (1.0155514624474702, 0.0078064362173456935, 0.0019901204844479715, 1.0104712133925544, 4.976066708789593, 1.608790544266538)
12 = -0.350972626781 : (1.0166441367507029, 0.008464342111282967, 0.0023804915038575024, 1.0115425710779837, 5.334550906291195, 1.8462751754068263)
13 = -0.358254781992 : (1.0178053755631464, 0.00919463754368615, 0.0026817604423756635, 1.012498376210646, 5.720823634394084, 2.0417100446971306)
14 = -0.366724359267 : (1.0190450629720476, 0.009975277305348878, 0.002879035953712468, 1.0132612738518918, 6.139667961328063, 2.182945817389276)
15 = -0.375167726017 : (1.020265724716443, 0.010726259903499062, 0.0031044097829427747, 1.0140665235136985, 6.554821092147541, 2.3427823257560876)
16 = -0.384048512158 : (1.0214788924249047, 0.0114406785519605, 0.003368377308965456, 1.014908859666816, 6.959826217355914, 2.526897126335265)
17 = -0.391608455196 : (1.0226903343239406, 0.01209720785185762, 0.0036582842177749187, 1.0158311959349933, 7.352052076759679, 2.734166729459709)
18 = -0.3993412753 : (1.023981930283568, 0.01270114003367957, 0.003907365890764249, 1.016731389170136, 7.749775730045196, 2.9365053171792677)
19 = -0.407058167187 : (1.0252886615779675, 0.013293597111724694, 0.0041470721716400745, 1.0176308027955778, 8.147244655592617, 3.1403306000412745)
20 = -0.416448164336 : (1.0264471240529331, 0.013880457323969947, 0.004517432040426287, 1.018604750146272, 8.514401733458586, 3.3982271088697265)
21 = -0.427815359903 : (1.0274425653001145, 0.01446598539654345, 0.0050169907371183705, 1.0196472184079537, 8.84123839441572, 3.7025894270486823)
22 = -0.437686386187 : (1.0284452012750556, 0.015062016122175826, 0.0055045022388826, 1.0206554323646877, 9.18598096911828, 3.99454021583398)
23 = -0.447823438119 : (1.0295267832832524, 0.015694349606360947, 0.005914682645637335, 1.0215849178235894, 9.567459714084647, 4.244561608927894)
24 = -0.46035023882 : (1.0306378841720893, 0.01637412795573711, 0.00627484276718539, 1.0224418265015367, 9.96928570454648, 4.466351771072951)
25 = -0.470327799081 : (1.03175183611437, 0.01709069440243833, 0.006632367355170153, 1.023274627518113, 10.367350041265928, 4.684689232812848)
26 = -0.482258670322 : (1.0327718931822263, 0.0178212939333964, 0.007080608687524135, 1.0241666825476847, 10.735283803193838, 4.9400667560608)
27 = -0.493989133919 : (1.033782397650393, 0.018538072226990773, 0.00752398123326105, 1.0250916845937998, 11.100181828539274, 5.200217453249879)
28 = -0.507218096114 : (1.0347989240183602, 0.019230986491298944, 0.007938240114270837, 1.026030962167876, 11.47878148089236, 5.4517098290927954)
29 = -0.518141736824 : (1.03581768422011, 0.019909652390048837, 0.008340005661970408, 1.0269662733242677, 11.86806756322836, 5.696776903400665)
30 = -0.529257767093 : (1.0367974776722848, 0.020520522601081656, 0.008776236789704066, 1.027995740254584, 12.240293941537676, 5.966389208570492)
31 = -0.542406112499 : (1.0378069220782644, 0.021196477470518043, 0.009184515311457564, 1.028918492980391, 12.631728172804447, 6.2142076051222235)
32 = -0.554490853231 : (1.0387569783003054, 0.02190137499617961, 0.009626001879888714, 1.0298500276840363, 13.011830650513023, 6.476800998659629)
33 = -0.565867842042 : (1.0396851451211133, 0.022588776102683054, 0.010063436286939046, 1.0308068887182942, 13.390066959731568, 6.748981827599707)
34 = -0.575584073376 : (1.0404807165868724, 0.023171579243112545, 0.01060423890076569, 1.0319148455200104, 13.711706270306955, 7.079964353665189)
35 = -0.587972032494 : (1.0411029444822082, 0.02358133812399592, 0.011215071580788197, 1.03318915130227, 13.960332907171294, 7.467985584108429)
36 = -0.598100986757 : (1.0416712651850504, 0.02397529484124011, 0.011834869371143981, 1.0344755571582038, 14.19115183869536, 7.870429950256656)
37 = -0.613248455415 : (1.0422630252142422, 0.024446088278262657, 0.01245083203896199, 1.0357087401205727, 14.438197599620725, 8.263844046431684)
38 = -0.623647245491 : (1.0429451101267768, 0.025042049551415726, 0.013059449913718602, 1.0368260145989374, 14.726163573662806, 8.624027659212079)
39 = -0.635050525442 : (1.0436949177474688, 0.025629617476242515, 0.013645971260184606, 1.037907837499053, 15.0302076983856, 8.974185280916647)
40 = -0.645884086229 : (1.0444063602251803, 0.0261107390325582, 0.01423221323514352, 1.0390805016026718, 15.312208004142075, 9.346403311347599)
41 = -0.656428905587 : (1.0451164331414156, 0.026546819442512158, 0.014807709836634668, 1.0402872313464495, 15.59569415297819, 9.71986224643833)
42 = -0.665185381569 : (1.0457307221940488, 0.026617274438007432, 0.015371027322242997, 1.0417109328815053, 15.816031150879162, 10.140248594147197)
43 = -0.67737642912 : (1.046255540091815, 0.02664443758357862, 0.015977163054901725, 1.043138952470453, 16.0049366518422, 10.573705786362417)
44 = -0.687908275209 : (1.046812720112207, 0.026701028558529735, 0.016583460195982853, 1.0445415658075556, 16.221221355591517, 10.997699599441747)
45 = -0.694885201729 : (1.0474270301540913, 0.0269119771706694, 0.017202861370885534, 1.0458430502134708, 16.466172510506716, 11.407263902806976)
46 = -0.706419733155 : (1.0480289926820143, 0.027231680101893814, 0.017833047740412798, 1.0471019131301174, 16.719206463666673, 11.807755867312792)
47 = -0.716134936365 : (1.0486728750905079, 0.027664029590174225, 0.01841966628615075, 1.0483142338642197, 17.00873275009177, 12.184757220927791)
48 = -0.725124500404 : (1.0491408160389595, 0.027902579394756533, 0.019045446006909564, 1.0496872800788635, 17.21170534709428, 12.607099523195759)
49 = -0.732848529396 : (1.0496663432139046, 0.028171495381880334, 0.019642307483414938, 1.0510693189744722, 17.43904157920868, 13.013952881503714)
50 = -0.741271436491 : (1.050222916337623, 0.028390187644730003, 0.020216700149791114, 1.0524815828953156, 17.67805916661512, 13.41555577224579)
51 = -0.750110439641 : (1.0508273226454505, 0.028592558784923276, 0.02071444302663139, 1.0539446063603721, 17.942895808812107, 13.806415734193381)
52 = -0.758071983014 : (1.0513872575474814, 0.028694340871159473, 0.02111836980863676, 1.0555578025957608, 18.19751765158487, 14.205481387024697)
53 = -0.764536383275 : (1.0521250495941676, 0.02885823303305929, 0.021363887518314806, 1.0572204871913278, 18.54662402413057, 14.542601134972536)
54 = -0.771340918654 : (1.0528817136045043, 0.028699875426320305, 0.02146437872732516, 1.0591803350980977, 18.900236944958444, 14.886503770802845)
55 = -0.773121847203 : (1.0542766783822308, 0.028056121555423395, 0.020678493593995317, 1.0613482698811258, 19.54222414072964, 14.942317293941716)
56 = -0.773944682147 : (1.0554635382485633, 0.026361742208190563, 0.01913666878185955, 1.0631569829913419, 20.093953225049273, 14.79343611878312)
57 = -0.773162168351 : (1.055964820990067, 0.02345730790102873, 0.01775678798394427, 1.0660444270890799, 20.34911641421694, 14.95398934941239)
58 = -0.776051499743 : (1.0565061051704603, 0.021030923660838103, 0.015869495602355874, 1.0671375441655955, 20.70102173076197, 14.549969576291092)
59 = -0.77247969477 : (1.0559245497662304, 0.01986031201214045, 0.01616617099209698, 1.0681872064170328, 20.456640252552713, 14.93893357799542)
60 = -0.777953992469 : (1.0564470786112923, 0.017398334185313516, 0.014456954918951194, 1.0695023803839903, 20.984605207482705, 14.609634026603358)
61 = -0.775380170274 : (1.0555685046505396, 0.015796462244153296, 0.014560306852070558, 1.070260791874448, 20.739806278140236, 14.887800609882367)
62 = -0.782546537437 : (1.0554494231019558, 0.013438077064038621, 0.014269744023361123, 1.0724484495581526, 20.98183033275343, 15.277376974026105)
63 = -0.786400395067 : (1.0554730111252948, 0.012250168254379393, 0.014381212101586185, 1.0747350452372477, 21.185679133877724, 15.6659464687402)
64 = -0.787468727755 : (1.0557657381105576, 0.011178570182334157, 0.014398666900983334, 1.0773250904547604, 21.50066753953821, 15.998323866875891)
65 = -0.784692097686 : (1.0564731981543871, 0.010230069928833211, 0.013350638885600155, 1.079340253237048, 22.13467660580056, 15.671133095146699)
66 = -0.782327920833 : (1.055823691032928, 0.009161596338524482, 0.013608403340747324, 1.081694412318836, 22.167305290017293, 15.927515656295803)
67 = -0.782567329844 : (1.0559690016740215, 0.008709030357023377, 0.012454733386981583, 1.081945753530029, 22.50481501818865, 15.288394602175341)
68 = -0.784248483156 : (1.0554134505548525, 0.007965542718857238, 0.012995835922267834, 1.0836616297472312, 22.4802048021983, 15.656028681238979)
69 = -0.78182732534 : (1.0546506115211303, 0.006734798573724671, 0.011844314115303938, 1.0845151940343252, 22.683218360891708, 14.94325531429485)
70 = -0.785801051278 : (1.0537946289722204, 0.005601411465817642, 0.012392099861277628, 1.0861609367479235, 22.702432704486522, 15.267775689526957)
0 = -0.774499472794 : (1.0530969924744256, 0.005086278088474755, 0.011578318564359667, 1.085495154104371, 22.519236307525176, 14.749631357296801)
1 = -0.777239953975 : (1.0525702214055002, 0.004597559974981847, 0.01065874719373754, 1.0848252697919663, 22.430227308436322, 14.19422153963541)
2 = -0.778474004419 : (1.0514448919189092, 0.0032713861425153357, 0.010084456529880641, 1.0848037731682971, 22.092446303825962, 13.99094379998317)
3 = -0.780872213832 : (1.0502402477295256, 0.0016504706993981213, 0.010000410365070213, 1.085450078224622, 21.80855510756748, 14.050492360299653)
4 = -0.783297105805 : (1.0499020964923853, 0.0015548941034783232, 0.009331165759082626, 1.0846473166231134, 22.446095651444278, 13.566197945416901)
5 = -0.779461688035 : (1.049519313604731, 0.0009301098229925102, 0.009974241977209603, 1.0858177603832093, 22.311315661036982, 14.0410386739574)
6 = -0.783661966324 : (1.0484902643311174, -4.724716515303864e-05, 0.009154481031498737, 1.0849578091515477, 22.428253765323486, 13.524343615072624)
7 = -0.782722570989 : (1.048219334790437, -0.0005455471649202332, 0.009864326782194661, 1.0861538989112705, 22.377052986245562, 14.023868041872417)
8 = -0.786372891846 : (1.0476149281315912, -0.0009522641754714613, 0.009069533991745796, 1.0852295687624856, 22.881554239895404, 13.479680983191626)
9 = -0.783367752198 : (1.0472387537257475, -0.001545648804463367, 0.009737860170747912, 1.0863887929103206, 22.753609713899174, 13.958088297186316)
10 = -0.785891849204 : (1.046070330410561, -0.002548619563047759, 0.008985541145471653, 1.0853260328740049, 23.063593442211552, 13.429314779428752)
11 = -0.784550287428 : (1.0457936993577281, -0.0030089676530956483, 0.009702228842773285, 1.0865253364712955, 22.987391323965497, 13.922112032699673)
12 = -0.788767787464 : (1.044674656244682, -0.003820090714686579, 0.008983386374443058, 1.0854004905059993, 23.470262475628545, 13.37705224094944)
13 = -0.786203628354 : (1.0443494160852778, -0.004293706316912881, 0.009702827229340339, 1.0865514039698696, 23.359449480427905, 13.866946152678706)
14 = -0.791188180614 : (1.042928700249522, -0.005317365783584514, 0.009002193843400706, 1.0854282944456901, 23.755032847726728, 13.33689339813945)
15 = -0.788431018833 : (1.0426356240705588, -0.0057519989479816675, 0.00973675517189926, 1.0865834058145905, 23.662108512958646, 13.832885276631515)
16 = -0.792460210485 : (1.0410248636297041, -0.006749566754346721, 0.009099290862206146, 1.0853626332448534, 24.242809171016194, 13.294353708535025)
17 = -0.789521827136 : (1.0407175478190844, -0.007201251595556915, 0.00982044774659969, 1.0865245345002232, 24.138006668849325, 13.786011239689755)
18 = -0.795403203507 : (1.0384133687074564, -0.008646342681623379, 0.009315936720214127, 1.085367615834456, 24.558209610663994, 13.325856877725073)
19 = -0.794586259512 : (1.0381199259665446, -0.009052220689940216, 0.010063330155330034, 1.0865076277753223, 24.49005752899551, 13.831168562080308)
20 = -0.799563757092 : (1.0365964375077321, -0.00953522929035954, 0.009590873207694244, 1.0853500955314146, 25.233013725470688, 13.33481268051237)
21 = -0.795467116523 : (1.0361807942017855, -0.010070702495835783, 0.010281748700134694, 1.086477586218601, 25.086364354402384, 13.810679842524658)
22 = -0.801136393885 : (1.0341373538682985, -0.011545362222793797, 0.009931442139054279, 1.0857309064482759, 25.08940338268294, 13.55841871940341)
23 = -0.803617660443 : (1.0335359678761458, -0.011609175522215938, 0.010905481764394976, 1.0861680639232891, 25.64776019660712, 14.134787926467979)
24 = -0.806497840603 : (1.0320786830814994, -0.012798087451780162, 0.010372056001757725, 1.085669674674871, 25.483900024085685, 13.79776917160697)
25 = -0.808197541335 : (1.0311287978847283, -0.01267528265653669, 0.010428009697239529, 1.0849893884720294, 26.418080279143773, 13.699445028892093)
26 = -0.805726549348 : (1.0304378219198442, -0.013552896823174157, 0.010944725877063542, 1.0859209881455953, 26.175017973644366, 14.119033780123578)
27 = -0.811995703311 : (1.0288495532519866, -0.014795182531660556, 0.010433542779256863, 1.0853709768935715, 26.052267765678273, 13.794338571277995)
28 = -0.813576565545 : (1.0276023274286312, -0.014889941103400575, 0.010847290208700792, 1.0852488920378964, 27.036249916437317, 13.993340640498875)
29 = -0.812152965207 : (1.0263304233351984, -0.01627805100715783, 0.011001823854283605, 1.0856503133857531, 26.752193840484388, 14.2080249496835)
30 = -0.818775828112 : (1.024681382398362, -0.017199242641622318, 0.010211391201406765, 1.0846831533632622, 27.06585189382196, 13.687970807050512)
31 = -0.818312642869 : (1.0239398269980775, -0.018104093439110517, 0.010837223555671934, 1.085517989284094, 26.915033025094495, 14.160598967502143)
32 = -0.823648521084 : (1.023072768479995, -0.018277269273380303, 0.01016163084112001, 1.084557597419726, 27.657926024251502, 13.694834128365144)
33 = -0.818535835888 : (1.0224723426329434, -0.019001552080008106, 0.01078788190528644, 1.0855682157966757, 27.50838837220764, 14.170941075210925)
34 = -0.825500354973 : (1.0203137557581503, -0.020480733214685107, 0.010106396352620792, 1.0846271127545641, 27.76493793614512, 13.790509887883896)
35 = -0.82619953256 : (1.0190280449654758, -0.021499106880326725, 0.010944333382403543, 1.0850329543926818, 27.871899403948905, 14.381874407542497)
36 = -0.83227716093 : (1.0178196410924267, -0.022047769896367777, 0.010103897747333255, 1.0840116815016798, 28.640774484837163, 13.90058793706682)
37 = -0.828709459255 : (1.0169005626212348, -0.02289733754292695, 0.010761297989039475, 1.0848020897344564, 28.645590058527116, 14.449556527130959)
38 = -0.83468306194 : (1.0146802543451956, -0.023850711252789397, 0.010040409023840347, 1.0839217395012848, 29.612409561528466, 14.156613484425142)
39 = -0.830866263706 : (1.013560447348813, -0.024855981038514063, 0.010597847926643637, 1.0846784388167763, 29.629811109862395, 14.698741481683905)
40 = -0.834134725065 : (1.0123889755911886, -0.025441932618788462, 0.009529548008570903, 1.0839515761524348, 30.257833212231613, 14.155312520568279)
41 = -0.83099913913 : (1.011345277079977, -0.026521496296983943, 0.010008265702243727, 1.0846306877814023, 30.123814286949646, 14.627132719399153)
42 = -0.838206331433 : (1.0082543558158277, -0.02790376253819848, 0.009113068082860215, 1.0835743364271202, 31.06220437564347, 14.244299177857597)
43 = -0.835320618622 : (1.0073381338311662, -0.029024406759889647, 0.009515604325403815, 1.0841144067674293, 30.77988977297149, 14.635267168912835)
44 = -0.845177532266 : (1.0038831581889944, -0.031147937193952698, 0.008864940730569008, 1.0830064321779787, 31.332257463727167, 14.467517732614532)
45 = -0.848228766786 : (1.0027990668149098, -0.03227206501140958, 0.009324319691673497, 1.083517907238343, 31.121211895730152, 14.889520588312626)
46 = -0.854851036328 : (1.001467127617742, -0.03301611208288493, 0.008232738750804589, 1.0828798134734456, 31.84968312694917, 14.333943194618914)
47 = -0.850672909504 : (1.0005054331873493, -0.03406592901915841, 0.008704052904691244, 1.08342704836793, 31.59976599688118, 14.753869659977711)
48 = -0.857907750686 : (0.9971230911037814, -0.03646162998737146, 0.008064651988190742, 1.0823505344846307, 32.22089146970883, 14.554177009657394)
49 = -0.861450245482 : (0.995538946931517, -0.03793115736610621, 0.0085487917086659, 1.0823043303294955, 32.12258795247273, 14.989094347499636)
50 = -0.868280796876 : (0.9941529768504916, -0.03907464334892403, 0.007457157353352161, 1.0816351692508, 32.96694591527971, 14.445828031727656)
51 = -0.864891086741 : (0.9932570014743766, -0.040051556993284915, 0.008005488724783042, 1.082078107304052, 32.65296601218041, 14.839275008703686)
52 = -0.871119501728 : (0.9913851726183591, -0.0418831334028002, 0.008187995380330184, 1.0819688100415352, 32.56482979187415, 14.940574969177906)
53 = -0.87438998305 : (0.9913071338821943, -0.041519355142099805, 0.008067593940638175, 1.0817279790693832, 33.45871856145766, 14.832344906487739)
54 = -0.870384794311 : (0.9902644981447332, -0.04268259225097872, 0.008185432330993291, 1.0816458019338784, 33.00148050093872, 14.892222440460378)
55 = -0.87607495669 : (0.9879649156882948, -0.04518241530730472, 0.008366099951194524, 1.0813878060575164, 34.01800184690951, 14.879698875622037)
56 = -0.876938281451 : (0.9869508381967368, -0.04632882868907899, 0.008530450199773493, 1.0813591459225964, 33.552381834878666, 14.946483462984098)
57 = -0.881574307489 : (0.9863988965086024, -0.046763839473620936, 0.009038875170306427, 1.0816665864768673, 34.553794885377634, 15.009091020303352)
58 = -0.878334390688 : (0.9853442221493302, -0.047800266550517244, 0.008949869567764581, 1.0814128914831584, 34.08541065287577, 14.892967682418197)
59 = -0.883220783203 : (0.9840331678028681, -0.04935613461771726, 0.009617177625938443, 1.0817064747265333, 33.872435631253396, 15.062063483780532)
60 = -0.885910882393 : (0.9843364319983892, -0.048907799948701314, 0.00919622816481498, 1.0812195170187477, 34.50255118458233, 14.705713401440908)
61 = -0.884509241302 : (0.9836077064661891, -0.04969241782079271, 0.010035402070688744, 1.081919405628052, 34.220521384485295, 15.088507054659235)
62 = -0.886589241708 : (0.9833053230197709, -0.05001143345976936, 0.009306005531452369, 1.0809641769184573, 34.39344683332913, 14.502873156242165)
63 = -0.88561671479 : (0.9834341275384291, -0.04983135951563749, 0.010270437633363846, 1.0819347688452592, 34.58496320904505, 14.993242201461246)
64 = -0.886994251805 : (0.9825743455451784, -0.05086322352674637, 0.009807006847961748, 1.0812123639821227, 34.31746909149661, 14.604165977995148)
65 = -0.886836289805 : (0.9829121587092613, -0.050374134139794434, 0.010680463046316658, 1.0820727513032387, 34.63941532635097, 15.031081095304165)
66 = -0.887826563818 : (0.9823129030766925, -0.05115898862520809, 0.010019016478381012, 1.0812655637109847, 34.50245552865075, 14.512841514431223)
67 = -0.886330024844 : (0.9825960155041653, -0.050777157433662706, 0.010961854662381575, 1.0822085541040474, 34.75199986789701, 14.9624359296334)
68 = -0.888304852446 : (0.9818029543914877, -0.05168392903111286, 0.010432363903746593, 1.0813961577007771, 34.5228849399532, 14.529901486764437)
69 = -0.887814702223 : (0.9821296420627073, -0.05121515004771071, 0.011347599189922527, 1.082288347453269, 34.81588636453353, 14.960548546615213)
70 = -0.887898521738 : (0.9814286519141898, -0.05199484800004459, 0.010769319854350024, 1.081423663432555, 34.61277575789308, 14.491761042445201)
71 = -0.888895895573 : (0.9817437074777129, -0.05155032056070534, 0.01169560871305643, 1.0823328423284768, 34.89032977717043, 14.928698363807772)
72 = -0.888467721883 : (0.9810757964970056, -0.052264264308862086, 0.011135995483946275, 1.08151882972932, 34.64897252057959, 14.452250413724858)
73 = -0.889943115897 : (0.9814029292127796, -0.05178727558888474, 0.012057269739803495, 1.0824046079773877, 34.939635757694276, 14.88319400497875)
74 = -0.888834238243 : (0.9807366597221574, -0.052490045019496834, 0.011495706422029841, 1.0815756153562588, 34.70600540976912, 14.403331741740649)
75 = -0.890660013495 : (0.9810629385714146, -0.052020044981124405, 0.012419633581970653, 1.0824673082532805, 34.990888968973, 14.836449561822292)
76 = -0.889330701824 : (0.9803975432927434, -0.05271607000469854, 0.011857236095577886, 1.08162747038607, 34.76214748701484, 14.354875560310928)
77 = -0.891143613059 : (0.9807266735527342, -0.05224866365234318, 0.012782499565351014, 1.0825212851261274, 35.04326514141533, 14.789191028307071)
78 = -0.889449853614 : (0.9800640176137121, -0.05293989753683294, 0.012218824224019317, 1.0816762111121914, 34.8180153816998, 14.305637886565737)
79 = -0.89123276934 : (0.9804208651066267, -0.052463024142788875, 0.013133819740110233, 1.082562840318333, 35.10564412415797, 14.735638398191849)
80 = -0.890216573559 : (0.9797424807536939, -0.05317110508041353, 0.012578563881708204, 1.081723881461723, 34.87404694333598, 14.258330829532719)
81 = -0.891945159399 : (0.9801000617232233, -0.05269516392247187, 0.013494637024086289, 1.082608908712369, 35.160060010856604, 14.689435855754642)
82 = -0.890389051825 : (0.9794185957215282, -0.05340312300030988, 0.012941560336062571, 1.0817678859247006, 34.92799588397626, 14.21294934821471)
83 = -0.891853900916 : (0.9797775506697118, -0.052923740456033576, 0.013857427284359477, 1.0826490175639012, 35.214683280720024, 14.64403623269711)
84 = -0.891019885668 : (0.9791012133997816, -0.053617449978179035, 0.013298600376693226, 1.0817973651645576, 34.99203573175953, 14.161849743364302)
85 = -0.892079901036 : (0.9794515775281063, -0.053163589744947976, 0.014229035842094962, 1.0826954532230466, 35.259734195992245, 14.600217413529741)
86 = -0.891499480009 : (0.9787860289623982, -0.05384200810476303, 0.01366575197883203, 1.0818316668852543, 35.04573168364033, 14.112234603174821)
87 = -0.892627439231 : (0.9791374985235004, -0.05338892776960934, 0.014596277950978913, 1.0827315822777224, 35.31105172041255, 14.551330689591198)
88 = -0.892375598626 : (0.9784196733329612, -0.0540873654520369, 0.014068864672305122, 1.081830977067016, 35.08499502504436, 14.08405652344339)
89 = -0.893294263978 : (0.9787872900216551, -0.05360979301193128, 0.014992399088513717, 1.0827158201702787, 35.36050154589793, 14.517774875031238)
90 = -0.892612529261 : (0.9780835205761121, -0.0542759224550139, 0.014453035715016136, 1.081793719892426, 35.150741232074054, 14.040055161481348)
91 = -0.893923942378 : (0.9784409215819543, -0.053813121554812, 0.01538302403362096, 1.0826864584558138, 35.41806854794036, 14.478011218008353)
92 = -0.893054659701 : (0.9777269498827832, -0.05446335500987696, 0.014841923240928083, 1.0817528285766, 35.2174738081397, 13.9967115734364)
93 = -0.894502255498 : (0.9780753493966694, -0.05401574231169203, 0.015778305742367688, 1.0826540640115265, 35.476733412454436, 14.438319874612585)
94 = -0.89372528067 : (0.9773594969176472, -0.054646540832347205, 0.01523160480753277, 1.0817067449831863, 35.288778804067036, 13.951242460852233)
95 = -0.894482252626 : (0.9776948790873807, -0.0542164907796649, 0.01617470370607429, 1.0826168568237229, 35.538903415330196, 14.397330314643149)
96 = -0.894625678292 : (0.9769989757901054, -0.05485580296581272, 0.015686221713259126, 1.0817728792736059, 35.24924481042372, 13.938576042543623)
97 = -0.895042868537 : (0.9774094010463359, -0.05432827561778651, 0.016588999754955917, 1.082628783982499, 35.5453126051166, 14.359179716464615)
98 = -0.895048074756 : (0.9766808833225811, -0.05493391751194127, 0.01603843556645764, 1.0816116524381354, 35.39115941035671, 13.869401115250785)
99 = -0.896254199708 : (0.9770074636001833, -0.054510644680421015, 0.016984058411955313, 1.0825256253206865, 35.63851031788919, 14.317084321618852)
0 = -0.891735279341 : (0.9765544763714399, -0.05497598445263664, 0.01640082115058973, 1.081690148620207, 35.33999472832135, 13.830289262824033)
1 = -0.89462783135 : (0.9754322698793039, -0.05592702870978529, 0.018268814457842824, 1.0816415493317688, 34.96412817481725, 13.796635810392294)
2 = -0.889721068188 : (0.9763683079880016, -0.05516321660633439, 0.018281378657146186, 1.0816792099519583, 35.53202096191212, 13.765301757359953)
3 = -0.895728531847 : (0.9754934097066269, -0.05592149902952448, 0.01851112696685947, 1.0810997741237576, 35.017244182166955, 13.485049283376076)
4 = -0.891404264166 : (0.9762626009916993, -0.05517598150490734, 0.018959464787873297, 1.081580815944344, 35.5225366251222, 13.704878267319502)
5 = -0.896050949864 : (0.9754279777164122, -0.055936932570826596, 0.01912913715375704, 1.08093112097332, 35.037341258122524, 13.371089332716128)
6 = -0.892046902596 : (0.9761720413727366, -0.055213981062611855, 0.019608288724220064, 1.0814485937603258, 35.53101755465419, 13.617475746664672)
7 = -0.896437415417 : (0.9752571128139362, -0.05599965661068526, 0.02000569575008815, 1.0809164985418545, 35.01648942979874, 13.32837845804372)
8 = -0.891603300337 : (0.9760679934829722, -0.055263550426971654, 0.02039723366437548, 1.08137235277267, 35.53169638517365, 13.531706051348847)
9 = -0.896632733626 : (0.9750954589288597, -0.05610706827115485, 0.02096463943367835, 1.0806966542106589, 35.06261796818504, 13.19163866886576)
10 = -0.892121656498 : (0.975889713982605, -0.05537479183946569, 0.02138784098872125, 1.0811794241686365, 35.566809351882206, 13.413631946236857)
11 = -0.897083018756 : (0.9747509703547372, -0.05624532090042622, 0.022443081621313754, 1.0807923372839106, 35.07863278166189, 13.193504444831646)
12 = -0.892342906996 : (0.9756271328487074, -0.05550127732263503, 0.02270999872485291, 1.0811267153987256, 35.624148812468015, 13.330334726542972)
13 = -0.89724689215 : (0.974793330757069, -0.056267701893402855, 0.022992127009854185, 1.0801353729636258, 35.27451050387415, 12.854818637714132)
14 = -0.893354731707 : (0.9753888201812531, -0.05566701102246107, 0.023640503498456575, 1.0808223837848905, 35.68405932344663, 13.216453008670733)
15 = -0.898249514097 : (0.9742897450999344, -0.05657270965626033, 0.024733590645121598, 1.080880992742468, 35.22533296248797, 13.173327183979199)
16 = -0.893997302126 : (0.9752099621437452, -0.05582675101285333, 0.024741665667000392, 1.080925478586433, 35.80194834414069, 13.161876139310328)
17 = -0.89843536754 : (0.9743821790788952, -0.0566384000874451, 0.02466798958065255, 1.0803295180519636, 35.37480996659634, 12.79442275686559)
18 = -0.894840427264 : (0.9750868188380175, -0.05597938624523321, 0.025199805267976584, 1.0809327534460411, 35.84077775505081, 13.08931761498332)
19 = -0.898883059019 : (0.9741390558916572, -0.056815464736568254, 0.025308655887559966, 1.080412044555842, 35.37283805633795, 12.804085456290029)
20 = -0.894995304042 : (0.9749152527191206, -0.05611590606966208, 0.025744360203116847, 1.0808882082293294, 35.88065614846194, 13.04237956555559)
21 = -0.899305891769 : (0.9740759679607063, -0.056919263785199986, 0.025706022346731396, 1.0803095624766623, 35.43708643715178, 12.68967201027792)
22 = -0.89552709054 : (0.9747798013523516, -0.05625724413373894, 0.026234572887701348, 1.0809066058893295, 35.90502606892361, 12.983429803150447)
23 = -0.899653629419 : (0.9739315723595559, -0.057056802183318954, 0.026198190298666123, 1.080310338649385, 35.46812511604251, 12.625739567335607)
24 = -0.895855301222 : (0.9746279607976986, -0.056396732293326014, 0.02673691049205789, 1.080907596723281, 35.93115430314542, 12.926982167177478)
25 = -0.900071063628 : (0.9738060831524207, -0.057178906568920905, 0.026632861191298932, 1.0802356547644618, 35.518078327338216, 12.5519339333941)
26 = -0.89626725893 : (0.9744782344803868, -0.0565419691705138, 0.027196510139767142, 1.080873926845168, 35.96588615276567, 12.872061656516074)
27 = -0.900253585757 : (0.9736525578691405, -0.05731488845540878, 0.027092757182071638, 1.080181583008254, 35.55858764621605, 12.49196936027709)
28 = -0.896615448928 : (0.974317276698271, -0.05668164230841824, 0.02766215312521218, 1.0808297858731644, 36.00211002575207, 12.816895259150836)
29 = -0.900588466858 : (0.9734808168052335, -0.057446200361157225, 0.02756410219940956, 1.0801215629255452, 35.59811477255344, 12.43565246617839)
30 = -0.896758472244 : (0.9741422670671243, -0.05681365930959079, 0.02813608129899988, 1.0807707112190785, 36.04043013150829, 12.762376553451988)
31 = -0.900840626951 : (0.9732994282558456, -0.05756424994703189, 0.028042351721737767, 1.080039373604238, 35.64159139696598, 12.376220061283695)
32 = -0.897043901539 : (0.9739392181633789, -0.05695207745225699, 0.028635382864625414, 1.0807147356766749, 36.07122382861227, 12.718213920300862)
33 = -0.901281206751 : (0.9731637416674296, -0.05767872800051787, 0.0284977438851462, 1.0799208322004874, 35.70308259072185, 12.29242596380534)
34 = -0.897441194528 : (0.9737598007774496, -0.05709963291573534, 0.029137995318729046, 1.0806294755380481, 36.10715483100878, 12.661481459793618)
35 = -0.90167649298 : (0.9729944547757345, -0.057801881980420564, 0.029006146882467686, 1.079774650585104, 35.74495212672225, 12.233344302723784)
36 = -0.897750985195 : (0.9735507849769821, -0.057242053720373776, 0.02967562442814376, 1.0805103088198342, 36.13133209193395, 12.618974732512203)
37 = -0.901814834553 : (0.97287163582756, -0.057905030866108126, 0.029496240257271784, 1.079592778099468, 35.81091714543628, 12.146758942729958)
38 = -0.898568955191 : (0.9733838619162377, -0.05738835585054159, 0.03020180644795165, 1.080376463002694, 36.1636132871073, 12.557847968151345)
39 = -0.902474985076 : (0.9727082788031982, -0.05805625696931577, 0.03028120188802653, 1.0794114799874648, 35.87437186563811, 12.005548791064802)
40 = -0.898884475017 : (0.9731266004780814, -0.05764252299215541, 0.03104032241834888, 1.0802789710395206, 36.167633098320344, 12.455846422916295)
41 = -0.902929237256 : (0.9730300029564305, -0.057597118597454415, 0.032618056958570125, 1.0797096101014385, 36.99693686335339, 12.059814786974504)
42 = -0.900993774133 : (0.9722335478111435, -0.05845117410826919, 0.032997804609293205, 1.0801579772384617, 36.5015138930269, 12.253913176430897)
43 = -0.903901149012 : (0.9713045658710692, -0.05937868850799433, 0.033088064842098495, 1.0798112690664217, 36.010983956162235, 12.045851751108774)
44 = -0.900494535421 : (0.9721470017069814, -0.058697591973160254, 0.03350314258888849, 1.080310442587328, 36.50776681454177, 12.28135148497812)
45 = -0.904072747658 : (0.9714740561826237, -0.059379384213792206, 0.033235235178947005, 1.0794994592500111, 36.15555367550377, 11.837103244862456)
46 = -0.901399405248 : (0.9719924262396505, -0.058892407807691, 0.0339736434885607, 1.0803341742063786, 36.47662133366845, 12.25475368949399)
47 = -0.903906054483 : (0.9717024464925591, -0.05933958330781463, 0.033453694435085814, 1.0793950067038882, 36.3357502675397, 11.680255446897242)
48 = -0.901925786192 : (0.9718635816361275, -0.05916785231909336, 0.03430197573607922, 1.080414434830675, 36.475283236708265, 12.180601366512871)
49 = -0.904025395611 : (0.9716783568202704, -0.059547392407806175, 0.03381926181658795, 1.079432340425452, 36.40206846160876, 11.57587419562578)
50 = -0.901861452301 : (0.9717933929578237, -0.059430332608472074, 0.03467174897194993, 1.0804641021175816, 36.51118384780683, 12.083230053956482)
51 = -0.90404772024 : (0.9714471434275536, -0.05992785458356943, 0.034565796071716226, 1.079243602085078, 36.4788178557931, 11.449900073587095)
52 = -0.901787099722 : (0.9715586320625516, -0.05981686440002558, 0.03541470445113659, 1.0802883045215022, 36.57552292589964, 11.957311569021186)
53 = -0.904573254986 : (0.9706249466409524, -0.06079044902825737, 0.038233258928532056, 1.0803673381931183, 37.10497254073382, 12.198806532477201)
54 = -0.905877055803 : (0.9701142807739377, -0.06133421472184052, 0.037640638986960975, 1.0796003113247157, 36.804466283473346, 11.721160135764658)
55 = -0.906882336549 : (0.9705092205341652, -0.06116497793712954, 0.038588732123183006, 1.080565220362192, 37.0892944157989, 12.138885084569068)
56 = -0.905332908886 : (0.9701141083897173, -0.061575533669536636, 0.037957436957327687, 1.0796913008790747, 36.860908558682596, 11.619577890342162)
57 = -0.906432496376 : (0.9703223296206551, -0.0615176796163999, 0.038939882017722235, 1.0806770092410791, 37.03669937477638, 12.089564978991994)
58 = -0.905737102756 : (0.970024976193988, -0.06187328052318863, 0.03828140015416258, 1.079763409321505, 36.85612060610775, 11.550520992628464)
59 = -0.906501168032 : (0.970397878158208, -0.061602827507410494, 0.03915365246661168, 1.0806811751309284, 37.124053515378506, 11.99803993849515)
60 = -0.905593863635 : (0.9699729267573742, -0.062053635515190476, 0.03854019810539416, 1.079820505876124, 36.879219706361496, 11.488095328580144)
61 = -0.906620653614 : (0.9703561627506522, -0.06170620970515117, 0.03934943419408018, 1.080695001610344, 37.179864319659096, 11.934302138079678)
62 = -0.906206381975 : (0.9698036470768183, -0.0622771415537605, 0.038794952611033925, 1.0799125898190798, 36.87027680531903, 11.469863737138475)
63 = -0.906523692524 : (0.9702962938925707, -0.06185053370285142, 0.03954633879124625, 1.0807367987979766, 37.2153660880288, 11.885314201520437)
64 = -0.90630841174 : (0.9697244200903868, -0.06242769694597046, 0.03900233246654106, 1.0799592714510722, 36.90423712950559, 11.422993233253033)
65 = -0.906718870061 : (0.9702058349871368, -0.062011247885116395, 0.03976609729889424, 1.0807939362149237, 37.235650511612924, 11.845869203075386)
66 = -0.906349354249 : (0.969630072547666, -0.06259140873634367, 0.0392245528798906, 1.0800156369598497, 36.924429722705774, 11.384511220998398)
67 = -0.906982738295 : (0.9701129548316421, -0.062172478160423476, 0.03998694820599355, 1.0808492664386695, 37.25644135569211, 11.806915739086834)
68 = -0.906476813298 : (0.9695158764469146, -0.06277217915110014, 0.03948638138401594, 1.0800897933957276, 36.91270772325895, 11.364822513928537)
69 = -0.906450305608 : (0.9700240376357592, -0.062333775963199486, 0.040226334143994756, 1.0809100769521751, 37.26313612375348, 11.775328945755463)
70 = -0.906532349496 : (0.9694862396987071, -0.06286158753009596, 0.03968575865680757, 1.080063791625613, 36.974055145605426, 11.298628252212412)
71 = -0.907124975703 : (0.9699581069715251, -0.06244206391511555, 0.04045309147367884, 1.0808958491866825, 37.30201290358462, 11.724682588197433)
72 = -0.90673475836 : (0.9693446760957372, -0.06304938246823698, 0.039961029776319615, 1.080135895308525, 36.9575508941267, 11.286397960620064)
73 = -0.907034479371 : (0.9698477105533709, -0.0626171111824937, 0.04070805529480082, 1.0809638521494958, 37.297856209855176, 11.70250998426047)
74 = -0.906993560019 : (0.9693084052601102, -0.0631587195483201, 0.040186937673804886, 1.0801374899586127, 36.9873979080621, 11.233437139977015)
75 = -0.907166576531 : (0.969797806064394, -0.06273152285413754, 0.0409414476613571, 1.0809665227460565, 37.32175993117245, 11.65484434128325)
76 = -0.907218378833 : (0.9692123004836374, -0.06334831918283691, 0.04046003243224767, 1.0801763712796588, 36.97827245822098, 11.216589417393568)
77 = -0.907256562265 : (0.969731124742496, -0.06290036501580383, 0.0411942627406949, 1.0809925530569682, 37.32748582677522, 11.626706412752098)
78 = -0.907006196624 : (0.9691658069586014, -0.06345797195193845, 0.040717163061002336, 1.0801650926905468, 37.000514140723105, 11.16701311273451)
79 = -0.907291567883 : (0.9696981842301143, -0.06298744513602063, 0.041448453509996735, 1.0809731753450742, 37.34731053085573, 11.57488973668052)
80 = -0.907143641041 : (0.9690802734924863, -0.06363566170412249, 0.04100337315675868, 1.0801755305501408, 37.00013823813055, 11.14669150785657)
81 = -0.906981527035 : (0.9696358692392911, -0.06314249101191355, 0.04171169511053187, 1.0809643879001618, 37.36590417358568, 11.541281471296333)
82 = -0.907347824796 : (0.9690350023960804, -0.06372834569351443, 0.04125189677548723, 1.080111659133998, 37.04335289568045, 11.092840939355995)
83 = -0.907284983609 : (0.9695628726154307, -0.06325846716815432, 0.0419844686333704, 1.080921559040654, 37.38732147555289, 11.503033063257117)
-------
AffineTransform (0x7fe2f35b65f0)
RTTI typeinfo: itk::AffineTransform<double, 2u>
Reference Count: 4
Modified Time: 298252
Debug: Off
Object Name:
Observers:
none
Matrix:
0.969563 -0.0632585
0.0419845 1.08092
Offset: [37.3873, 11.503]
Center: [0, 0]
Translation: [37.3873, 11.503]
Inverse:
1.02879 0.0602073
-0.0399594 0.922798
Singular: 0
Optimizer stop condition: GradientDescentOptimizerv4Template: Convergence checker passed at iteration 84.
Iteration: 84
Metric value: -0.907307621166
In [7]:
cshow(fixed,moving,ctx)
<bound method ResampleImageFilter.GetTransform of <SimpleITK.SimpleITK.ResampleImageFilter; proxy of <Swig Object of type 'itk::simple::ResampleImageFilter::Self *' at 0x119afe300> >>
In [8]:
# Stage 2 -> displacement field transform
# Setup the displacementField
displacementField = sitk.Image( fixed.GetSize(),sitk.sitkVectorFloat64 )
displacementField.CopyInformation( fixed )
# Set the displacementFieldTransform
tx2=sitk.DisplacementFieldTransform( displacementField )
tx2.SetSmoothingGaussianOnUpdate( varianceForUpdateField = 0.0,
varianceForTotalField=1.5 )
Out[8]:
<SimpleITK.SimpleITK.DisplacementFieldTransform; proxy of <Swig Object of type 'itk::simple::DisplacementFieldTransform *' at 0x10b719e70> >
In [9]:
ctx.AddTransform(tx2)
ctx.SetFixedParameters(ctx.GetFixedParameters())
R.SetInitialTransform(ctx)
R.SetMetricAsANTSNeighborhoodCorrelation(4)
R.SetOptimizerScalesFromPhysicalShift()
R.SetOptimizerAsConjugateGradientLineSearch(learningRate=1.0,
numberOfIterations=100,
convergenceMinimumValue=1e-6,
convergenceWindowSize=10,
lineSearchLowerLimit=0,
lineSearchUpperLimit=2,
lineSearchEpsilon=0.2,
lineSearchMaximumIterations=20,
estimateLearningRate=R.EachIteration,
maximumStepSizeInPhysicalUnits=1.0)
R.SetShrinkFactorsPerLevel([1])
R.SetSmoothingSigmasPerLevel([0])
R.RemoveAllCommands()
R.AddCommand( sitk.sitkIterationEvent, lambda: command_iteration_bsplineAndDisplacment(R) )
DisplacementOut = R.Execute(fixed,moving)
print("-------")
print(DisplacementOut)
print("Optimizer stop condition: {0}".format(R.GetOptimizerStopConditionDescription()))
print(" Iteration: {0}".format(R.GetOptimizerIteration()))
print(" Metric value: {0}".format(R.GetMetricValue()))
0 = -0.722932480372
1 = -0.750625797387
2 = -0.780618639345
3 = -0.809644663855
4 = -0.829755110983
5 = -0.842628993667
6 = -0.849534138947
7 = -0.855608141503
8 = -0.86398171261
9 = -0.870073216206
10 = -0.873859566343
11 = -0.876621087123
12 = -0.877733758478
13 = -0.868537824166
14 = -0.866808043717
15 = -0.870611021579
16 = -0.873408402439
17 = -0.879485338904
18 = -0.882723244943
19 = -0.886623947753
20 = -0.889234294738
21 = -0.891182732006
22 = -0.891580318311
23 = -0.893134798949
24 = -0.881750645152
25 = -0.880317894173
26 = -0.885691203459
-------
CompositeTransform (0x7fe2f3d425e0)
RTTI typeinfo: itk::CompositeTransform<double, 2u>
Reference Count: 4
Modified Time: 298991
Debug: Off
Object Name:
Observers:
none
Transforms in queue, from begin to end:
>>>>>>>>>
AffineTransform (0x7fe2f3d42460)
RTTI typeinfo: itk::AffineTransform<double, 2u>
Reference Count: 1
Modified Time: 298985
Debug: Off
Object Name:
Observers:
none
Matrix:
0.969563 -0.0632585
0.0419845 1.08092
Offset: [37.3873, 11.503]
Center: [0, 0]
Translation: [37.3873, 11.503]
Inverse:
1.02879 0.0602073
-0.0399594 0.922798
Singular: 0
>>>>>>>>>
GaussianSmoothingOnUpdateDisplacementFieldTransform (0x7fe2f3caffe0)
RTTI typeinfo: itk::GaussianSmoothingOnUpdateDisplacementFieldTransform<double, 2u>
Reference Count: 3
Modified Time: 454794
Debug: Off
Object Name:
Observers:
none
Gaussian smoothing parameters:
m_GaussianSmoothingVarianceForTheUpdateField: 0
m_GaussianSmoothingVarianceForTheTotalField: 1.5
End of MultiTransform.
<<<<<<<<<<
TransformsToOptimizeFlags, begin() to end():
0 1
TransformsToOptimize in queue, from begin to end:
>>>>>>>>>
GaussianSmoothingOnUpdateDisplacementFieldTransform (0x7fe2f3caffe0)
RTTI typeinfo: itk::GaussianSmoothingOnUpdateDisplacementFieldTransform<double, 2u>
Reference Count: 3
Modified Time: 454794
Debug: Off
Object Name:
Observers:
none
Gaussian smoothing parameters:
m_GaussianSmoothingVarianceForTheUpdateField: 0
m_GaussianSmoothingVarianceForTheTotalField: 1.5
End of TransformsToOptimizeQueue.
<<<<<<<<<<
End of CompositeTransform.
<<<<<<<<<<
Optimizer stop condition: ConjugateGradientLineSearchOptimizerv4Template: Convergence checker passed at iteration 27.
Iteration: 27
Metric value: -0.893134798949
In [10]:
cshow(fixed,moving,ctx)
<bound method ResampleImageFilter.GetTransform of <SimpleITK.SimpleITK.ResampleImageFilter; proxy of <Swig Object of type 'itk::simple::ResampleImageFilter::Self *' at 0x119ad5420> >>
In [11]:
rescaled_fixed, deformed_rescaled_moving = prepare_resampled_values( fixed, moving, ctx)
ck = sitk.CheckerBoardImageFilter()
ckOutput = ck.Execute(fixed, moving,[10,10])
myshow(ckOutput, title="checkerboard result before registration",dpi=60)
ckOutput2 = ck.Execute(rescaled_fixed, deformed_rescaled_moving,[10,10])
myshow(ckOutput2, title="checkerboard result after registration",dpi=60)
<bound method ResampleImageFilter.GetTransform of <SimpleITK.SimpleITK.ResampleImageFilter; proxy of <Swig Object of type 'itk::simple::ResampleImageFilter::Self *' at 0x119afe060> >>
Content source: aghayoor/SimpleITK-Notebook-Answers
Similar notebooks: