Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
[2.1] 3D Imaging, Analysis and Applications-Springer-Verlag London (2012).pdf
Скачиваний:
12
Добавлен:
11.12.2021
Размер:
12.61 Mб
Скачать

488

P.G. Batchelor et al.

contexts, as it provides an all-in-one solution (but it is not free software, although student licenses are fairly affordable at time of writing). Free software packages such as Octave, vtk, the GNU Scientific Library GSL, BLAS-LAPACK and FFTW can, in theory, be used for the same purposes, but with more effort. For some surface manipulation, the CGAL library is emerging as a standard and there is the excellent package: Meshlab. Currently, GPU computing is playing an important role in some medical imaging applications, see, for example, OpenCL and CUDA.

11.11 Questions

1.For the grid in Fig. 11.6, sketch the result of marching squares for a threshold of 11.5. Comment on any issues that arise and suggest possible solutions.

2.In volume rendering, a ray sent out from a pixel on the viewing plane encounters the following scalar values with increasing distance from the viewpoint: 22, 80, 45, 40, 120, 100. The color and opacity transfer function is:

α

Cred

Cgreen

Cblue

Scalar value

0.0

0.7

0.3

1.0

10

< x < 30

1.0

0.5

0.6

1.0

30

< x < 70

0.5

0.5

0.2

0.5

70

< x < 90

0.5

1.0

1.0

0.0

90

< x < 150

 

 

 

 

 

 

Calculate the pixel color using back-to-front rendering as well as front-to-back rendering (the results should be the same).

3.How would the MRI intensity inhomogeneity effect (see Fig. 11.4) be likely to affect the result of a region growing algorithm? What measures could be taken to reduce such effects?

4.For diffusion tensor imaging, build the equations in [Dxx , Dxy , . . .] that need to be solved from the model equation.

5.Four markers are placed on a patient’s head as fiducials for registration. In the preoperative CT scan these are found to be at the following locations:

x

y

z

 

 

 

23.5 40.4 13.3 50.2 35.5 8.5 43.7 28.4 35.0 18.4 38.7 18.2

(i)Calculate the position of the point in the CT scan that is most accurately located with these fiducials.

(ii)Define the terms fiducial registration error (FRE), fiducial localization error (FLE) and target registration error (TRE).

11 3D Medical Imaging

489

(iii)The fiducial points are translated to the centroid and rotated to lie along their principal axes. Their new positions are:

 

x

y

z

 

 

 

 

3.5

30.6 2.6

70.8 13.5

0.4

45.4

21.7

2.8

 

28.9

4.6

5.0

A target is located at (13.1, 1.0, 61.4) in this coordinate system. If the fiducials can be located to an accuracy of 3 mm, what is the TRE at this point?

(iv)The resulting transformation is used as an input to a surface matching algorithm. In what situations can surface registration give a poor result? How might this affect the choice of regions on the head where the fiducials are placed? What methods can be used to overcome these issues?

11.12Exercises

1.The aim of this exercise is to explore the effects of some of the image reconstruction algorithms on images. By using the libraries described in the Software section, you can try to do it in C++, but we will describe it as Matlab tasks for simplicity. Firstly, write code to generate simple test images of cubes, spheres and so on. Compute their ‘MRI data’ (Fourier transform) and ‘CT or PET data’ (Radon transform). Explore the undersampling effects by (a) removing odd lines of data; (b) removing outer parts of data; (c) removing inner parts of data; and (d) removing random parts of data. To make it more sophisticated, instead of simply removing, you can apply spatial transforms to corresponding undersampled data, and then merge back. The following code gives a template:

N = 2 5 6 ; M = N ; P = M;

 

 

 

 

 

R =

1 ; r = R / 2 ;

 

 

 

 

 

 

[ X , Y , Z ] = meshgrid ( l i n s p a c e (R, R ) , N,M, P ) ;

cube

= ( X <

r \&

Y <

r

\&

Z <

r ) ;

 

m r i

= f f t n ( cube ) ;

 

 

 

 

 

 

c t =

radon ( cube ) ;

 

 

 

 

 

 

% 1 ) subsample :

 

 

 

 

 

 

% a )

remove

odd l i n e s

o f

d a t a

and r e c o n s t r u c t

% b )

remove

o u t e r

p a r t s

o f

d a t a and

r e c o n s t r u c t

% c )

remove

i n n e r

p a r t s

o f

d a t a and

r e c o n s t r u c t

% d )

remove

random

p a r t s

o f

d a t a and

r e c o n s t r u c t

490 P.G. Batchelor et al.

% 2 ) m o t i o n :

 

 

 

 

 

 

 

 

 

 

 

 

 

% a )

move odd l i n e s

