EGH315 Lab Week 5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

EGH315 Medical Imaging

LABORATORY PRACTICAL Week 5:


What you will learn:

A. Simple 2-D Translation Transformation


B. Image Registration:
1. Registration Estimator app
2. Automatic image registration

A. Simple 2-D Translation:


 

Conversion Syntax Type following codes (after >>) & observe


the outputs
Translate 2-D J = imtranslate(I, I = imread('pout.tif');
Image: [Tx,
imtranslate()  Ty],'FillValues',255) J = imtranslate(I,[25, -
shift an image 10],'FillValues',255)
Where Tx, Ty :
by adding a
a 2-element numeric vector. figure, imshow(I);
specified value
title('Original Image');
to the x- and y- 'FillValues', 255: Fills values
used for output pixels outside
set(gca,'Visible','on');
coordinates
the input image with value
255 figure, imshow(J);
title('Translated Image');
set(gca,'Visible','on'); set(gca,'Visible','on');

Sets gca (axis) properties to  Repeat the codes by changing the [Ty, Tx] &
visible
observe what happens.
 Repeat the codes, changing the FillValues to
another pixel value and observe the output
image.

Translate 2-D OutputView parameter: to Repeat above codes except replace the


Image and View specify that you want the imtranslate() with the following:
Entire entire translated image to be
Translated visible J = imtranslate(I,[25, -
Image 10],'FillValues',255,'OutputView','full');

Page 1 Effective Date: 20 Apr 2020


EGH315 Medical Imaging

B. Image Registration:
Image registration is a preliminary but crucial step in image processing
applications in medical field. It is used to align multiple scenes into a single
integrated image.

It helps overcome issues such as image rotation, scale, and skew that are common
when overlaying images taken from different modalities or scan dates. Image
registration enables you to compare common features eg, a tumor is visible in an
MRI or PET, not seen in X-ray images.

Involves designating one image as the reference image, also called the fixed
image, and applying geometric transformations or local displacements to the other
image(moving) so that they align with the reference. Images can be misaligned for
a variety of reasons.

MATLAB has 3 image registration approaches


1. An interactive Registration Estimator app
2. intensity-based automatic image registration, and
3. control point registration.

Page 2 Effective Date: 20 Apr 2020


EGH315 Medical Imaging

1. Registration Estimator app:


Allows you to register 2-D images interactively. You can compare different
registration techniques, tune settings, and visualize the registered image. Enables
you to perform intensity-based, feature-based, and nonrigid image registration.

Step 1: Create 2 images(I is fixed & J is moving) in workspace


>>I = imread('cameraman.tif');
>>J = imrotate(I,-30); % creates J

Step 2: Load the registrationestimator app


>>registrationEstimator(J, I) %opens the app & brings in the J,I

- Fixed image in green & moving image in purple.


- Image overlay displays a set of red and green dots connected by yellow lines.
These points are the matched features used to align the images
- Technique menu : allows you to select which technique you want. See
Create new trials with different registration techniques
(See Registration Technique Table at the end to have a general understanding
of techniques provided by this app)
- Current registration Parameters can be tweaked.

Draft

Registration list:
creates 3 registration
trials: 
Phase
Correlation, Featur
e: MSER,
and Feature: SURF.

Step 3: Register the images

- Click SURF in the history list, then click Register Images button


 Displays a quality score (overall estimate of registration quality- closer to 1
is higher quality) and computation time
 Different registration techniques and settings can yield similar quality scores
but show error in different regions of the image.

What is the quality score for these registrations? _____________________________


____________________________________________________________________

Page 3 Effective Date: 20 Apr 2020


EGH315 Medical Imaging

Step 4: Refine Registration settings


Adjust registration settings to try to improve the quality of the alignment

- Adjust the settings of the MSER trial. Click the Feature:MSER trial, numbered 2


- Try increasing the number of detected features to see if either improves the
quality of the registration.

- When you change the setting, the app creates a new trial, numbered 2.1, in the
history list. Note the quality. The higher the quality the better the registration.

- Click Register Images.
What is the quality metric of this registration? Is it better than the previous MSER
trial.
__________________________________________________________________

- Repeat Step 4(Click the Feature: MSER trial, numbered 2, again), to increase


the Quality of matched features. A new trial, numbered 2.2, is created in the
history list. Proceed to register image.

What is the quality metric of this registration? Is it better than the previous MSER
trial.
_______________________________________________________________

-  If you want to see which pixels differ between the default MSER trial and this
trial, change the overlay style to Difference and toggle between the two trials.

Page 4 Effective Date: 20 Apr 2020


EGH315 Medical Imaging

Step 5: Exporting Registration Results

Export the registered image and the geometric transformation to the workspace
- Click Export and select Export Images. In the Export to Workspace dialog
box, assign a name to the registration output(eg.Reg1).
- The output is a structure that contains the final registered image and the
geometric transformation.
- Go look at the workspace in MATLAB Online. Click on the Reg1.

- In MATLAB Online, do an imshow() of the Reg1.RegisteredImage.


- Transformation matrix is used will be stored in the Transformation.(Double click
on Transformation & T to view the matrix.

Step 6: Close registrationestimator app

>> registrationEstimator close % closes the app

Registration techniques available in registrationestimator app are:

Techniques Description Types


Feature based automatically find FAST
registration correspondence between Minigen
image features such as Harris
sharp corners, blobs, BRISK
contours SURF
MSER
Intensity based Correlate image intensity in Monomodal
registration the spatial or frequency Multimodal
domain. Phase
Compare intensity patterns
in images via some
similarity patterns like sum
of square difference
Nonrigid registration nonglobal transformations to -
the moving image

2. Intensity-based automatic image registration:


This example shows how you can use imregister() to automatically align two
magnetic resonance (MRI) images to a common coordinate system using intensity-
based image registration. Unlike some other techniques, it does not find features or
use control points. Intensity-based registration is often well-suited for medical and
remotely sensed imagery.
Page 5 Effective Date: 20 Apr 2020
EGH315 Medical Imaging

Step 1: Load images


Load 2 MRI images slightly out of alignment,

fixed = dicomread('knee1.dcm'); %read a DICOM file


moving = dicomread('knee2.dcm');

display the images in montage fashion


imshowpair(moving,fixed,'montage') %show images in pairs
title('Unregistered')

OR display them stacked to show the amount of misregistration


imshowpair(moving,fixed)
title('Unregistered')

Observe the difference displays.

Step 2: setup initial registration

Use imregister() to register image. Use imregconfig() to setup a default matrix for
multimodal registration

[optimizer,metric] = imregconfig('multimodal');
movingRegisteredDefault = imregister(moving,fixed,'affine',optimizer,metric);
imshowpair(movingRegisteredDefault,fixed)
title('A: Default Registration')

What you have achieved:

A. Simple 2-D Translation Transformation


B. Image Registration:
A. Registration Estimator app
B. Automatic image registration

Page 6 Effective Date: 20 Apr 2020

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy