1
2
|
fixed = dicomread('knee1.dcm'); % 读参考图像fixed
moving = dicomread('knee2.dcm'); % 读浮动图像moving
|
1
2
|
figure, imshowpair(moving, fixed, 'method');
title('Unregistered');
|
1
|
[optmizer, metric] = imregconfig(modality);
|
1
2
3
|
movingRegisteredDefault = imregister(moving, fixed, 'affine', optimizer, metric);
figure, imshowpair(movingRegisteredDefault, fixed);
title('A: Default registration');
|
1
2
|
disp('optimizer');
disp('metric');
|
1
2
3
4
|
optimizer.InitialRadius = optimizer.InitialRadius/3.5;
movingRegisteredAdjustedInitialRadius = imregister(moving, fixed, 'affine', optimizer, metric);
figure, imshowpair(movingRegisteredAdjustedInitialRadius, fixed);
title('Adjusted InitialRadius');
|
1
2
3
4
|
optimizer.MaximumIterations = 300;
movingRegisteredAdjustedInitialRadius300 = imregister(moving, fixed, 'affine', optimizer, metric);
figure, imshowpair(movingRegisteredAdjustedInitialRadius300, fixed);
title('B: Adjusted InitialRadius, MaximumIterations = 300, Adjusted InitialRadius.');
|
1
|
tformSimilarity = imregtform(moving,fixed,'similarity',optimizer,metric);
|
1
|
tformSimilarity = imregtform(moving,fixed,'similarity',optimizer,metric);
|
1
|
Rfixed = imref2d(size(fixed));
|
1
2
3
|
movingRegisteredRigid = imwarp(moving,tformSimilarity,'OutputView',Rfixed);
figure, imshowpair(movingRegisteredRigid, fixed);
title('C: Registration based on similarity transformation model.');
|
1
2
3
4
|
movingRegisteredAffineWithIC = imregister(moving,fixed,'affine',optimizer,metric,...
'InitialTransformation',tformSimilarity);
figure, imshowpair(movingRegisteredAffineWithIC,fixed);
title('D: Registration from affine model based on similarity initial condition.');
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
figure
imshowpair(movingRegisteredDefault, fixed)
title('A - Default settings.');
figure
imshowpair(movingRegisteredAdjustedInitialRadius, fixed)
title('B - Adjusted InitialRadius, 100 Iterations.');
figure
imshowpair(movingRegisteredAdjustedInitialRadius300, fixed)
title('C - Adjusted InitialRadius, 300 Iterations.');
figure
imshowpair(movingRegisteredAffineWithIC, fixed)
title('D - Registration from affine model based on similarity initial condition.');
|