o f

d a t a and

r e c o n s t r u c t

 

% b )

move o u t e r

p a r t s

o f

d a t a and

r e c o n s t r u c t

% c )

move i n n e r

p a r t s

o f

d a t a and

r e c o n s t r u c t

% d )

move random p a r t s

o f

d a t a

and

r e c o n s t r u c t

% 3 ) n o i s e :

 

 

 

 

 

 

 

 

 

 

 

 

 

% Add

n o i s e t o

t h e d a t e b e f o r e

r e c o n s t r u c t i o n i n

%

a l l

examples

above

 

 

 

 

 

 

 

 

 

 

% 4 ) s u r f a c e e x t r a c t i o n :

 

 

 

 

 

 

 

 

 

% H i n t : i s o s u r f a c e

 

 

 

 

 

 

 

 

 

 

 

 

%

5 )

c u r v a t u r e c o m p u t a t i o n :

compute

c u r v a t u r e s

%

o f

t h e o b j e c t . As

i t

i s

a

cube ,

you

s h o u l d

g e t

% v e r y h i g h c u r v a t u r e s

a t

c o r n e r s and

edges ,

and

%

z e r o o t h e r w i s e .

I s t h a t

t h e

case?

 

 

 

 

%

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

% H i n t : you have t o ensure

t h a t

t h e

s u r f a c e

i s

% o r i e n t e d , i . e . t h a t a l l t h e normals p o i n t

 

% outwards o r i n w a r d s .

For c u r v a t u r e s

( mean

 

% c u r v a t u r e ) you need

t h e

d i h e d r a l

a n g l e

a t

an ,

% edge and f o r Gauss c u r v a t u r e ,

you

need

t h e

 

%

a n g l e d e f e c t

2 p i

sum ( a n g l e s )

 

a t

v e r t i c e s .

% See

c h a p t e r 2

i n

 

t h i s book f o r

 

more

d e t a i l s

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.Write code in Matlab to implement the recursive region growing algorithm

introduced in Algorithm 11.1. The recursive function should take six arguments: the image being segmented, the current region map (1 = unknown, 0 = background, 1 = foreground), the x and y coordinates of the current pixel, the intensity of the original seed pixel and the intensity distance used to determine if a pixel is similar to the original seed pixel. The following sample code sets up a simple test image, calls the recursive function and displays the result.

% i n p u t

image

im = [ 0 3 0 0 0 ; . . .

1

5

4

2

1 ; . . .

2

4

5

5

0 ; . . .

1

5

6

0

1 ; . . .

0

0

4

1

0 ] ;

%

i n i t i a l i z e o u t p u t t o unknown

r

= 1

ones ( s i z e ( im ) ) ;

11 3D Medical Imaging

491

% c a l l r e g i o n g r o w i n g f u n c t i o n

% a r g s :

image , r e g i o n , seed

x , seed y ,

% seed

i n t e n s i t y ,

i n t e n s i t y

d i s t a n c e

r = regionGrow ( im , r , 3 , 3 , im ( 3 , 3 ) , 1 . 0 ) ;

% any u n v i s i t e d

p i x e l s a r e

s e t t o background

r ( f i n d ( r

== 1))

=

0 ;

 

% d i s p l a y

o r i g i n a l

image and r e g i o n

f i g u r e ;

imagesc ( im ) ; colormap ( g r a y ) ;

f i g u r e ;

imagesc ( r ) ; colormap ( g r a y ) ;

If you have implemented the region growing algorithm correctly, the result of the segmentation should be as follows:

r

=

 

 

 

0

0

0

0

0

0

1

1

0

0

0

1

1

1

0

0

1

1

0

0

0

0

1

0

0

 

 

 

 

 

3.Implement the marching squares algorithm to create a connected series of vertices for a given threshold. You will need to interpolate the position of the vertices and consider the case table of 16 possibilities to decide how to connect these. Run this on the same image as for Exercise 2 with a threshold of 2.5.

4.Implement a simple volume renderer that accumulates voxels from back-to-

front along the z-axis of a 3D image and produces a rendering in the xy plane. Render the images of the sphere (perfect and with noise or missing data) from Exercise 1 with a transfer function that gives a color of white and an opacity somewhere between 0 and 1. To introduce volumetric lighting, calculate the voxel gradient by finite difference and scale the voxel color by the dot product of the normalized gradient with (0, 0, 1). Comment on the differences between these renderings and the previous isosurfaces.

5.Download the segmentation package ITK-SNAP9 and work through the tutorial using their example MRI image. How do the region competition and edge-based snakes differ from simple region growing? In what situations would region growing be better or worse than the ITK-SNAP methods?

9www.itksnap.org/download.