introduction to digital image processing
TRANSCRIPT
Ge#ngyourfeetwetwithMedicalImageProcessing
Anoverviewof
Outline• Digitalimageprocessing
– Basicsofedgedetec?onalgorithms
• Medicalimagereconstruc?on– Filteredbackprojec?onforCT
– SENSEMRIreconstruc?on
EDGE DETECTION IN MATLAB
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
INTRODUCTION � The abrupt changes or discontinuities in the intensity values in an image represent the
edges present in it.
� Edge Detection is an approach used in Image Segmentation for detecting these edges.
� These discontinuities are detected using first and second order derivatives
� The first order derivative of choice is called the gradient.
� The gradient of a 2D function f(x, y) (image) is defined by:
∇f = [Gx, Gy] = [∂f/∂x, ∂f/∂y]
where, Gx and Gy are gradients in the x and y direction respectively.
� The gradient vector points in the direction of maximum rate of change, which are the edges.
� Second order derivatives are usually computed using the Laplacian method.
� The Laplacian of a 2D function f(x,y) is defined by:
∇2f(x, y) = ∂2f(x y)/∂x2 +∂2f(x, y)/∂y2
� Thus , edge detection can be carried out in one of the two ways:
→ Find places where the magnitude of the first derivative of the intensity is greater than a specified threshold.
→ Find places where the second derivative of the intensity has a zero crossing.
� The function ‘edge’ is used in MATLAB for edge detection.
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
GRADIENT EDGE DETECTORS
These edge detectors use their respective masks shown on the right to digitally approximate the first derivatives Gx
and Gy, using which the gradient is calculated;
g = [Gx2 + Gy2]1/2
The pixel is then said to be an edge pixel if g ≥ T, where T is the specified threshold.
� Sobel Edge Detector:
Syntax:
G = edge (f, ‘Sobel’, T, dir); where dir can be ‘Horizontal’, ’Vertical’ or ‘both’.
� Prewitt Edge Detector:
Syntax:
G = edge (f,’Prewitt’, T, dir);
It is simpler to implement than Sobel but more susceptible to noise.
� Roberts Edge Detector:
Syntax:
G = edge (f,’Roberts’), T, dir);
Simplest and oldest edge detector. It is used to detect edges at 45° angles.
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
z1 z2 z3
z4 z5 z6
z7 z8 z9
-1 0 1
-1 0 1
-1 0 1
-1 -1 -1
0 0 0
1 1 1
-1 0
0 1
0 -1
1 0
Image Neighbourhood
Sobel
Roberts
Prewitt
SECOND ORDER DERIVATIVE EDGE DETECTORS � Laplacian of Gaussian:
§ The image is first smoothened using Gaussian filter. Hence, removing high frequency noises.
§ It then yields a Laplacian which yields a double edge image.
§ Finding the zero crossing between the two edges gives us the edge.
Syntax:
G = edge(f, ‘log’, T, sigma); where sigma is the standard deviation of the Gaussian filter, which determines the degree of image smoothening.
� Canny Edge Detector:
§ Most powerful edge detector provided by function ‘edge’.
§ Image is smoothened using a Gaussian filter, after which its Gradient is calculated using either of the three detectors.
§ It uses two thresholds, one for weak edges and other for strong edges
Syntax:
G = edge(f, ‘canny’, T, sigma); where T = [T1 T2]
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
OUTPUT IMAGES
Original Image ‘rice.png’
Prewitt Sobel
Laplacian of Gaussian
Roberts
Canny
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
BIBLIOGRAPHY
� Digital Image Processing using MATLAB, Rafael Gonzalez, Richard E. Woods and Steven L. Eddins.
Slide created by Ratnamanjuri Devi, Research Assistant, MIRC
FilteredBackProjectionAMATLABimplementation
SlidecreatedbyRatnamanjuriDevi,ResearchAssistant,MIRC
JosephHornack,TextonMRI
BasicOutlineoftheProgram
Algorithm:
• Readtheimage.Here,theShepp-Loganphantomofsize256x256.
• GeneratetheSinogramoftheimageassuminganincidentparallelbeamrotatedthrough180°oftheimage.
• Reconstructimagefromthesinogramusingfilteredbackprojection.
• DisplayOriginalandReconstructedImages.
SlidecreatedbyRatnamanjuriDevi,ResearchAssistant,MIRC
START
GenerateSinogram
ReconstructImagefromSinogram
END
ReadImage:
I=phantom(256)
DisplayOriginalandReconstructedImages
SinogramGeneration
Algorithm:
• Theimageisread.
• Foreverydegreerotationoftheimagestartingfrom0°to179°(atotalof180°),thesumofpixelsfallingalongeachofthe256linesiscalculated.
• Thesumofeachoftheserotationsresultinanarrayofsize1x256andoccupiesthepositionofbeingtheithcolumnofthematrix‘sinogram’,i-1beingtheiterativerotation.
• Thesinogramgeneratedisthusamatrixofsize256x180.
SlidecreatedbyRatnamanjuriDevi,ResearchAssistant,MIRC
START
ReadImage
Inputthetak=0°to179°
Rotateimageatthetakdegree
sinogram(:,i+1)=sumofrotatedimage
Displaysinogra
m
A
i=i+1
i<180
i=1
yes
no
Flowchart
ImageReconstructionusing
FilteredBackProjection
Algorithm:
• Createarampfilterofsize256x1infrequencydomain
• FFTofeachcolumnofthesinogramismultipliedwiththisfilterandfilteredsinogramisstoredinsinogram_filtafterIFFT.
• Eachcolumnofthisfilteredsinogramisreplicatedtoforma256x256matrixeach.
• Thesesinogramsarerotatedbackthrough0,-1…-179°andaddedtogether.
• Theresultingmatrixisnormalizedtogivethereconstructedimage.
• Theimagesaredisplayed.
SlidecreatedbyRatnamanjuriDevi,ResearchAssistant,MIRC
A
CreatearampfilterM_filt
j=1
j<180
Temp1=FFTofsinogram(:,j)*M
_filt
Sinogram_filt(:,j)=
IFFT(temp1)
j=j+1
K<180
Userepmattoreplicate
sinogram_filt(:,k)toa256x256
matrix
Rotatematrixbykdegrees.
phat=phat+rotatedmatrixk=k+1
k=1,Initializeanemptymatrixphat(256,256)
Phat/max(phat(:)) Display
images END
Flowchart
OutputImages
SlidecreatedbyRatnamanjuriDevi,ResearchAssistant,MIRC
50 100 150 200 250
50
100
150
200
250
20 40 60 80 100 120 140 160 180
50
100
150
200
25020 40 60 80 100 120 140 160 180
50
100
150
200
250
50 100 150 200 250
50
100
150
200
250
Sinogram FilteredSinogram
OriginalPhantom ReconstructedPhantom
SENSERECONSTRUCTION
SlidesPreparedBy:ShamshiaTabassum,RA,MIRC
15
INTRODUCTION• SENSi-vityEncoding(SENSE)-parallelimagingtechnique,whereanarrayof
mul?ple,simultaneouslyoperatedreceivercoilsisusedforsignalacquisi?on
• SENSEisbasedonuseofmul?pleRFcoilsandreceivers.Thecoilelementsareusedtomeasuretheanatomicalregionofinterestsimultaneously
• Thisallowsreduc?onofthetotalscan?mebyafactoruptothenumberofcoilelements
• Reconstruc?onintheimagedomain
Reconstruc-onstrategies• strongreconstruc-on-aimsatop?mizingvoxelshape
• weakreconstruc-on-thevoxelshapecriterionisweakerinfavoroftheSNR
16
METHODSenseReconstruc-on1. Thecrea?onofanaliased,reducedFOVimageforeachcoilarray
element2. AfullFOVimageiscreatedbyreversingthealiasingeffect(i.e.
unfolding)
S1AA+S1BB S2AA+S2BB
S3AA+S3BB S4AA+S4BB
[y1]=[S1AS1B][y2]=[S2AS2B][A][y3]=[S3AS3B][B][y4]=[S4AS4B]SolvingMatrix-----------à
17
SENSEImaging-AnExample
18
RESULTS
Figure3:Parallelacquisi?oninMRIusing8coilarray(a):cartoondepic?on(b):frommatlabcode(clockwise) %%PSUEDOCODE
load('brain_8ch.mat');[m,n,t]=size(im);fori=1:timagesc(abs(im(:,:,i)));end %%MULTICOILRECONSTRUCTION
mul?coil_recon=abs(sum(im,3));mul?coil_sq_recon=sqrt(abs(sum(abs(im.^2),3)));
19
Figure5:Generatedundersampledimages(clockwise)
20 40 60 80 100 120 140 160 180 200 220
20
40
60
80
100
120
140
160
%%SENSERECONSTRUCTIONimf=sense_sg(ima,map,Rx,Ry);figure;imagesc(abs(imf));
%%GENERATEUNDERSAMPLEDIMAGESRx=1;Ry=2;ima=undersample(im,Rx,Ry);
20
REFERENCE[1]PruessmannKP,WeigerM,ScheideggerMB,BoesigerP,
“SENSE:Sensi?vityencodingforfastMRI”,Magne?cResonanceinMedicine1999;42(5):952-962
[2]DavidJLarkman,RitaGNunes,“Parallelmagne?c
resonanceimaging”,Phys.Med.Biol.52(2007)R15–R55
[3]“RoleofParallelImaginginMagne?cResonance
Imaging”,DouglasC.Noll&BradleyP.Suqon,DepartmentofBiomedicalEngineering,UniversityofMichiganFieldFunc?onalMRI
21
Acknowledgements/Contactinfo
• MIRCmembers,MedicalElectronicsmembers• Management,DSI• AcademicandIndustrialpartners
• MIRC_HOME_OFFLINE(hqp://www.dayanandasagar.edu/mirc-home.html)• MIRC_SHARING_OFFLINE• MIRC_PEOPLE_OFFLINE• [email protected]
22
X2D IFFT
10
20
30
40
50
60
70
10
20
30
40
50
60
70
UniformSampling
X2D IFFT
20
40
60
80
100
120
20
40
60
80
100
120
IncoherentSampling