Analysis of the radiographic trabecular pattern of the ultradistal radius by Mark Dayel A thesis presented to the Centre for Biological and Medical Systems, Imperial College, London in partial fulfillment of the requirements for the degree Master of Science in Engineering and Physical Science in Medicine September 1996 Abstract This project was concerned with the extraction of information relating to the trabecular structure of bones from planar x-ray radiographs, with a view to gaining better information about osteopenia. Current clinical assessment of bone mineral density (BMD) ignores structural information. High resolution planar x-ray radiographs were taken of five human radii excised from cadavers with a range of age, sex and build. BMD values for the radii were obtained using a DEXA scanner and the bones were sliced to obtain trabecular structure scores. Image processing techniques were applied to regions of the digitised x-ray images showing the radiographic trabecular pattern of the distal radius. Techniques similar to those used by Geraets et al. in previous studies were found to produce parameters correlating highly with BMD and less highly with trabecular structure scores. Image signal to noise ratio (SNR) was found to be closely related to BMD. High dependence of the parameters on image SNR was thought to explain the correlations previously found with BMD. The parameters are thought to be dependent on trabecular structure only via the BMD. New measures were developed which appear to be less dependent on image SNR. Spectral analysis of the images yeilded information which correlated well with both BMD and structural scores. A new measure analysing the skeletonized image was found to correlate more highly with trabecular structure scores than with BMD. This may potentially provide a way of analysing the progression of diseases such as osteopenia using ordinary planar x-ray radiographs and obviate the need for specialised scanners. 1 Acknowledgements Throughout this project I have received a great deal of support and would like to give thanks to the following people: At Saint Mary’s hospital, Anne Somers for her time, help and advice in using the X-ray machine. Shirley Featherstone for her kind offer and valient attempt at using the CT scanner to image inside the bones. Rosemary Nicholson for her expertise, interest in the project, and for staying after work to help with the mammography machine. At the Biomechanics Lab, Andrew Amis for allowing me to use the lab for sectioning the bones and his advice on how to go about it. Ed Morris at the Biophysics Department for his help in using their digitizer. At the Bagrit Centre, Mary and Maria for their attempts at using the small bore MRI machine to image the bones. Anil, Norman and Ed for their help with LATEX. Rebecca, Peter and Anil for their advice on the quirks of Midas. Stefan for bolstering my patchy unix skills, and Andy for his knowledge and enthusiasm for the work. At PFSU, Kim Parker for his advice on Fourier transforms and help in using SPSS. Everyone on the MSc course, especially Bence, Harriet and the greeks for making this such an enjoyable year. And special thanks to Annette for always being there. Finally, and most of all, I would like to thank my supervisors. Olga Rutherford at Saint Mary’s for her patience, enthisiasm and guidance, and John Lever at PFSU for his time, effort and help throughout. Many thanks to you all, and I hope the results are worthy of all your patience. 2 Contents 1 2 3 Introduction 1.1 Bone . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Osteoporosis and Osteopenia . . . . . . 1.2 Assessment of Osteoporosis . . . . . . . . . . 1.2.1 Sensitometry . . . . . . . . . . . . . . 1.2.2 The Radiographic appearance of Bone . 1.2.3 Diagnosis of Osteoporosis . . . . . . . 1.3 Aims of this Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Method 2.1 Materials Used . . . . . . . . . . . . . . . . . . . . 2.1.1 Cadaveric Bones . . . . . . . . . . . . . . . 2.1.2 Calibration wedge . . . . . . . . . . . . . . 2.2 Acquiring the Data . . . . . . . . . . . . . . . . . . 2.2.1 Bone Mineral Density (BMD) measurements 2.2.2 Planar X-radiographs . . . . . . . . . . . . . 2.2.3 Digitisation . . . . . . . . . . . . . . . . . . 2.2.4 Bone sectioning . . . . . . . . . . . . . . . . 2.2.5 Slice scoring . . . . . . . . . . . . . . . . . Image Processing 3.1 Midas . . . . . . . . . . . . . . . . . . . . 3.2 Selection of the Region of interest . . . . . 3.2.1 Preprocessing the region of interest 3.3 Fourier transform analysis . . . . . . . . . 3.4 Binary image analysis . . . . . . . . . . . . 3.4.1 Skeletonizing . . . . . . . . . . . . 3.4.2 Binary Image Regions . . . . . . . 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 23 24 24 26 27 32 . . . . . . . . . 33 33 33 33 34 34 35 36 36 38 . . . . . . . 40 40 40 43 48 54 54 60 CONTENTS 4 4 . . . . . . . . . . . . . 62 62 62 64 64 66 66 66 66 66 66 71 71 71 . . . . . . . . . . . . . . . . . 75 75 75 75 76 76 76 76 77 78 78 78 86 88 88 89 89 90 6 Recommendations for the future 6.1 With the current material . . . . . . . . . . . . . . . . . . . . . . 6.2 For future bone scans . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Improvements in the methods . . . . . . . . . . . . . . . . . . . . 91 91 92 93 7 Conclusion 94 5 Results 4.1 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 BMD measurements of Bones . . . . . . . . . . . . . . 4.1.2 ‘BMD’ measurements of Calibration Wedge . . . . . . 4.1.3 Equivalent Bone thicknesses from ROIs . . . . . . . . . 4.1.4 ROI re-mapping . . . . . . . . . . . . . . . . . . . . . 4.1.5 Absolute Optical Density values for ROIs . . . . . . . . 4.1.6 Appearance of slices . . . . . . . . . . . . . . . . . . . 4.2 Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 BMD and Slice scores . . . . . . . . . . . . . . . . . . 4.2.2 Image processing scores based on Geraets et al. [16, 19] 4.2.3 Fourier Analysis scores . . . . . . . . . . . . . . . . . . 4.2.4 Other Image Processing scores . . . . . . . . . . . . . . 4.2.5 Failed scores . . . . . . . . . . . . . . . . . . . . . . . Discussion 5.1 DEXA . . . . . . . . . . . . . . . . . . . . 5.1.1 Bone scans . . . . . . . . . . . . . 5.1.2 Calibration wedge scan . . . . . . . 5.2 Planar X-rays . . . . . . . . . . . . . . . . 5.2.1 Calibration wedge scans . . . . . . 5.2.2 Bones scans . . . . . . . . . . . . . 5.2.3 Slice Appearance . . . . . . . . . . 5.2.4 Bone architecture . . . . . . . . . . 5.3 Image Processing . . . . . . . . . . . . . . 5.3.1 ROI selection . . . . . . . . . . . . 5.3.2 Previous Analysis techniques . . . 5.3.3 PDF Histogram width variation . . 5.4 New analysis techniques . . . . . . . . . . 5.4.1 Failed scores . . . . . . . . . . . . 5.4.2 SNR dependence . . . . . . . . . . 5.4.3 Fourier Transform Techniques . . . 5.4.4 Filtered Skeletonization Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS 5 A Full Digitized X-ray images 95 B Calibration wedges 101 C Preprocessed Regions of Interest 105 D Skeletonized images 107 E FFT Angle Plots 109 F Section Marking instructions 113 G Program Listings G.1 Segmentation by Connected Components G.2 Angle wedge plot . . . . . . . . . . . . . G.3 Fracal analysis of fork points . . . . . . . G.4 Fork point extraction . . . . . . . . . . . H Breakdown of Logfile Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 116 120 126 130 134 List of Figures 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 X-ray of right forearm . . . . . . . . . . . . . . . . . . . . . . . Appearance of Lamellae under polarised light [1] . . . . . . . . . Surgical biopsies showing trabecular structure [1] . . . . . . . . . Microscopic appearance of trabecular bone [1] . . . . . . . . . . . Bone Structure and Cells [1] . . . . . . . . . . . . . . . . . . . . Flat osteocytes in trabecular bone . . . . . . . . . . . . . . . . . . Bone remodelling . . . . . . . . . . . . . . . . . . . . . . . . . . Bone cell changes with age [1] . . . . . . . . . . . . . . . . . . . Colles’ Fracture . . . . . . . . . . . . . . . . . . . . . . . . . . . Iliac crest biopsies of older patient with osteoporosis. [1] . . . . . Illiac crest biopsy of non-osteoporotic patient . . . . . . . . . . . Appearance of Lamellae in older patients [1] (c.f. figure 1.2) . . . Osteoporotic Vertebral Fracture . . . . . . . . . . . . . . . . . . . Typical film characteristics [39] . . . . . . . . . . . . . . . . . . Femoral head . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examples of Singh index for osteopenia [36] . . . . . . . . . . . . Radiographic appearance of excised radius . . . . . . . . . . . . . Linear attenuation coefficient variation with x-ray energy . . . . . 13 15 16 17 17 18 19 20 20 21 21 21 23 26 27 28 29 30 2.1 2.2 2.3 2.4 2.5 Inverted x-ray image of calibration wedge . . . . . . . . Arrangement for scanning the bones on the Dexa scanner Setting the bone in wax . . . . . . . . . . . . . . . . . . Slicing the bone using a mitre saw . . . . . . . . . . . . Slice 4 of bone 150 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 34 37 38 39 3.1 3.2 3.3 3.4 Midas 3 . . . . . . . . . . . . . . . . . . . . Region of interest selection—Bone 150 . . . Bone 150 calibration wedge Greylevel values Stages in preprocessing bone 150 . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 42 44 45 6 . . . . . . . . . . . . . . . . . . . . . . . . LIST OF FIGURES 7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 PDF plots of bone 150 ROI . . . . . . . . . . . . . . . . . . . . . PDF plots of bone 162 ROI . . . . . . . . . . . . . . . . . . . . . Stages in preprocessing bone 162 . . . . . . . . . . . . . . . . . . Sinusoidal stripe phantom . . . . . . . . . . . . . . . . . . . . . . Greyscale values along orthogonal lines . . . . . . . . . . . . . . FFT analysis of Bone 150 ROI . . . . . . . . . . . . . . . . . . . Bone 150 FFT angle wedge plot . . . . . . . . . . . . . . . . . . Binarization of bone 150 at modal value . . . . . . . . . . . . . . Examples of the medial axes of simple shapes [20] . . . . . . . . The skeletonizing operation on the binarized image regions . . . . Skeletonized images of bone 150 ROI . . . . . . . . . . . . . . . Processing the Thinned Image (enlarged region) . . . . . . . . . . Segmentation of regions using modal threshold . . . . . . . . . . Segmentation of regions using modal threshold plus 15 . . . . . . 46 46 47 49 51 52 53 55 56 57 58 59 60 61 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Bone BMD values . . . . . . . . . . . . . . . Calibration Wedge ‘BMD’ values . . . . . . Bone 150 calibration wedge Greylevel values Slice 4 of bone 150 . . . . . . . . . . . . . . Slice 4 of bone 153 . . . . . . . . . . . . . . Slice 4 of bone 162 . . . . . . . . . . . . . . Slice 4 of bone 163 . . . . . . . . . . . . . . Enlarged regions of bone sections . . . . . . . . . . . . . . . . . . . . . . 63 64 65 67 68 68 69 69 5.1 5.2 5.3 5.4 5.5 5.6 5.7 Demonstration of the effects of noise on skeletonization . . . . . Unfiltered ROIs Binarized at mode . . . . . . . . . . . . . . . . Skeletonized images without filtering . . . . . . . . . . . . . . Effect of mean filtering on the skeletonization of Bone 162 ROI Example of skeletonization published by Geraets [19] . . . . . . Zoom of a 100 × 100 pixel area of ROIs . . . . . . . . . . . . . PDF plots of unprocessed ROIs . . . . . . . . . . . . . . . . . . . . . . . . . 80 81 82 83 84 85 87 A.1 A.2 A.3 A.4 A.5 Original (inverted) X-ray of Bone 150 Original (inverted) X-ray of Bone 153 Original (inverted) X-ray of Bone 155 Original (inverted) X-ray of Bone 162 Original (inverted) X-ray of Bone 163 . 96 . 97 . 98 . 99 . 100 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.1 Bone 150 calibration wedge Greylevel values . . . . . . . . . . . 102 B.2 Bone 153 calibration wedge Greylevel values . . . . . . . . . . . 103 B.3 Bone 155 calibration wedge Greylevel values . . . . . . . . . . . 103 LIST OF FIGURES 8 B.4 Bone 162 calibration wedge Greylevel values . . . . . . . . . . . 104 B.5 Bone 163 calibration wedge Greylevel values . . . . . . . . . . . 104 C.1 Pre-processed ROIs of rotated bones . . . . . . . . . . . . . . . . 106 D.1 Bone 163 filtered, skeletonized ROIs binarized at mode . . . . . . 108 E.1 E.2 E.3 E.4 E.5 Bone 150 FFT angle wedge plot Bone 153 FFT angle wedge plot Bone 155 FFT angle wedge plot Bone 162 FFT angle wedge plot Bone 163 FFT angle wedge plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 110 111 111 112 F.1 F.2 Section Marking instructions – Page 1 . . . . . . . . . . . . . . . 114 Section Marking instructions – Page 2 . . . . . . . . . . . . . . . 115 List of Tables 2.1 2.2 Cadavers used in the study . . . . . . . . . . . . . . . . . . . . . Exposures used for Bone X-rays . . . . . . . . . . . . . . . . . . 33 35 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 BMD measurements—detailed scan . . . . . . . . . . . . . . . . Equivalent thickness of bone calculated from ROI greyscale values Pixel ranges for re-mapping of ROIs . . . . . . . . . . . . . . . . Average absolute optical density values for ROIs . . . . . . . . . Correlations between bone scores . . . . . . . . . . . . . . . . . Skeletonised binarized ROI data correlations: Unfiltered . . . . . Skeletonised binarized ROI data correlations: Mean Filtered . . . Fourier Analysis ROI data correlations . . . . . . . . . . . . . . . Skeleton image line analysis correlations . . . . . . . . . . . . . . Correlations between bone scores and pixel remapping range . . . 62 65 67 67 70 72 72 73 73 74 9 Glossary Canaliculi Channels which run between lacunae for the exchange of nutrients and waste products Collagen fibres Long protein chains which form the tension bearing part of bone Compact bone Dense, solid bone as found in the cortex Cortex Outer layer of compact bone surrounding the trabecular bone and marrow cavity Diaphysis Tubular shaft of long bones containing the marrow cavity Endosteum Incomplete layer of osteoprogenitor cells covering the inner surfaces of the bone Epiphyseal line Line visible on x-rays in adults where epiphyseal plate used to be Epiphyseal plate Narrow cartilage gap between the epiphysis and diaphysis in growing bones in the young Epiphyses The expanded ends to long bones, filled with trabecular bone Haversian canals Passageways containing blood vessels running parallel to the bone surface in compact bone Howship’s lacunae Shallow depression caused by erosion of bone by osteoclasts Hydroxyapatite Ca10 (PO4 )6 (OH)2 crystals which form the compression bearing part of bone Lacunae Pockets within bone each containing one mature osteocyte Lamella Thin layer of bone matrix 10 GLOSSARY 11 Marrow Loose connective tissue found in the centre of the bone Osseous tissue Bone tissue Ossification Formation of bone from other tissues (usually cartilage) Osteoblast Bone forming cell Osteoclast Bone removing cell Osteocytes Bone cells Osteoid Bone matrix prior to calcification Osteolysis Dissolving of bone matrix Osteon Basic compact bone unit—concentric lamellae around a central (Haversian) canal Osteoprogenitor cells Stem cells which can divide to from osteoblasts Periosteum Outer surface covering of bone with outer fibrous and inner cellular layers Red marrow Bone marrow consisting mainly of blood producing (haematopoeitic) cells Spicule A small strut of bone Spongy bone See Trabeculae Trabeculae Struts and plates of bone matrix with many branches forming an open network of spongy bone Volkmann’s canals Passageways containing blood vessels running perpendicular to the bone surface in compact bone Yellow marrow Bone marrow consisting mainly of fat (adipose) cells Chapter 1 Introduction 1.1 Bone Bleached and dry bones are the images of death. Perhaps because of their morbid associations, many people think of bones as inert sticks whose only function is to support our bodies. In fact our bones are very much alive and are closely associated with many vital systems in the body. In this section we will explore the structure of living bone and how this is well fitted to its functions, and later how bone dynamically alters in response to stimuli. In particular we will concentrate on the way in which bone acts as a supporting structure and how its strength is affected by other factors. In this project we will be dealing with the radius, which is the larger of the two bones of the forearm (figure 1.1). This is one of the long bones, which have a dense outer cortex of solid bone and two expanded ends at which the cortex is filled with spongy or trabecular bone. It is this trabecular bone which is of particular interest to us in this study, but first we will concentrate on the functions and then the microscopic organisation of bone itself. Functions Bone has five main functions: • Support. The skeleton provides a framework on which soft tissues and organs can be anchored. • Storage. 99% of the body’s calcium deposits are within bone. Calcium can be mobilised or deposited as needed to maintain a normal blood concentration. Also within the bone are fat stores, which act as an energy reserve. 12 CHAPTER 1. INTRODUCTION 13 Figure 1.1: X-ray of right forearm • Producing Blood Cells. Blood components such as red and white blood cells are produced in the red marrow inside bones. • Protection. Delicate body organs are protected by the skeleton. The brain is protected by the skull, and the heart and lungs by the ribs. • Movement. Muscles can contract, but are unable to push. The skeleton provides leverage to change the strength and direction of forces to enable different movements to be produced. Bone Matrix Fundamentally, bone is a two-phase material. In a similar way to carbon fibre or fibre glass, bone has one component which is hard and brittle and extremely resistant to compressive loads, and another which is flexible and extremely strong in tension. It is the combination of these two components which give bone the strength required for its uses in the body. The compressive load-bearing component of bone is a calcium based crystal called hydroxyapatite (Ca10 (PO4 )6 (OH)2 ). This forms needle-like crystals within and around the long chain-like molecules of collagen, the tension bearing component of bone. This protein-crystal combination is the bone matrix. It is strong, slightly flexible and extremely resistant to shattering. Development of Bone While we were still in the womb, our skeletons were not rigid as they are now. Before the calcified bones form, a prototype bone is made from cartilage (the semihard but flexible tissue which gives shape to our nose and ears). This skeletal car- CHAPTER 1. INTRODUCTION (a) Lamellae around Haversian canals in cortex 14 (b) Lamellae within trabecula Figure 1.2: Appearance of Lamellae under polarised light [1] tilage is gradually turned into bone or ossified by the deposition of hydroxyapatite crystals. In the long bones like the radius, this ossification takes place from the middle of the diaphysis (shaft) and the middles of the epiphyses (ends) outwards. The cartilage gaps between these areas of ossification are called the growth plates or epiphyseal plates. The cartilage in the epiphyseal plates continues to grow at the same rate as ossification takes place, and so the bones grow longer as we get older, until puberty when the ossification rate increases dramatically, and the epiphyseal plate closes to leave an epiphyseal line still visible on x-rays. As bone forms, blood vessels are enclosed in the bone matrix. Inside the dense cortical bone, the blood vessels run parallel to its length, each in a channel called a Haversian canal, around 30-70µm in diameter. Bone matrix is deposited in layers around these blood vessels. Each layer is called a lamella and consists of bone matrix in which all the collagen fibres are layed down in the same direction. Adjacent Lamellae have their collagen fibres aligned at right angles, in an adaptation to increase the strength of bone by reducing its dependence on the load being applied in a particular direction. A consequence of this collagen arrangement is that if we illuminate a bone section with polarised light, the lamellae appear as light and dark stripes (figure 1.2(a)). Each group of concentric lamellae is called an osteon, and these are the basic building blocks of cortical bone. Trabecular bone is also made up of lamellae (figure 1.2(b)), but osteons are rare and only found if the trabecula is particularly thick. Within the trabeculae the lamellar layers are oriented parallel to the trabecular surfaces. CHAPTER 1. INTRODUCTION (a) Surgical biopsy of Femoral head of older patient 15 (b) Thin narrow cortex and variable trabecular thickness Figure 1.3: Surgical biopsies showing trabecular structure [1] Bone structure Long bones in the body such as the radius have a similar overall structure—a cortex of compact solid bone and an interior network of spongy trabecular bone at the epiphyses (figure 1.3). In the diaphysis, trabecular bone is absent, and the cortical bone forms a hollow tube. This is an adaptation to maximise strength for the minimum bone mass, by increasing the moment of inertia of the bone, as in bamboo poles or scaffolding poles on buildings. This adaptation is for the transmission of load along the bone, and to resist bending. It also provides a protected site for the blood producing stem cells of the red marrow.1 At the epiphyses of the long bones forces may come from many directions transmitted both from the articular cartilage and from tendon and ligament attachments. Cortical bone alone is not sufficient to transmit the load to the shaft and for this reason the epiphyses are filled with spongy or trabecular bone. The trabeculae are struts or plates of bone matrix which brace the cortical bone against loading in a similar way to the cross-struts on chairs and tables. The thickest trabeculae run along the lines of compression and tension in the bone (figure 1.3(a)). The spongy structure of trabecular bone (figure 1.4) supports the cortical bone without greatly increasing the weight. By solid bone volume, 80% is cortical bone and 20% is trabecular. Each trabecula is made up of angular segments called trabecular packets. These are the functional equivalent of the osteons within the cortical bone, but the trabecular packets are made up of parallel lamellar sheets. Typically a trabecular 1 The stem cells are undifferentiated cells which can develop into different kinds of blood cells on demand. As such, these cells are particularly venerable to genetic damage from radiation, so the centre of a tube of dense, high molecular weight material is a particularly well protected site. CHAPTER 1. INTRODUCTION (a) Narrow trabecular structure 16 (b) Anisotropic trabecular structure (c) Dense trabecular structure Figure 1.4: Microscopic appearance of trabecular bone [1] CHAPTER 1. INTRODUCTION (a) Bone Structure 17 (b) Bone Cells Figure 1.5: Bone Structure and Cells [1] packet would be crescent shaped, with a radius of curvature of about 600µm length of 1mm and thickness of 50µm. Most trabeculae are less than 0.2mm thick and contain no blood vessels, but thicker ones may and these have associated ossicles. Cells in Bone There are four main types of cell within bone that are responsible for the maintenance of the bone structure (figure 1.5(a)). Osteoprogenitor Cells Mesenchymal (embryonic) cells found in the inner endosteal layer, outer periosteal layer and along the blood vessels in the bone. These cells can differentiate to form osteoblasts as needed. Osteoblasts These are the cells that produce bone. Uncalcified bone matrix or osteoid is layed down, and later the hydroxyapatite crystals form within and around the collagen. Eventually, the osteoblasts enclose themselves in bone and become osteocytes. Osteocytes Osteoblasts that have become trapped within the bone matrix. Each osteocyte lives in a space between the lamellae called a lacuna, and has cytoplasmic extensions reaching out to communicate with other osteocytes in channels called canaliculi (figure 1.1). These channels supply nutrients and remove metabolites to allow the osteocyte to continually recycle the bone CHAPTER 1. INTRODUCTION 18 Figure 1.6: Flat osteocytes in trabecular bone. Canaliculi at right angles to lamellae [1] matrix, dissolving and laying down new hydroxyapatite crystals in response to hormonal signals. Osteoclasts Giant multi-nucleated cells derived from white blood cells. These cells secrete acids and enzymes which dissolve the bone matrix. The balance between the activity of osteoblasts laying down bone and osteoclasts resorbing bone is extremely important. Osteopenia is a condition in which this balance has moved towards higher osteoclast activity, causing thinner bones which are therefore weaker and more likely to fracture. This condition is explained in more detail in section 1.1.1 Bone Remodelling Bone remodelling occurs when the sites of bone resorbtion and bone deposition are different (figure 1.7(a)). Bone is removed from areas that are under little or no stress, and layed down in areas of greater stress.2 This process is thought to be controlled by cellular responses to piezoelectric effects in the crystalline bone components. Bone that is under greater stresses produces larger electrical fields and is reinforced until the stresses are sufficiently reduced. Bone under small stresses is thinned until the stresses are increased. There is an equilibrium stress range within which resorbtion and deposition are balanced. 2 This process is the bane of those who design artificial joint implants. The implants are usually made of metal much stronger than the bone. The implant then takes up most of the load, causing the bone around it to be resorbed. CHAPTER 1. INTRODUCTION (a) Coupled remodelling - Osteoblasts on upper surface of trabecula, Osteoclast on opposite side [1] 19 (b) Artery (middle) and adjacent trabecula (upper right). Wide osteoid seam adjacent to artery [1] Figure 1.7: Bone remodelling This method of remodelling has important implications for trabecular structure – if a trabecula breaks, then the stresses on it reduce to zero, and the bone will be resorbed. Once a trabecula is lost it is lost for good, although other trabeculae may become re-inforced by remodelling in an attempt to compensate. The speed at which bone remodelling takes place is very much dependent on the metabolism of the remodelling cells, which in turn is dependent on blood supply. Figure 1.7(b) shows an example of this in which an artery is running adjacent to a trabecula in the upper right part of the figure. The area in which the artery runs close to the bone has a very wide osteoid layer, indicating very fast bone deposition. The large surface area of the trabeculae make them the site of fastest bone remodelling, and for this reason, the trabeculae might be expected to show the first signs of osteopenia. The Effects of Aging on Bone As we age, our bones become thinner and weaker. The condition of inadequate ossification is called osteopenia, and if this continues to the extent that fractures are caused, is termed osteoporosis. This loss of bone occurs after the age of 20–30 years, when the number of osteoblasts drops rapidly (figure 1.8), while the number of osteoclasts remains relatively constant. After the age of 40 men lose around 3% of their bone mass per decade and women lose around 8%, but this is not lost at equal rates over the whole the skeleton. Sites such as the vertebrae and epiphyses of long bones lose bone mass particularly fast. Bone loss from the distal radial epiphysis (the region of interest for this study) leads to Colles’ fractures upon CHAPTER 1. INTRODUCTION 20 6 Osteoblasts 5 Number per mm 2 Osteoclasts 4 3 2 1 0 0-9 10-19 20-29 30-39 40-49 Age 50-59 60-69 70- Figure 1.8: Bone cell changes with age [1] falling, as the outstretched hand transmits large forces to the radius (figure 1.9). As well as losing bone mass, the microscopic structure of the bone changes. Trabeculae become thinner and fewer (figure 1.10) and the lamellae change from being well organised sheets of parallel fibres into disorganised lattice structures (figure 1.12) further reducing the strength [15]. The bone is lost mainly from the inside surfaces, i.e. the trabeculae and the inner cortex. Often the outer cortex will lay down bone in an attempt to compensate, increasing the bone diameter [28]. CHAPTER 1. INTRODUCTION 21 Figure 1.9: Colles’ Fracture (a) Thin trabeculae and porous cortex (b) Very thin trabeculae and porous cortex Figure 1.10: Iliac crest biopsies of older patient with osteoporosis. [1] CHAPTER 1. INTRODUCTION 22 Figure 1.11: Illiac crest biopsy of non-osteoporotic patient showing wide cortex and uniform, connected trabecular plates [1] (a) Lamellar structure disorganised with age (b) Lamellae at trabecular junction in older patient Figure 1.12: Appearance of Lamellae in older patients [1] (c.f. figure 1.2) CHAPTER 1. INTRODUCTION (a) Normal Vertebrae 23 (b) Fractured Vertebrae Figure 1.13: Osteoporotic Vertebral Fracture 1.1.1 Osteoporosis and Osteopenia Osteoporosis is a disease in which a decrease in the mass and density of bone leads to a reduction in bone strength and an increased incidence of fracture. Across the world it affects 200 million people and causes 1,600,000 hip fractures alone each year; one third of European women are likely to suffer an osteoporosis related fracture in their later life. There is a natural tendency for loss of bone calcium from the age of 35 onwards, which puts older people at risk of osteoporosis. In women, estrogen exerts a protective effect on bone mass, and after menopause, when estrogen levels fall, there is a significant loss in bone mass. Post-menopausal women and women with low estrogen levels (due to overdieting, extreme levels of exercise, or surgical removal of ovaries) are at very high risk of developing osteoporosis. Alcohol, smoking, steroid treatments, and some diseases (e.g. liver disease) are also known to increase the risk of osteoporosis. Osteoporosis is particularly dangerous because it can develop without warning. For many people the first sign of osteoporosis is a fracture, by which time around 30% of their bone mass may have been lost. Often fractures of the vertebra (figure 1.13) cause loss of height and a hunchback appearance. Once bone mass is lost in osteoporosis, it is very hard to regain It is therefore important to diagnose osteoporosis so that treatments can be given to reduce rate of bone loss. CHAPTER 1. INTRODUCTION 24 Prevention The best way of preventing osteoporosis is to build strong bones before the age of 35 that will remain strong even with reduced bone mass in later life. Adequate vitamin D and calcium intake is essential, and weight-bearing exercise (e.g. walking, jogging and racquet sports) can also help strengthen bones. Once osteoporosis has begun, there are no satisfactory treatments. Again, calcium and vitamin D supplements are of some use, as is weight bearing exercise, but this must be carefully controlled, to prevent fractures in the weakened bone. Estrogen replacement therapy (ERT) can delay the bone loss associated with menopause or with ovary removal, but increases the risk of other conditions such as breast cancer. Calcitonin slows bone removal, but is difficult to administer requiring an injection or an unpleasant nasal spray. Bisphosphonates also slow bone removal by killing bone cells, but this means that they also slow bone healing. 1.2 Assessment of Osteoporosis 1.2.1 Sensitometry This project relies on the interpretation of x-ray images on film, and it is important to understand how these images relate to the structure of the bones being x-rayed. X-ray film reacts to direct x-ray exposure, or more usually to the light produced by intensifying screens as they absorb x-rays. This interaction causes silver halide crystals within the film to change from ionic silver to uncharged silver atoms on developing, which obstruct light transmission through the film. The film therefore becomes dark in areas of x-ray exposure i.e. a negative is produced. The lightness of the negative can be expressed in terms of an opacity of the film negative: Incident light intensity Opacity = Transmitted light intensity This is then converted into optical density by taking the log to base 10: Optical Density = log10 e.g. ! Incident light intensity Transmitted light intensity " for an opacity of 0 (clear) the optical density is 0 for an opacity of 10 the optical density is 1 for an opacity of 1000 the optical density is 3 The values produced when we digitise the x-ray negatives are linearly proportional to optical density. CHAPTER 1. INTRODUCTION 25 X-ray intensity For the x-rays going through the bone, Beer’s Law I = I0 e−µx shows the relationship between the intensity of x-rays emitted by the tube I0 , and the incident x-ray intensity on the film I, having passed through a distance x of material of attenuation µ. N.B. Beer’s law neglects the differential absorption of real materials i.e. x-rays of particular energies being absorbed more than others. As x-rays pass through a material the material will attenuate some energies more than others, and those x-rays that remain will therefore be of energies which were attenuated less. Passing through more of the same material this ‘harder beam’ will not experience as much attenuation. It follows from Beer’s law that if we have two pieces of the same material, A and B, such that B is twice as thick as A in the direction of x-ray propagation, then xray = I0 e−µk IA xray IB = I0 e−2µk Then, if we call the function describing the response of the film to the incident intensity f (If ), the film opacities are # OpacityfAilm = f I0 e−µk # $ $ OpacityfBilm = f I0 e−2µk f (If ) is non-linear, but has a near-linear section. For the moment, we will ignore this non-linearity and set f (I) = mI. therefore, OpacityfAilm = mI0 e−µk OpacityfBilm = mI0 e−2µk Since optical density is defined as log to base 10 of the opacity, the film optical densities are # ODfAilm = log10 mI0 e−µk $ # = log10 (mI0 ) − log10 eµk µk log10 (e) 2µk = log10 (mI0 ) − log10 (e) = log10 (mI0 ) − ODfBilm $ CHAPTER 1. INTRODUCTION 26 Figure 1.14: Typical film characteristics [39] i.e. if we look at optical densities of the film, we have an offset of log10 (mI0 ), optical density decreasing with thickness, and (ignoring the offset) a ratio of 2 : 1, reflecting the ratio of actual thicknesses of materials x-rayed. Whereas transmission ratio has an exponential relationship with material thickness, optical density has a much more useful linear relationship. Unfortunately, the interaction of x-rays with film is non-linear, and this leads to a characteristic curve for each film relating the exposure to the optical density (figure 1.14). At very low intensities the film is disproportionately sensitive, and at high intensities it saturates, becoming less sensitive to incident x-rays. The range of intensities between these two regions gives a large change in optical density for a small change in x-ray intensity, and is called the dynamic range of the film. When imaging for the trabecular structure it is essential that we are within the dynamic range of the film. If this is not the case the pattern will be absent—the film will tend towards opaque if overexposed, or clear if underexposed. 1.2.2 The Radiographic appearance of Bone Immediately visible on a planar x-ray of any long bone is the thick cortex, appearing as white lines at the edges of the bone. Between these lines, if the exposure is correct, a radiographic trabecular pattern is visible. The relationship between this and the actual 3D trabecular pattern from biopsy is subtle. It has been shown [17, 34] that the physical removal of the central trabeculae in the humerus, radius, ulna, fibula and mandibula has no effect on this pattern, and that the pattern CHAPTER 1. INTRODUCTION (a) Radiographic appearance of femoral head [27] 27 (b) Trabecular groups in Normal femoral head [28] Figure 1.15: Femoral head actually originates from the junction area between the trabeculae and the cortex. The central trabeculae are sufficiently small and randomly aligned to only contribute to the overall density, and not produce patterns on the trabecular scale. The proposed explanation [17] for the junction area causing the radiographic trabecular pattern is that the trabeculae become thicker as they near the cortex. The radiographic trabecular pattern is most apparent in the head of the femur. (figure 1.15(a)). The off-axis loading of the femoral head by the acetabulum causes a large bending moment. Distinct compressive and tensile groups of trabecular sheets oppose this, and the degeneration of these groups is visible on planar xrays (figure 1.15(b)). Singh [36] used these changes to develop a scoring system, the Singh index, as a measure of the progression of osteopenia—as osteopenia progresses, the groups gradually disappear. Figure 1.16 shows examples of planar x-rays of the femoral head which Singh used as examples of the index. These also serve to demonstrate the dependence of the image on the exposure parameters. It is extremely difficult to make a comparison between different people, when the scans themselves are not taken at constant machine settings. More recently, the radiographic trabecular pattern of the radius has been used in attempts to quantify changes in bone structure [16, 18, 19, 23]. By binarising and thinning a digitised region of interest, and scoring the results (see Image Processing—section 3.4) Geraets et al. have produced apparently promising re- (e) Grade 5 (d) Grade 4 (f) Grade 6—Healthy Femur (c) Grade 3 Figure 1.16: Examples of Singh index for osteopenia [36] (b) Grade 2 (a) Grade 1—Severe osteopenia CHAPTER 1. INTRODUCTION 28 CHAPTER 1. INTRODUCTION 29 Figure 1.17: Radiographic appearance of excised radius sults. Fractal analysis of the pattern has also been tried [2, 6], but has produced no correlation with BMD. In this study, we are analysing the radiographic trabecular pattern of an area of the distal radius. In this area, the pattern runs along the direction of the bone, as shown in figure 1.17, but is not nearly as organised as that observed in the femoral head since the loading of the radius is not as consistent. 1.2.3 Diagnosis of Osteoporosis The progression of osteopenia is most easily monitored by measuring the associated loss of bone mass. This section briefly describes the ways of doing this currently in clinical use. The index which is usually used to monitor the bone mass is the Bone Mineral Density or BMD. This is actually defined as an area density (g/cm2 ) since most machines use some measure of x-ray transmission, and therefore lose spatial information in the direction of the beam. In theory this could be crudely converted into a volume density (g/cm3 ) by assuming the bone to be cylin- CHAPTER 1. INTRODUCTION 30 drical and calculating the volume from the diameter, but this is correction is not used in clinical practice. SPA—Single Energy Photon Absorptiometry SPA uses an iodine-125 radioactive source. The total attenuation of γ-rays by both soft tissue and bone is measured and used to calculate the BMD. There is therefore error due to any soft tissue present, and this limits SPA to the forearm, which must be submerged in water to act as a tissue equivalent. For a submerged arm in a known depth of water, the total attenuation of the soft tissue and the water are nearly constant, regardless of the thickness of the arm. SXA—Single Energy X-ray Absorptiometry An advance over SPA, SXA uses an x-ray source to avoid the need for radioisotopes, but is still limited to the forearm. It gives a cheap, accurate and precise measure of BMD but also requires that the forearm be submerged in water. DEXA—Dual Energy X-ray Absorptiometry The DEXA or DXA scanner avoids the need for submerging the forearm in water, and allows scanning of any part of the body. Using single energies as in SPA and SXA, there is no way of telling if the attenuation is due to the bone, or the soft tissue. The attenuation of a particular tissue type is dependent on the energy of the incident x-rays. As we increase the x-ray energy, attenuation by bone drops more rapidly than that of soft tissue (figure 1.18). By finding absolute attenuation levels for the area at two different x-ray energies, we can calculate the amount of bone and soft tissue present: At 40kV, the approximate attenuation coefficients of soft tissue and bone are µ40kV s = 0.20cm−1 (1.1) µ40kV b = 1.50cm−1 (1.2) µ76kV s = 0.15cm−1 (1.3) µ76kV b 0.30cm−1 (1.4) and at 76kV are = We can scan some part of the body and assume it to be made up of either bone or soft tissue (or non-attenuating air). We might end up with transmitted intensities CHAPTER 1. INTRODUCTION 31 Figure 1.18: Linear attenuation coefficient (µ) variation with x-ray energy. N.B. logarithmic scale. [39] I of I 40kV I 76kV = I0 × 9.97 = I0 × 2.46 (1.5) (1.6) where I0 is the x-ray beam intensity. Beer’s Law I = I0 e−µx shows the relationship between I0 , and the incident x-ray intensity on the film I, having passed through a distance x of material of attenuation µ in the body. For two materials, this becomes I = I0 e−(µ1 x1 +µ2 x2 ) Therefore at 40kV, I0 e−(µs xs +µb xb ) = I0 × 9.97 (1.7) I0 e−(µs xs +µb xb ) = I0 × 2.46 (1.8) And at 76kV, CHAPTER 1. INTRODUCTION 32 We can divide by I0 , take natural logs and substitute the known values for µs and µb at the different energies to give two linear equations and two unknowns (xs and xb ), and can therefore solve to give: xs = 4.0cm (1.9) xb = 1.0cm (1.10) N.B. this assumes that there are only two unknown variables, i.e. the amount of bone and the amount of ‘soft tissue’ present. In fact, the soft tissue itself changes its attenuation properties (µs ) according to the fat/muscle ratio. This is a source of error, but is small compared to neglecting the soft tissue attenuation completely. By compensating for the soft tissue attenuation, areas of the body in which the bone is surrounded by large amounts can be scanned, such as the hip and the spine. DEXA is therefore capable of measuring the BMD of the whole body. Ultrasound Ultrasound has only recently been used to try to take bone densitometry readings. Currently it is not really known what exactly is being measured, and there have been no conclusive correlations with fracture risk. The technique is interesting in that even if other methods are needed for a precise indication of BMD, ultrasound could be used as a general screening procedure, since it is cheap and gives no radiation dose. The testing sites are limited to places where the ultrasound transmission through the bone is easily measured, such as the heel and fingers. QCT—Quantative Computed Tomography QCT offers the only way of measuring the trabecular bone volumatric density separately from the cortical bone. QCT also gives a true bone volumetric density, as opposed to BMD. The disadvantages are that because CT takes x-rays from many angles, it gives the patient a high radiation dose, and since it is usually only single energy x-rays that are used, errors are introduced by the attenuation differences between red and yellow marrow. The high cost of CT also limits its use to research. 1.3 Aims of this Project This project aims to investigate the problems with using planar x-ray radiographs to measure the progression of osteopenia, and to attempt to solve them. Planar x-rays offer spatial information in the form of the radiographic trabecular pattern, which is not available from the standard bone densitometry techniques and it is hoped CHAPTER 1. INTRODUCTION 33 to use this spatial information to produce quantitative measures of the trabecular structure. The higher bone turnover [28] in trabecular bone leads to an expectation that these measures may be able to give an earlier indication of the progression of osteopenia than the current densitometry techniques. The ability to use ordinary planar x-rays to measure the progression of osteopenia would be invaluable. The need for a specialized machine to measure BMD in every hospital would be removed. The structural information could also be combined with standard BMD measurements to provide a more accurate indication of fracture risk. Chapter 2 Method 2.1 Materials Used 2.1.1 Cadaveric Bones This study used the distal 125cm of five excised human cadaveric radii which had been cleaned of soft tissue. The cadavers were of a range of age, sex and build as shown in table 2.1. 2.1.2 Calibration wedge In order to check the consistancy of the scanner and calibrate the x-ray images produced, an aluminium step wedge was made (Aluminium has similar absorption characteristics to bone). The wedge consisted of 8 rectangular pieces of aluminium, of equal width and thickness but decreasing length, aligned at one end to give areas in which the total thickness varies in equal steps of 0.75mm (figure 2.1). Figure 2.1: Inverted x-ray image of calibration wedge 34 CHAPTER 2. METHOD 35 Bone No. 150 153 Sex Female Female Age 91 96 155 Female 92 162 Male 62 163 Male 65 Description Underweight Very small but Overweight Small and Underweight Tall and Overweight Tall and Muscular Cause of Death Old Age Congestive heart failure / Ischemic heart disease Cerebral Vascular Accident Probable Myocardial Infarction Ischemic Heart Disease Table 2.1: Cadavers used in the study 2.2 Acquiring the Data 2.2.1 Bone Mineral Density (BMD) measurements To find the BMD values, the bones were scanned using a clinical DEXA scanner (DEXA; model DPX-L, Lunar Radiation Corp.) The bones were placed on the scanner bed, sandwiched between a bag of gel and a bag of rice (figure 2.2). The gel and rice bags are routinely used for patients with little soft tissue around their wrists, and were necessary for scanning the excised bones to bring the attenuation within the range expected by the scanner. The bones were positioned as near as possible to the position of the radius for a typical clinical scan. Rhomboid-shaped regions of interest were manually set with the two parallel edges running transversely across the bone 15mm apart, the distal edge being just proximal of the ulnar notch, and the other two sides at the outer edges of the cortex. This site was chosen as it is the standard site for Dexa forearm BMD measurements, and is the fracture site in Colles’ fractures (see figure 1.9). Each bone was scanned using the medium and detail scan resolutions. Clinically, detail scans are not usually performed due to the higher patient dose incurred. The calibration wedge was also scanned, similarly positioned between the rice and gel bags in order to find its equivalent BMD. 2.2.2 Planar X-radiographs Planar x-rays were taken under 3 conditions: CHAPTER 2. METHOD 36 Figure 2.2: Arrangement for scanning the bones on the Dexa scanner High resolution scans In order to get the highest possible resolution to show the trabecular structure clearly, we used a mammography machine and film. The smaller focal spot size and higher resolution film than the standard x-ray machines is designed to allow microcalcifications to be spotted on mammograms. Planar xrays were taken at 36kV with exposures shown in table 2.2. Exposure times were judged manually, by repeating the scans at differing exposures until the region in the centre of the bone showed the trabecular structure well. i.e. across the dynamic range of the film, at an optical density of around 1.0. Intensifying screens were not used since this would have decreased the image resolution, and it was not necessary to minimise the dose to the bones. This would not be possible on real patients. The scans were also taken without a collimating grid, since scatter at such low x-ray energies was expected to be insignificant. The bones were held in a stand and clamp arrangement, which allowed them to be rotated to predefined angles of 0, ±1, ±2, ±5 and ±10 degrees to the angle used for the DEXA scans. Scans were taken at all these angles for the most and least dense bones, and at 0, ±5 and ±10 degrees for the other 3. This was to check the image processing measures for dependence on wrist angle and potentially use any dependence a measure in itself. CHAPTER 2. METHOD 37 Bone Number 150 153 155 162 163 kV 36 36 36 36 36 mAs 200 150 150 480 480 Table 2.2: Exposures used for Bone X-rays Ordinary planar x-ray scans Planar x-rays were taken of the unrotated bones, using an ordinary scanner. These were for comparison with the high resolution scans to quantify the image degradation. Perspex Tissue Equivalents Planar x-rays were also taken of the unrotated bones with a 40mm block of perspex between the bone and the film. This was in order to act as a tissue equivalent, to quantify the image degradation from scattering and attenuation in the soft tissue. Calibration Wedge Since the bones were x-rayed at constant x-ray energies but different exposure times, to measure the effect of these exposure changes on the response of the film, we x-rayed the aluminium step wedge on every image taken. 2.2.3 Digitisation The x-ray images were digitised using a Joyce-Loebl Scandig 3 digitiser at 25µm pixel resolution. The distal 60mm of the bone images and the whole of the calibration wedge area were digitised, and the resulting data imported into the MIDAS image processing program (see section 3.1). Scanning parameters are Optical Density Range which can be set at 1, 2 or 3 and Offset which allows an arbitrary offset for the range. The offset is not calibrated, so that only relative optical density values are known. The values returned by the digitiser are linearly proportional to optical density i.e. high optical density (black areas on the x-ray) returns high values (i.e. white on a standard greyscale map). CHAPTER 2. METHOD 38 Figure 2.3: Setting the bone in wax 2.2.4 Bone sectioning Slicing the Bones Each bone was placed in a potting box and held vertically using a stand and clamp, distal end downwards with the styloid process of the radius touching the base. The box was filled with molten parrafin wax (figure 2.3) more wax being added every 30 minutes to compensate for shrinkage due to cooling. This was repeated for 3 hours, then the block was left to cool overnight, and removed. The procedure was repeated for all 5 bones. A metal block was clamped on one side of a mitre saw, with one face parallel with and 5mm away from the plane of the saw blade. The wax block was placed with the base abutting this face and held in place using a G-clamp (figure 2.4). After sawing each slice, the block was moved down, and re-clamped. This process allowed constant width slices to be produced. The saw width was approximately 1mm, making each slice 4mm wide. The slices were prevented from drying out with damp tissue paper. CHAPTER 2. METHOD Figure 2.4: Slicing the bone using a mitre saw 39 CHAPTER 2. METHOD 40 Figure 2.5: Slice 4 of bone 150 Preparation of the slices Once cut, the bone slices still contained much bone marrow and wax. The sections were first immersed in acetone to remove the water, and then chloroform, which dissolved the fat and wax. The acetone step is necessary since chloroform is not miscible with water. The sections were then put back through acetone into water, and the remaining marrow tissue removed from the slices with a jet of water. The bones were again put through acetone into chloroform and left to soak overnight, before being returned through acetone to water. The sections were then arranged in order and put into numbered plastic bags, again with damp tissue to prevent drying. Photographs were then taken of all the slices of the bones. (e.g. figure 2.5). 2.2.5 Slice scoring Those slices that co-incided with the regions of interest later processed were scored (See scoring instructions Appendix F). Scoring was carried out independently by three people. This gives a structural measure for correlation with radiographic trabecular pattern scores. Chapter 3 Image Processing 3.1 Midas MIDAS is an in-house C program running on DEC Alpha computers in the Bagrit Center’s Visualisation Lab. MIDAS (Medical Image Display and Analysis System) allows image data to be displayed and includes a number of generic image processing algorithms. An example of the Midas screen is shown in figure 3.1. Many of the routines added for this project produce a great deal of numerical data which are passed to a statistical package for analysis. The data are appended as text to a collection of ‘.log’ files, which can then easily be read by other programs. The following sections outline some parts of the image processing techniques used in the analysis of the images. Around 5, 000 lines of code were written by the author to implement functions used in this project. Listing the complete source code would be impractical, but a few more interesting functions can be found in Appendix G. Many routines use the same functions e.g. segment() separates unconnected regions. This is used within routines to count regions, find their centroid, circularity, area, perimeter, or to filter out regions below a certain size. 3.2 Selection of the Region of interest Figure 3.2(a) shows the full digitised image of one of the x-rays. The resolution is 25µm per pixel, giving a total image size of around 2600 × 1600 pixels for the 65×40mm scan area shown. All the bone images were transformed as necessary so that the styloid process appeared in the lower right corner. Our region of interest is the ultradistal radius, in common with previous researchers [19]. For this study we have defined this to be ‘an area of 12.8 × 12.8mm, with a centre 15mm proximal 41 42 Figure 3.1: Midas 3 CHAPTER 3. IMAGE PROCESSING CHAPTER 3. IMAGE PROCESSING (a) Full scanned image (b) Rotated image showing regions of interest Figure 3.2: Region of interest selection—Bone 150 43 CHAPTER 3. IMAGE PROCESSING 44 to the centre of the distal cortex, along the major direction of the radiographic trabecular pattern’ (shown as the smaller square in Figure 3.2(b)). This definition gives us an automatic way of choosing the region of interest, which is not reliant on the user (who may unconsciously choose areas in which the trabecular pattern is more visible). The distance from the distal cortex was chosen to place the ROI beyond the epiphyseal line. In order to extract the ROI using this definition, the image must first be rotated to make the major direction of the trabecular pattern horizontal. This is a particularly important step, since it eliminates any ROI position and orientation changes due to the arbitrary location of the bones on the x-rays. The major direction is picked out by a routine detailed later (section 3.3), and a large square area of the original image is rotated by this angle, to leave an image in which the major trabecular pattern direction is horizontal (figure 3.2(b)). 3.2.1 Preprocessing the region of interest Once the radiographic trabecular pattern is horizontal on the image, the user is asked to click on the centre of the distal cortex using the mouse. The co-ordinates thus obtained are then used to calculate the position of the centre of a large ROI by subtraction of a horizontal offset of 600 pixels. This large ROI, 580 × 580 pixels in size (shown as the larger square in figure 3.2(b)) is extracted from the main image (figure 3.4(a)). Pixel value re-mapping As previously mentioned (section 1.2.1), the radiographic trabecular pattern is dependent on the x-ray intensity variation lying within the dynamic range of the film. Inevitably, this cannot be perfectly achieved, and the range moves toward the nonlinear sections. Also, due to beam hardening (section 1.2.1), the same spatial variation in the amount of calcified trabecular bone will produce less variation in x-ray intensity for a thick bone than for a thin bone (having passed through thick cortical bone, the beam will be less susceptible to attenuation by trabeculae). This leads to a considerable variation in the range of pixel values between bones, which has little to do with the trabecular pattern itself. To attempt to eliminate this variation, we can try to re-map the pixel values so that they correspond to the thickness of calcified bone through which the x-rays have travelled. The calibration wedge gives the relationship between thickness of aluminium and pixel value, an example of which is shown in figure 3.3. To proceed we have to assume that the attenuation properties of aluminium are similar to calcified bone, only differing in magnitude (personal communications with A. Dzik-Jurasz and CHAPTER 3. IMAGE PROCESSING 45 250 Greyscale value 200 150 100 0 degrees 10 degrees -10 degrees 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure 3.3: Bone 150 calibration wedge Greylevel values 0 CHAPTER 3. IMAGE PROCESSING 46 R. Nicholson). From this assumption, we can then use the calibration wedge curve to give an equivalent thickness of aluminium for the pixel values of the bone. Ideally we would like to know the thickness for each pixel value, by curve fitting to the calibration wedge data. This was not considered worthwhile, as the calibration wedge was not thick enough to cover the pixel values for the larger bones. Instead, linear interpolation and extrapolation were used to calculate the thicknesses corresponding to the minimum and maximum pixel values in the regions of interest. The thickness range was normalised so that the largest range corresponded to 255, and the pixel values within the ROI were linearly mapped onto this range (histogram stretching). This is effectively re-mapping the pixel values to equivalent thicknesses of aluminium, by assuming the relevant section of the curve in figure 3.3 to be linear. Figure 3.4(b) shows the ROI after this histogram stretching operation. High-pass filtering The large ROI is then mean filtered with a square mask of 51 pixels to produce an image containing only the low frequency information (figure 3.4(c)), and this image is subtracted1 from 3.4(b) to give an image with the low frequency components removed (figure 3.4(d)). The mean filter has a border of half the mask size around the image, in which the pixel values are undefined (since the mask would have to have extended beyond the image to produce them). To remove this border the centre 512 × 512 pixel region is extracted from the 580 × 580 region (figure 3.4(e)). This is the final stage in the pre-processing2 . Pre-processed images Figures 3.5 and 3.6 show the PDF3 plots of the ROIs before and after processing. The ranges have been mapped differently, depending on the calibration wedge information e.g. bone 150 is mapped over the range of 0–217, while bone 162 is mapped over the range 0–194. N.B. because this mapping occurs before the mean filtering, the final pixel value ranges will be different. Figure 3.7 shows the preprocessing of another ROI as a contrast to figure 3.4. The initial images 3.7(a) and 3.4(a) look quite dramatically different, due to the very small grey-scale range in bone 162. In both pre-processed images 3.7(e) 1 The subtraction routine also adds an offset to prevent negative pixel values. The code for all the pre-processing is called from the function ppdistalcortex(). Having clicked on the distal cortex, the routine returns the fully pre-processed image. 3 PDF stands for Probability Density Function—the probability of a pixel having a certain greylevel value. This is simply a count of the number of pixels of a certain value in the ROI divided by the total number of pixels. 2 CHAPTER 3. IMAGE PROCESSING 47 (a) Stage 1—Extracted image (b) Stage 2—Histogram Stretched to 0–217 range (c) Stage 3—Mean filtering with mask of width 51 (d) Stage 4—Subtraction of Stage 2 image (e) Stage 5—Centre 512x512 area extracted Figure 3.4: Stages in preprocessing bone 150 CHAPTER 3. IMAGE PROCESSING 48 0.04 0.04 ’b150d0unspdf.plt’ 0.035 0.03 Probability probability 0.03 0.025 0.02 0.015 0.025 0.02 0.015 0.01 0.01 0.005 0.005 0 ’b150pppdf.plt’ 0.035 0 50 100 150 200 greyscale value 0 250 (a) Original histogram 0 50 100 150 Pixel Value 200 250 (b) Pre-processed histogram Figure 3.5: PDF plots of bone 150 ROI 0.04 0.04 ’b162d0od3unspdf.plt’ 0.035 0.03 Probability 0.03 probability ’b162pppdf.plt’ 0.035 0.025 0.02 0.015 0.025 0.02 0.015 0.01 0.01 0.005 0.005 0 0 0 50 100 150 200 greyscale value (a) Original histogram 250 0 50 100 150 Pixel Value 200 (b) Pre-processed histogram Figure 3.6: PDF plots of bone 162 ROI 250 CHAPTER 3. IMAGE PROCESSING 49 (a) Stage 1—Extracted image (b) Stage 2—Histogram Stretched to 0–194 range (c) Stage 3—Mean filtering with mask of width 51 (d) Stage 4—Subtraction of Stage 2 image (e) Stage 5—Centre 512x512 area extracted Figure 3.7: Stages in preprocessing bone 162 CHAPTER 3. IMAGE PROCESSING 50 and 3.4(e), the images themselves have a similar overall appearance but the differences in the trabecualar scale pattern have been preserved. Further analysis techniques are carried out on these pre-processed images rather than the raw images (unless otherwise stated). 3.3 Fourier transform analysis Having obtained a pre-processed ROI from each of the x-rays taken, they were processed to obtain values relating to the pattern. The first method used was a crude analysis of the angles within the image, using Fourier transforms. The Fourier transform is a method for finding the frequency components within a signal. For image processing, we use the shifted two-dimensional Fourier transform4 . The pixels around the centre of this transformed image represents the components of low spatial frequency within the image, and towards the edge, higher spatial frequencies. The direction of a pixel relative to the centre represents the direction of the frequency component, and its value represents the magnitude. To demonstrate these concepts and how they relate to the trabecular pattern being analysed, a striped phantom image was produced (figure 3.8(a)). The phantom consists of 10 horizontal stripes. If we consider a vertical line down this image, and plot the grey-level values against distance down the line, we see a sinusoid as shown in figure 3.8(b). Similarly, plotting along a horizontal line would produce a flat line, since there is no grey-level variation in the x-direction. For this phantom, therefore, with the lines running horizontally, it can be seen that there is a frequency component in the vertical direction. The Fourier transform of this phantom has two non-zeros values 10 pixels above and below the centre. The 2D Fourier transform of a real image is symmetrical, and so these two points really represent the same information—a physical correlate to this would be that a line running from left to right is indistinguishable from a line running from right to left. The direction relative to the centre indicates the direction of the frequency, i.e. vertical; and the distance from the centre of 10 pixels indicates the spatial frequency, i.e. there are 10 stripes across the image. It is important to note that lines running horizontally on the image produce frequency components vertically in the Fourier image. 4 The 2D Fourier transform produces an image of complex values which contain the magnitude and phase information for all the frequencies in the original image. The magnitude information is more useful, and the phase information is usually discarded. The pixel values of the Fourier transformed images mentioned here therefore represent magnitudes. The images are also shifted to make the centre represent low frequency rather than the edges. The total magnitude is also normalised to 1000 before any processing. This is all standard practice, and makes analysis easier. [20] CHAPTER 3. IMAGE PROCESSING 51 (a) Phantom of sinusoidal stripes 250 ’sin.plt’ 200 150 100 50 0 0 100 200 300 400 (b) Greyscale values along a vertical line down the phantom Figure 3.8: Sinusoidal stripe phantom 500 CHAPTER 3. IMAGE PROCESSING 52 If we similarly consider horizontal and vertical lines across the ROI of bone 150, we see a dramatic difference in the frequencies (figure 3.9). The vertical line contains higher frequencies than the horizontal line, indicating that the trabeculae are running horizontally rather than vertically. The Fourier transform can be used to more accurately determine directions for the frequencies, effectively calculating these frequency components over all 180 degrees. The algorithm used to calculate the Fourier transform is the FFT or fast Fourier transform. This requires that the input image be a square whose side-length is a power of 2, hence the 512 × 512 ROI size chosen. The FFT is a special case of the DFT, or Discrete Fourier Transform. In order to work out the transformed image, the DFT acts as though the image extends forever—imagine the image repeated, as adjacent fitting tiles. If one edge of the image doesn’t have the same greylevel value as the opposite edge, the DFT behaves as though this is part of the signal, a step in the image, and produces the appropriate frequency components. This effect can be seen in figure 3.10(b). This is the log5 of the magnitude of the Fourier transform of the ROI in (a). Horizontal and vertical lines are apparent on the FFT image (sudden jumps in greyscale value have all frequency components, and therefore appear as lines). The streaking artifacts were removed using a cosine mask. This attenuates the grey-level values at the image edges (figure 3.10(c)), thus eliminating any sudden jumps in grey-level value, by making the edges gradually tend to zero6 . Figure 3.10(d) shows the Fourier transform of this image, with the streaking removed. There is a trade-off, in the form of a star-burst artifact at the centre, caused by the low-frequency components added by the mask. This region contains very low frequencies, (in fact the frequencies that were already removed by the mean filter during pre-processing – hence the dark spot in the centre of (b)), so we have lost no essential information in using the mask. We do lose some information from the edges of the image, as these are attenuated by the mask, so it is important to keep the mask size as small as possible, whilst keeping the starburst artifact from growing into the useful frequency components. A mask of 1/10 image diameter was used as a reasonable compromise. Simply looking at the Fourier transform, it is immediately apparent that the centre area of lighter pixels is elliptical, with the major axis running vertically, as expected from the horizontal trabecular direction. 5 logs are taken to make the values show up on the image—without this the centre values would be very high and would drown out the rest of the image 6 This is implemented in the function multsin(). The boarder pixels are multiplied by a mask of (1 − cos(sx ))(1 − cos(sy )) where sx and sy are the distances from the edges scaled to range from 0 to π. The centre pixels are not altered. CHAPTER 3. IMAGE PROCESSING 250 53 ’horizontal.plt’ 200 150 100 50 0 0 100 200 300 400 500 (a) Greyscale values along a horizontal line across the preprocessed image 250 ’vertical.plt’ 200 150 100 50 0 0 100 200 300 400 500 (b) Greyscale values along a vertical line down the preprocessed image Figure 3.9: Contrast between spatial frequencies in horizontal and vertical directions CHAPTER 3. IMAGE PROCESSING 54 (a) Preprocessed ROI of Bone 150 (b) log(|F|) of image (a)—note horizontal and vertical streaking (c) Image multiplied by cosine edge mask— mask width 1/10 image diameter (d) log(|F|) of image (c)—note starburst artifact at centre Figure 3.10: FFT analysis of Bone 150 ROI CHAPTER 3. IMAGE PROCESSING 55 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure 3.11: Bone 150 FFT angle wedge plot 180 CHAPTER 3. IMAGE PROCESSING 56 Having prepared the FFT image, the next step is to extract the angle information. The spatial wavelength components of interest were determined by measuring the trabecular width range on the images and doubling. If we roughly estimate one trabecula to be 6 pixels in diameter, then if these trabeculae were running parallel with gaps of 6 pixels between they would have an apparent wavelength of 12 pixels, or about 1/40 of the image diameter. This would correspond to a pixel 40 from the centre in the FFT image. In this way, it was determined that the trabecular information lies within the range 10–80 pixels from the centre of the FFT. The first attempt at extracting this information involved integrating along lines radially from the centre, between 10 and 80 pixels from the centre point. Sum values were produced for integer angles between 0 and 179 degrees anti-clockwise from horizontal. This was found to produce noisy data and rather than smooth this data, it was considered more useful to change the integration from a line to a wedge. The routine7 which accomplishes this multiplies the FFT values by the radial distance from the centre, i.e. the frequency. The first step is to make it possible to compare the spectral values; the last is to compensate for the 1/f tailing off of the magnitudes found in the Fourier transforms of natural signals. This tailing off is apparent from the appearance of the Fourier transform. An example of the result obtained from this function is shown in figure 3.11. There is a very prominent peak at around 90 degrees, indicating the large frequency components in this direction. These correspond to the horizontal trabeculae. The function outputs the angle at which the maximum value occurs, along with the average of the angles at either side of the peak at 1/2, 3/4 and 1/4 of the peak height. (This average was used to determine the amount the original x-ray image needed to be rotated). Several parameters were obtained from this curve such as peak width and angle (see Appendix H) These values, along with the raw curve data were imported into SPSS for analysis. Another function was written to split the ROI into quarters, and run the above analysis on each one, to investigate the degree of consistency of the angles. Similarly, integrations around circles of increasing radii were used to investigate the distribution of frequency components, independent of direction. 3.4 Binary image analysis The second set of analysis techniques used the binarised image of the ROI. Binarizing involves thresholding at a certain value—making every pixel whose value is less than this threshold equal to 0 (black), and every other pixel 255 (white). This is carried out on the image after the low frequency components have been removed. 7 fftangleplot2()—see appendix G CHAPTER 3. IMAGE PROCESSING 57 This is required, since the binarization uses an constant threshold over the whole image, and we are trying to pick out the small scale trabecular structure. Figure 3.12(b) shows binarization with the threshold at the modal value with the thicker areas of bone showing up as black. The binarized image has a large amount of noise, and this was removed using a 9 × 9 mean filter on the greyscale image prior to binarization. This low pass filtering needed for the binarized analysis is incorporated into a separate version of the pre-processing algorithm. This choice of filter is dealt with later in the discussion (section 5.3.2). This filtered, binarized ROI is useful for analysis of the shape of the binarized regions. 3.4.1 Skeletonizing The skeleton of a binary image can be defined via the medial axis transformation [38]. If we have a region, R with a boarder B, then the medial axis is all the pixels within R which have two nearest neighbours in B. i.e. points within the region which have two nearest boundary points. This is a shape preserving transform since if we start with the skeleton, and imagine spreading a region outwards from all the points on the skeleton, we will at a certain time generate the original image (of course we don’t know the time at which this occurs). As an example, figure 3.13 shows some shapes and their medial axes. If we carry out a skeletonizing operation on the binarized image, we get white lines along the medial axes of the gaps between the trabeculae8 (figure 3.14). Inverting the binarized image first leads to a more meaningful thinned image, in which the medial axes are along the trabeculae themselves. Figure 3.15 shows this clearly with the skeletonized images superimposed onto the ROI greyscale image. In the greyscale image, the darker regions represent the trabeculae. Once we have this thinned image, we can find parameters to describe it, and so quantify the pattern. The most simple parameter is the white area of the skeleton. Others require further processing of the skeletonized image. Pixel Connectivity One possible parameter of the skeleton image is the connectivity of the pixels within it. The connectivity of a white pixel in this case is simply the number of white pixels adjacent to it, between 0 and 8. It follows that the end pixels of horizontal or vertical lines in the skeleton will have a connectivity of 1, while those belonging to the body of a horizontal or vertical line will have a connectivity of 8 trabeculae here means the lines on the radiographic trabecular pattern which correspond to thicker areas of bone. CHAPTER 3. IMAGE PROCESSING 58 (a) Bone 150 ROI (b) Binarization of ROI with threshold at modal value (c) ROI after 9 × 9 mean filter (d) Binarized filtered ROI Figure 3.12: Binarization of bone 150 at modal value CHAPTER 3. IMAGE PROCESSING Figure 3.13: Examples of the medial axes of simple shapes [20] Figure 3.14: The skeletonizing operation on the binarized image regions 59 CHAPTER 3. IMAGE PROCESSING 60 (a) Skeletonized image (b) Skeletonized inverted image Figure 3.15: The skeletonized images superimposed onto the original bone 150 ROI CHAPTER 3. IMAGE PROCESSING 61 2, and so on. At first this might seem a useful measure of the degree to which the trabecular network is connected, and Geraets et al. [19] used the connectivity of white pixels to define two parameters, ENDS and NODES with which to quantify the pattern. ENDS being the number of bright pixels with one bright neighbour and NODES the number of bright pixels with three or more bright neighbours. If we produce an image in which the connectedness of the pixels is coded by greylevel (figure 3.16(a)), we see that many of the more connected pixels lie along the diagonals of the skeleton. This is due to the representation of a diagonal line as discrete pixels, which leads to steps as the line crosses pixel boundaries. This means that the NODES parameter picks out mainly diagonals, while the ENDS parameter picks out some, but not all ends (missing the ends of diagonal lines). Fork Points A better way of measuring the connectedness of the image is to look for fork points in the skeleton. This was also performed by Geraets et al. [16]. We can define a fork point as a point on the skeleton which has more than two lines leading from it9 . Figure 3.16(b) shows the fork points for the same region. The number and distribution gives us another measure of the trabecular pattern. An attempt was also made to measure the fractal dimension of the fork point distribution(markfract()). Lines Since we now have a routine which picks out the fork regions, it is a simple matter to blank out these regions to leave the lines in between. The lengths of these lines will correspond to the lengths the trabeculae run without links to their neighbours. The lengths of all the lines were exported into SPSS for analysis. Connectedness directions A crude method for finding the main directions in which the trabeculae run in the thinned image is to check the directional connectivity of each white pixel. i.e. first count the number of white pixels with another white pixel above them, then count 9 This is found by the function markforks(). This function takes all white points on the skeleton image as candidate points, and for each one looks around the perimeter of a 5 × 5 square centred upon it. Starting at the upper left corner the routine counts the number of inversions until it returns to the upper left corner again. Four inversions must mean two lines leading from the point, so that any more must make this a fork. Since we are dealing with a 5 × 5 square, each fork is identified by a number of candidate points, making a fork region. The centroids of these regions are returned as the fork points themselves. CHAPTER 3. IMAGE PROCESSING (a) Connectivity of thinned image—darker pixels show higher connectivity (b) Identification of fork points Figure 3.16: Processing the Thinned Image (enlarged region) 62 CHAPTER 3. IMAGE PROCESSING (a) Binarized ROI 63 (b) Image segmented into separate regions Figure 3.17: Segmentation of regions using modal threshold those with one to the upper right etc. This was carried out on the thinned images and normalised by the total thinned area. 3.4.2 Binary Image Regions If we consider the binarized ROI in figure 3.12(b), we can see that the white regions represent the areas in which there has been less attenuation of x-rays, i.e. the areas between the trabeculae. One measure of connectedness, therefore would be to count the number and size of these regions. As the connectedness increased, the regions would become smaller and more numerous, cut off from each other by the trabeculae. If we attempt this with the ROI binarized at the modal threshold value, we see that the regions are insuficiently separated to give useful results. Figure 3.17 shows the binarized image in (a) along with the segmented image (b) in which the regions have been shaded randomly for clarity. There are only a few very large regions present. To be able to use the number and sizes of regions usefully, we need to increase the number of trabeculae cutting the regions off from each other. There are two simple ways of doing this—firstly either to erode10 or to open11 the binarized 10 Erosion contracts the boundaries of the white regions, breaking thinner links [20]. Contracts the boundaries of white regions and then re-expands them. Thin links are broken and not re-made. 11 CHAPTER 3. IMAGE PROCESSING (a) Binarized ROI 64 (b) Image segmented into separate regions Figure 3.18: Segmentation of regions using modal threshold plus 15 image, separating the regions, or secondly to change the level of the binarization threshold. Changing this threshold level is in some ways the best way of proceeding, since it uses meaningful information from within the greyscale image to decide where to separate the regions. The drawback is that we have to choose a new threshold level, which may be distorted by the non-linear mapping mentioned earlier. An arbitrary threshold offset of +15 was chosen to add to the modal pixel value, since this produced reasonable separation of the white regions, as shown in figure 3.18. Using this threshold, data from the regions—their number, area, and perimeter—were measured. A circularity parameter was also calculated12 , and the raw data was exported for analysis. Although simple to implement, an erosion routine was not used due to time constraints. 2 to give a value of 1 for circular regions, and Circularity was calculated using circumferance 4π×area higher values for more irregular shapes. 12 Chapter 4 Results 4.1 Measurements 4.1.1 BMD measurements of Bones Table 4.1 shows the BMD measurements from the Lunar Dexa Scanner in Detail mode. The BMD is calculated from the BMC, or Bone Mineral Content which is a measure in grams of the total amount of bone present in the area studied. Dividing this by the area gives the BMD in g/cm2 . Figure 4.1 graphs the bone BMD values. The medium scan values are also included, and are reasonably close to the detail scan values. It should be noted that the agreement is sufficiently poor to cast doubt on the ability to distinguish between the less dense bones, 153 and 155. Detail indicates 153 to be higher, but medium gives 155 the greater BMD. Bone Number BMC (g) Area (cm2 ) BMD (g/cm2 ) 150 153 155 162 163 0.77 0.57 0.57 2.44 1.56 3.69 3.60 4.02 4.71 4.19 0.210 0.158 0.143 0.518 0.374 Table 4.1: BMD measurements—detailed scan 65 CHAPTER 4. RESULTS 66 0.6 0.520 0.518 Medium BMD(g/cm2) Detail BMD(g/cm2) BMD (g/cm 2) 0.5 0.368 0.372 0.4 0.3 0.221 0.209 0.2 0.151 0.158 0.183 0.142 0.1 0.0 150 153 155 Bone Number 162 163 Figure 4.1: Bone BMD values. The medium and detailed scans show reasonable agreement. CHAPTER 4. RESULTS 67 0.7 BMD = 0.0849 x layers 0.6 BMD (g/cm 2) 0.5 0.4 0.3 0.2 0.1 0.0 1 2 3 4 5 6 7 8 Layers Figure 4.2: Calibration Wedge ‘BMD’ values. (N.B. Not real BMD values) 4.1.2 ‘BMD’ measurements of Calibration Wedge Figure 4.2 shows the values produced by the Lunar Dexa Scanner when scanning the calibration wedge. These values are not BMD values (see discussion). 4.1.3 Equivalent Bone thicknesses from ROIs Figure 4.3 shows the pixel values produced by the digitised x-ray of the calibration wedge. The thickness range has been reversed to make the appearance more similar to the standard characteristic curve graph (c.f. figure 1.14 on page 26), although this is still not equivalent (see discussion). A marked non-linearity can be seen, in contrast to the linear result produced by the DEXA scanner in figure 4.2. Table 4.1(a) shows the minimum, mean and maximum grey level ranges within the unprocessed ROI. Table 4.1(b) shows these values after conversion using the relationships found between pixel value and wedge thickness from figure 4.3 and wedge thickness and ‘BMD’ in figure 4.2. Linear interpolation and extrapolation was used, and brackets indicate those for which the pixel values lie outside the range covered by the wedge. The results show an excellent correlation with the CHAPTER 4. RESULTS 68 250 Greyscale value 200 150 100 0 degrees 10 degrees -10 degrees 50 0 8 7 6 5 4 3 2 1 0 Thickess of aluminium (layers) Figure 4.3: Bone 150 calibration wedge Greylevel values for the three of bone orientations. (a) Grey level values of ROIs direct from digitiser (b) Equivalent BMD values of bone (calculated from calibration wedges) Bone No Min Mean Max Bone No Max Mean Min 150 153 155 162 163 15 48 11 63 34 87 121 71 110 95 214 222 191 182 206 150 153 155 162 163 (0.679) 0.557 (0.764) (0.849) (0.782) 0.285 0.271 0.268 0.513 0.462 0.111 0.130 0.098 0.340 0.246 Table 4.2: Equivalent thickness of bone calculated from ROI greyscale values CHAPTER 4. RESULTS 69 DEXA BMD values of the bones (correlation coefficient=0.9816, p=0.003). 4.1.4 ROI re-mapping Table 4.3 shows the ranges (max-min) for the pixel values from the ROIs, and the ranges after the pre-processing. It can be seen that the removal of the low frequency information during pre-processing has not made all of the ranges smaller—bones 153 and 162 have increased ranges. 4.1.5 Absolute Optical Density values for ROIs Table 4.4 shows the absolute optical density readings obtained from repeated measures of the ROIs on the x-rays with an aperture diameter of 3mm. 4.1.6 Appearance of slices Figures 4.4 to 4.7 show photographs of some of the bone sections taken from the proximal sides. The slice numbers indicate the distance proximally from the styloid process, in 5mm steps. Bones 150 and 153 can be seen to have a much sparser trabecular structure than bones 162 and 163. The scoring scheme used for quantitative descriptions of the trabecular structure is given in appendix F. Figure 4.8 shows two enlarged cases of differing trabecular density, and differing trabecular and cortical thicknesses. 4.2 Correlations 4.2.1 BMD and Slice scores Table 4.5 shows the correlation coefficients between the scores used to quantify the appearance of the slices. The names are abbreviated for presentation: thickness is the overall bone thickness; detbmd is the detail BMD value; cortex and coruni are cortex thickness and cortex thickness uniformity; trabden and trabdenuni are trabecular density and trabecular density uniformity; trabthk and trabthkuni are trabecular thickness and trabecular thickness uniformity. The scores are described in detail in appendix F. There are very high correlations with BMD (> 0.88) for all of the scores except trabthk and thickness. trabthk has a negative correlation with thickness. Combinations of scores also have very high correlations with one another, except for trabthk and thickness. CHAPTER 4. RESULTS 70 Bone Number Initial re-mapping range Final pre-processed range 150 153 155 162 163 217 171 255 194 220 208 177 219 196 197 Table 4.3: Pixel ranges for re-mapping of ROIs used for the histogram stretching operation during pre-processing. Also shown are the final pixel ranges in the pre-processed image. Bone Number Mean OD S.D. 150 153 155 162 163 1.02 1.12 1.04 1.26 1.16 0.05 0.11 0.11 0.04 0.08 Table 4.4: Average absolute optical density values for ROIs CHAPTER 4. RESULTS Figure 4.4: Slice 4 of bone 150 Figure 4.5: Slice 4 of bone 153 71 CHAPTER 4. RESULTS Figure 4.6: Slice 4 of bone 162 Figure 4.7: Slice 4 of bone 163 72 thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni 1.000 0.343 0.407 0.218 0.229 0.113 -0.553 0.093 thickness 1.000 0.968 0.972 0.946 0.517 0.944 cortex 1.000 0.963 0.977 0.672 0.963 coruni 1.000 0.955 0.672 0.974 trabden 1.000 0.719 0.993 trabdenuni Table 4.5: Correlations between bone scores 1.000 0.950 0.961 0.947 0.888 0.584 0.886 detbmd 1.000 0.741 trabthk 1.000 trabthkuni CHAPTER 4. RESULTS 73 CHAPTER 4. RESULTS (a) Slice of bone 150 74 (b) Slice of bone 162 Figure 4.8: Enlarged regions of bone sections showing contrasting trabecular and cortical thicknesses 4.2.2 Image processing scores based on Geraets et al. [16, 19] Table 4.6 shows the correlations between the BMD and slice scores and some of the image processing parameters used by Geraets et al., but for an unfiltered image. All have a very high correlation with BMD (> 0.992), and a high correlation with the sectioning scores (> 0.821), again except for trabthk and thickness. The correlation coefficients shown in table 4.7 are for the same parameters produced from a 9 × 9 mean filtered image. The correlations are much lower, the most significant being NODES, TAREA and TFORK with the thickness measure, which correlate with negative coefficients of < −0.679. Interestingly ENDS has strong positive correlation of +0.583 with thickness and only slighly less with cortex and trabden. The ENDS parameter has reasonably strong correlations with the other scores, and correlates significantly better than NODES, TAREA and TFORK. 4.2.3 Fourier Analysis scores Table 4.8 shows the correlation coefficients for the Fourier transform analysis. FWQM, FWHM and FWTM are peak widths in degrees, measured at 1/4, 1/2 and 3/4 of the peak height, and do not have significant correlations with the bone scores. SPLANGSD is the standard deviation, in degrees, of the dominant trabec- CHAPTER 4. RESULTS thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni 75 ENDS NODES TAREA TFORK 0.463 0.984 0.930 0.932 0.888 0.837 0.456 0.818 0.390 0.996 0.929 0.939 0.916 0.848 0.532 0.841 0.403 0.992 0.917 0.926 0.902 0.828 0.515 0.821 0.399 0.997 0.940 0.942 0.928 0.856 0.530 0.852 Table 4.6: Skeletonised binarized ROI data correlations: Unfiltered thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni ENDS NODES TAREA TFORK 0.583 0.462 0.545 0.348 0.555 0.332 -0.025 0.412 -0.724 -0.244 -0.311 -0.083 -0.277 -0.034 0.356 -0.104 -0.698 -0.195 -0.231 -0.010 -0.206 0.053 0.386 -0.019 -0.679 -0.402 -0.409 -0.214 -0.402 -0.137 0.193 -0.209 Table 4.7: Skeletonised binarized ROI data correlations: Mean Filtered CHAPTER 4. RESULTS thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni 76 FWQM FWHM FWTM SPLANGSD -0.322 -0.221 -0.006 0.050 -0.059 0.215 0.126 0.160 0.351 0.157 0.373 0.337 0.197 0.403 -0.135 0.322 0.208 -0.068 0.232 0.140 0.113 0.286 -0.161 0.251 0.232 0.975 0.915 0.973 0.906 0.906 0.646 0.882 Table 4.8: Fourier Analysis ROI data correlations ular direction over the four quarters of the ROI. This gives a very high correlation with all the scores except trabthk and thickness. 4.2.4 Other Image Processing scores Table 4.9 shows correlations with two parameters derived from the lines on the mean filtered skeletonized image (see page 60). The sketeltonized image lines have been broken at the node points; LINELEN is the mean length and LINENUM is the number of the remaining lines. LINENUM has weak negative correlations with most scores, except trabthk. The strongest correlations of < −0.466 with trabden, thickness, detbmd and cortex. LINELEN has much stronger positive correlations of > +0.639 with all of the scores except thickness. The strongest correlation is +0.953 with trabthk. Table 4.10 shows the absence of any significant correlation between the bone scores and the final pixel re-mapping range. All correlations have a magnitude below 0.205. 4.2.5 Failed scores The fractal dimension and binarised regions scores proved unuseful in their current form. See section 5.4.1 of the discussion. CHAPTER 4. RESULTS 77 LINELEN LINENUM -0.353 0.720 0.639 0.742 0.795 0.757 0.953 0.800 -0.497 -0.466 -0.468 -0.301 -0.514 -0.250 -0.031 -0.339 thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni Table 4.9: Skeleton image line analysis correlations Final pixel re-mapping range thickness detbmd cortex coruni trabden trabdenuni trabthk trabthkuni 0.113 -0.167 0.119 0.057 -0.003 0.205 0.179 0.158 Table 4.10: Correlations between bone scores and pixel remapping range Chapter 5 Discussion 5.1 DEXA 5.1.1 Bone scans The DEXA scanner has been used to find BMD values for the bones, to provide a quantitative measurement of the amount of bone present. The results of the DEXA scans (shown in figure 4.1 on page 63) show a wide variation between the very elderly females (bones 150, 153 and 155) with low BMD and the slightly younger males (bones 162 and 163). The females were very likely to be suffering from post-menopausal osteopenia when they died. The variation in the BMD values between the Medium and Detail scan settings may be due to variations in the manually defined region under study; there was insufficient time to determine this. Clinically, the choice of scan area is automatically made by the software, so this variation may not reflect a problem with DEXA in normal use. Automatic region setting was unusable in this study, since the machine expected to locate the radius relative to the ulna, which was not present. In the future, it may be possible to re-enable the automatic detection by placing another radius adjacent to the radius under study. This may improve the consistency between the Medium and Detail scans. It should be noted that if the choice of area is not the source of error, the Detail scans offer a better indication of BMD. 5.1.2 Calibration wedge scan The equivalent BMD values produced by scanning the calibration wedge are linearly proportional to wedge thickness (figure 4.2 on page 64). These are clearly not BMD values, since aluminium and not bone was being scanned. The DEXA scanner has assumed the specimen to be composed of soft tissue and bone, and 78 CHAPTER 5. DISCUSSION 79 used these attenuation coefficients to calculate BMD (see page 30). Nevertheless these results serve as a demonstration of the ability of the DEXA to produce a linear result from a linear wedge. This is in contrast to the greylevel values produced by simply x-raying the wedge (next section). 5.2 Planar X-rays 5.2.1 Calibration wedge scans Appendix B contains graphs of the pixel values given by the different wedge thicknesses for the planar x-rays. The differences are largely caused by the differing exposures used for each bone (see table 2.2 on page 35) and the differing optical density offsets used for the digitiser. These were set to enable the trabecular pattern to fall within a central pixel range. Neglecting beam-hardening effects (see section 1.2.1), and film absorption nonlinearities, the equally stepped aluminium wedge should give a linear optical density relationship. (The digitisation process is assumed to be linear, and produces grey level values corresponding directly to optical density.) Plotting the inverted greyscale values of the calibration wedge against wedge thickness gives a nonlinear result (figure B.1). The figure is plotted to be as similar as possible to the standard representation of the characteristic curve in figure 1.14 on page 26. The wedge thickness scale is therefore reversed, to give lower x-ray exposures to the left (higher wedge thicknesses), and the y-scale is pixel value, which is proportional to optical density, with an arbitrary offset. Taking the curve for bone 150 as an example, at low wedge thicknesses (0–1) the film is dark (high greyscale values) due to high x-ray exposure. This section of the has a low gradient, because the value at 0 thickness has saturated the digitiser. There is a near-linear section (1–3) of high gradient and then the gradient begins to tail off again (4–8). This last tailing off section is due to a combination of two effects. Firstly, over-sensitivity of the film to low intensity radiation that penetrates the thicker parts of the wedge. Secondly, and more importantly, the attenuation of successive wedge layers is lower due to the differential absorption of the aluminium. Because of this beam hardening, the curve cannot be used to determine the characteristic curve of the film, as we cannot separate the two non-linear effects. 5.2.2 Bones scans The digitised planar X-rays obtained of the bones are shown in appendix A. Maximum, minimum and mean greyscale levels of the ROIs were re-mapped into equivalent BMD values using the calibration wedge x-ray and DEXA scans. The results CHAPTER 5. DISCUSSION 80 show an excellent correlation with the actual BMD values of the bones. (correlation coefficient=0.9816, p=0.003). This is fundamentally a way of carrying out an SXA scan, without soft tissue around the bone to distort the results, so the high correlation is not surprising. The wedge used was clearly too thin, since the ROI minimum pixel values were off-scale for all bones except 153. 5.2.3 Slice Appearance The bone slices varied greatly in the appearance of the trabecular structure, cortical thickness and overall size. It can be seen that the trabecular structure at the junction area between the cortex and the trabecular bone is similar to that in the central area, e.g. from the enlarged regions of two different bones with contrasting trabecular structures in figure 4.8 on page 69. This means that if the radiographic trabecular pattern originates from the junction area trabeculae [17, 34], it will still be an indication of the overall trabecular structure. This could be more strictly validated in future, see section 6. The scoring system used is described in detail in appendix F. The objective of the scores is to give an indication of the ability of the image processing parameters to pick out the trabecular structure. This is made difficult due to the small number of bones, and the large range of BMD values, since it becomes difficult to separate correlations with the structural changes from correlations with density changes. 5.2.4 Bone architecture On the scans shown in appendix A, the distal cortex (at the articulating surface of the bone on the right) is clearly visible as a dark line caused by the high attenuation. The distal cortex is very prominent on the image for two reasons. Firstly, it is aligned in the direction of the x-ray beam, so the attenuation is concentrated into a small region of the image. Secondly, it is thicker than the other cortex areas due to its concave structure. The concave load-bearing structure required for articulation of the wrist joint is weaker than a similar convex structure and so requires greater thickness to prevent fracture [28]. This makes the concave regions of the cortex more prominent on x-rays. In contrast, the convex cortex proximal to the styloid process is barely visible. This could be attributable to the extension of the styloid process beyond the body of the bone which gives a base attenuation level to the rest of the structure. Comparison of the convex and concave cortices of the styloid process shows this not to be significant—the concave cortex is very prominent even as it extends distally along the process. Bone remodelling (page 18) is responsible for maintaining the structure in a form suitable to transfer the loads required without fracture. In cases of gradually CHAPTER 5. DISCUSSION 81 developing osteopenia, as bone is resorbed, the stresses will increase for the more structurally important, load-bearing parts of the bone. This is likely to result in an increased difference in radiographic appearance between these regions and regions of less structural importance [28]. These regions will thin from the resorption, but the increased stresses will prevent them being lost. We therefore expect the concave cortices to be thin but relatively highly attenuating for the osteopenic bones, and this is supported by the appearance of the x-rays. The absence of apparent convex cortices is noticeable for all the bones, but the concave distal cortex is much more attenuating than the remainder of the bone structures in 150 and 153 that have low BMD. Bone 155 is bigger than 150 or 153, and so appears more similar to the denser bones 162 and 163, but the thinner distal cortex marks 150 as the less dense bone out of these three. Computer analysis of these features may offer a useful avenue for future work. Care must be taken, since the ‘prominence’ of cortical features is difficult to quantify. This may simply be a result of reduced contrast from beam-hardening effects. A similar remodelling effect is also to be expected in the trabecular pattern. Trabeculae that are structurally important, i.e. run in the direction of load transfer, should be the last to be lost during bone resorbtion. i.e. rather than simply the generalised loss of trabeculae at random, we expect to lose those that are in directions less important for load transfer. This is difficult to judge by eye, and is more appropriate for computer analysis. 5.3 Image Processing 5.3.1 ROI selection Analysis of the radiographic trabecular pattern has been previously attempted by Geraets et al. [16, 18, 19, 23]. Their analysis has been based on a manual selection of a 1cm×1cm region of the digitised x-radiograph of the forearm, in a position similar to that used in the present study. The present study has automated the extraction of this ROI to remove user bias, as outlined in section 3.2. While this is an improvement over the manual ROI selection technique, it currently chooses an ROI centered at a fixed 15mm from the distal cortex, regardless of the size of the bone. This could potentially be a source of error, as we may be looking at regions relatively near the distal cortex for large bones, and relatively far for small bones. This variation is likely to be small, in the order of a few mm, and is considered negligible for the current analysis. Once useful scores have been found to quantify the pattern, the dependence on ROI site can be properly determined, and the importance of this variation quantified. CHAPTER 5. DISCUSSION 82 5.3.2 Previous Analysis techniques Pre-processing the ROI The pre-processing algorithm used by Geraets et al. is similar to that outlined in the present study, the main difference being the pixel value re-mapping used for the present study. The re-mapping was carried out to make the digitised radiographic images relate better to the physical structure of the bone, specifically as an attempt to reverse the beam-hardening and film non-linearities by using the information from the calibration wedge. This was unnessesary for Geraets et al. who only processed the binarised image, for which histogram stretching has no effect. In the time available, only the FFT analysis used the grey-level images to pick out the main trabecular directions, and this is also largely unaffected by this operation. Choice of Binarization Threshold Geraets et al. chose the binarisation threshold as the modal pixel value since this led to more reproducible results than the mean and median values [16]. This greater reproducibility can be explained by the invariance of the modal value through a non-linear transformation, such as beam-hardening or the film characteristic curve. Since we know that we are dealing with a non-linearity which distorts the distribution of pixel values depending on bone thickness and the exposures used, the safest threshold to choose for the binarization is one that is undistorted by the nonlinearity. The best we can do is to take the modal pixel value, i.e. the value which occurs most frequently. This is very unlikely to be changed by the distortion, since each particular bone thickness should produce a particular pixel value over the ROI, and the most frequent thickness in the ROI should correspond to the most frequent pixel value. Mean and median values would not be as invariant. Binarizing at a mean or median threshold would therefore introduce a dependence on the film exposure. Spatial filtering prior to binarizing The most important difference between the techniques used here and those used by Geraets et al. lie in the spatial filtering used to remove high frequency noise. Geraets et al. used a 3×3 median filter to remove the high frequency noise due to quantum mottle. At the resolution used, this corresponds to a physical mask size of 120 × 120µm. The current study has used a 9×9 mean filter on the greyscale ROI, corresponding to a 225 × 225µm mask size at the digitization resolution used. It should also be noted that for an equal mask size, a mean filter will cause greater blurring, so the difference between these two filtering operations is greater than the CHAPTER 5. DISCUSSION (a) Test Image 83 (b) Skeletonized Test Image Figure 5.1: Demonstration of the effects of noise on skeletonization mask sizes suggest. The current study uses a mean filter to avoid non-linearities introduced by median filtering. Figure 3.12 on page 55 shows the results of binarizing an unfiltered and a filtered image. Mean filtering the greyscale image has resulted in a very smooth border to the regions in the binary image. This is an extremely important effect, since then next operation to be carried out on the image is skeletonizing. For this study to more clearly demonstrate the effects of noise, comparisons are made between unfiltered and heavily filtered images. Due to differences in scanning resolutions used, a exact reproduction of the filtering used by Geraets et al. is not possible. The 3 × 3 median filter mask used by Geraets et al. would not have the same effect as a 3 × 3 median filter mask with the present higher resolution scans, and since the median filter is non-linear, using a 5 × 5 mask size would also not be a valid alternative. We can therefore conclude that the results produced by Geraets et al. are likely to be somewhere between the two extremes of filtering used here. Skeletonizing Skeletonizing picks out points within a region which have two nearest neighbours on the region border [38]. This means that the border of the region is extremely important in determining the skeletonized image. Any corruption of the border will have dramatic effects on the skeletonized image. Figure 5.1(a) shows a test image of two ellipses, the upper one with noise CHAPTER 5. DISCUSSION 84 corrupting the border, and lower without. Skeletonizing the test image shows the dramatic effect of noise (b). The border noise has produced many branches from the main horizontal axis of the region. If we now look at the binarized unfiltered ROIs for the 5 bones used in the present study (figure 5.2), the border corruption of the regions is quite apparent. In particular, the corruption is more noticeable on the denser bones 162 and 163. Taking one less dense bone (150), and a denser bone (162) and skeletonising the unfiltered regions gives a dramatic difference due to this noise (figure 5.3). The skeletonized image of bone 162 has very many more small branches than 150, caused by the greater noise in the binarized image. On this overlayed image, it can be seen that these branches are of a much smaller scale than the trabecular pattern, suggesting that their origin is not the trabeculae. Concentrating on bone 162 since this has the greatest degree of noise, we can perform a 9×9 mean filter on the image and binarize and thin again to produce image shown in figure 5.4(b). The medial axes can now be seen to be running along the trabeculae (dark lines) on the image. Figure 5.5 shows an example of the skeletonized images produced by Geraets et al. [19], having used a 3 × 3 median filter. It can clearly be seen that the image is dominated by small branches, which are presumably due to noise, since they are much smaller than the radiographic trabecular pattern. Geraets et al. produced a number of feature scores to quantify the images. Four of these were reproduced in the current study, namely: ENDS —The number of white pixels with one white nearest neighbour NODES —The number of white pixels with three or more nearest neighbours TAREA —The total area of the thinned image TFORK —The total number of branch points on the thinned image The results from the unfiltered image (table 4.6 on page 72) show very high correlations with the BMD and slice appearance scores of around +0.99. This is an unreasonably high result to expect from a quantification of the trabecular pattern, and suggests that the BMD itself is being measured by some indirect route, via the noise on the binarized images. In contrast, the same parameters applied to a 9 × 9 mean filtered, binarized and skeletonized image are shown in table 4.7. The correlations have reduced dramatically, some becoming negative, and since we only have 5 bones with which to correlate, this is likely to reflect the absence of a real underlying correlation between the BMD values and the scoring system produced by Geraets et al. when applied to images filtered of noise. This is likely also to apply to the Geraets et CHAPTER 5. DISCUSSION 85 (a) Bone150 (b) Bone153 (c) Bone155 (d) Bone162 (e) Bone163 Figure 5.2: Unfiltered ROIs Binarized at mode CHAPTER 5. DISCUSSION (a) Skeletonized inverted image of bone 150 (b) Skeletonized inverted image of bone 162 Figure 5.3: The skeletonized images superimposed onto greyscales of ROIs, without filtering 86 CHAPTER 5. DISCUSSION (a) Skeletonized inverted image of bone 162 (b) As above having first been mean filtered with 9 × 9 mask Figure 5.4: Effect of mean filtering on the skeletonization of Bone 162 ROI 87 CHAPTER 5. DISCUSSION 88 Figure 5.5: Example of skeletonization of filtered ROI published by Geraets et al. [19] (at same scale as preceeding figures) al. parameters not repeated here, like region count and circumference of regions, since these are also heavily dependent on the quantum noise. Origin of the noise To investigate the origin of the noise on the binarised images, we can look closely at subregions of the ROIs. Figure 5.6 shows enlargements of 2.5 × 2.5mm pixel areas of the bones, with brightness levels normalised to 128, for visual comparison. It is clear that there is a speckling present in all of the bone images (noise), but that the range of values from the trabecular pattern (signal) is much narrower for the thicker bones. Figure 5.7 shows the PDF plots of the whole unprocessed ROIs. Bone 162, the densest bone can be seen to have a much narrower range of values than the less dense bones, with bone 163 having a range somewhere in between. It is important to remember that we are dealing with the unprocessed histograms—i.e. they have not been stretched to the equivalent thickness values. Assuming the speckling to be mainly due to quantum mottle, we know that the CHAPTER 5. DISCUSSION 89 (a) Bone 150 (b) Bone 153 (c) Bone 155 (d) Bone 162 (e) Bone 163 Figure 5.6: Zoom of a 100 × 100 pixel (2.5 × 2.5mm) area of unfiltered ROIs 90 0.05 0.05 0.04 0.04 Probability Probability CHAPTER 5. DISCUSSION 0.03 0.02 0.01 0.03 0.02 0.01 0 0 0 50 100 150 200 250 0 50 Pixel Value 200 250 200 250 (b) Bone 153 0.05 0.04 0.04 Probability 0.05 0.03 0.02 0.01 0.03 0.02 0.01 0 0 0 50 100 150 200 250 Pixel Value 0 50 100 (d) Bone 162 0.05 0.04 0.03 0.02 0.01 0 0 50 100 150 150 Pixel Value (c) Bone 155 Probability 150 Pixel Value (a) Bone 150 Probability 100 200 250 Pixel Value (e) Bone 163 Figure 5.7: PDF plots of unprocessed ROIs CHAPTER 5. DISCUSSION 91 quantum mottle is a function of film exposure [33]: Quantum mottle ∼ √ 1 Exposure We also know that the film exposures used are more or less constant since the resulting average film optical densities are within a narrow band (table 4.4 on page 67). Therefore we can assume the effects of quantum mottle to be reasonably constant throughout. Assuming a constant noise level but a signal level that varies from bone to bone, the signal to noise ratio is less for the denser bones and by binarizing at the modal value, we will produce a more noisy image. Noise will only appear if the noise amplitude causes the pixel values to cross the binarisation threshold. A higher signal value range means that more of the pixels are further away from this binarization threshold, making this less likely. The histogram stretching has no effect on this problem, since the noise and signal are both scaled by equal amounts. The reason we are considering the original unstretched histograms, is that we are assuming the noise to be approximately constant, so that the histogram width gives an indication of the signal to noise ratio. The wider the histogram, the greater the SNR. The noise will have a dramatic effect upon the skeletonized image unless removed by a large filter mask, and will cause a high correlation with the BMD which is not due to the trabecular structure information of the ROIs. 5.3.3 PDF Histogram width variation The variation of the width of the histograms explains the correlations found with the Geraets et al. scores when using an insufficiently large filtering mask. We are still left with the problem of explaining why the histogram is smaller for the wider bones. Saturation or underexposure of the film would narrow the histogram, but the average optical density values are well within the linear portion of the characteristic curve, so this is very unlikely. The effect must therefore relate to the physical structure of the bones, and not the exposure of the film. Two possible physical explanations for the narrowing of the histogram are: 1. There is a different trabecular structure, and the narrower pixel value range reflects the narrower range of trabecular bone thicknesses 2. There is a change in the attenuation characteristics of the x-rays by the bone due to beam hardening. CHAPTER 5. DISCUSSION 92 Say we have a thickness of bone T , a thickness variation due to the trabecular structure ∆T and a variation in observed optical density ∆D due to the trabecular structure. Then ∆D is effectively the width of the histogram of the ROI. Considereing the first possibility, since ∆D is caused by ∆T , clearly our observed ∆D will increase as ∆T increases. If this were the cause of the changes in ∆D, it would suggest that useful information about the trabecular structure is contained within the histogram. From the pixel re-mapping, we have some crude idea of the relative values of ∆T . Correlations with the bone scores are very low, all less than 0.205 in magnitude (see table 4.10 on page 74). This suggests that there is either no relationship between the ∆T values and structure (which seems unlikely), or that the method we are using to calculate ∆T from the observed ∆D is unreliable. A continuous wedge and pixel to pixel re-mapping would provide a more reliable method along with calculation of the standard deviation of the pixel values rather than the range between extremes. This possibility can be validated with the current data, and should be investigated in the future. For second possibility, an effect which we know is very likely to be occurring is beam hardening (page 25). X-rays which have passed through more bone will reflect the thickness changes to a lesser degree. i.e. the observed ∆D (histogram width) will decrease as T increases. If this is the case then (for a constant noise level) signal to noise ratio (SNR) would be inversely proportional to bone thickness T . Since BMD is simply way of quantifying the T , we would therefore expect to see a very high correlation between SNR dependent scores and the BMD. This is supported by the findings of the present study in table 4.6. These two effects are not separable without structural information in the direction of the beam. This could be obtained by x-raying the slices along the direction of the bone, and would enable the contributions of these effects to be measured. It would also enable the origin of the radiographic trabecular pattern to be accurately determined—an essential piece of information for any image processing scores to be related to their physiological origins. 5.4 New analysis techniques 5.4.1 Failed scores Two of the analysis techniques earlier described were abandonned without useful results. The fractal dimension analysis of the fork points gave identical results for each of the bones, and so are not included. The failure was almost certainly due to an insuficient number of fork points being present on the image. It may be possible to work with a larger dataset, for example using all the points on the thinned image CHAPTER 5. DISCUSSION 93 in future. The binary region measures were considered to be too critical on the arbitary offset of binarization threshold level and were abandoned. In the future, binarisation at the modal threshold and then opening or erosion may produce useful results. 5.4.2 SNR dependence The original aim of the present study was to develop a quantitative measure relating to the trabecular structure derived from the radiographic trabecular pattern. It is clear from the high correlations between the BMD measurements and the trabecular structure scores derived from the appearance of the slices (not image processing scores) that for the limited sample of 5 bones used in the study, trabecular structure changes are closely related to BMD. This makes the separation of trabecular structure information from BMD using the radiographic trabecular pattern extremely difficult, since we believe the radiographic trabecular pattern to be significantly influenced by the histogram narrowing caused by the BMD. 5.4.3 Fourier Transform Techniques Of the image processing measures applied during the project, it is considered that the Fourier transform techniques are likely to be the most independent of SNR. Due to the nature of the derivation of the angle wedge plots (section 3.3) integration is carried out only between specifically chosen frequency ranges—chosen to co-incide with the trabecular spatial frequency. Quantum mottle is a frequency independent noise, or white noise effect. Although the range of frequencies chosen will still include noise, the SNR ratio is likely to be much higher than for other frequency ranges. Another strong point in favour of the Fourier transform technique is that it is being used to pick out the dominant angles, and to compare the spread of these angles. Random noise such as quantum mottle will be angle independent, and should only raise the baseline of the angle wedge plots, not alter the parameters such as the width of the peak (FWQM, FWHM and FWTM) or the dominant angle. While finding the dominant angle of the trabeculae is useful for rotating the original x-ray images, alone it is of no value in analysing the pattern. By splitting the ROI into 4 equal squares, and finding the dominant angle for each quarter, we can analyse the spatial variation of the trabecular direction. From the effects mentioned in section 5.2.4 we would expect this to be small for weaker bones, as trabeculae in directions other than the most structurally important are lost. This is borne out by the results of the SPLANGSD parameter (the standard deviation of the dominant angles for each quarter). SPLANGSD gives a high cor- CHAPTER 5. DISCUSSION 94 relation with the BMD and slice scores shown in table 4.8 on page 73. This is an important result, for the implication is that we have a SNR independant structural measure. The physiological significance of this measure cannot be predicted from the current data. The peak width parameters for the angle wedge plots of the whole ROI show no correlations with the BMD or slice score measures. This is a little worrying, since a spatial variation in the trabecular direction would be expected to result in a wider peak. The method of peak width determination is by no means the most reliable. It is suggested that this is possibly not the way to proceed for the angle measures. A potentially more reliable measure may be derived from calculation of the angles of lines within the filtered thinned image (see section 6). The SPLANGSD measure may be giving an indication of changes in the trabecular structure, and is likely to be a better measure than those used by Geraets et al. , but the current study has insufficient data to determine this conclusively. The highest correlation is also with the BMD, which may indicate that the SNR is again distorting the results. 5.4.4 Filtered Skeletonization Techniques While the mean filtered image no longer gives high correlations with the BMD and section scores for the parameters proposed by Geraets et al. [19], the skeleton images do contain the structural information we are looking for (appendix D shows the skeletonized images for all the bones). The parameters derived from the line lengths after the removal of the fork regions have very promising correlations with the bone section scores. The LINELEN parameter (see pages 60 and 73) gives the mean length of these lines. It has high positive correlations with most of the the scores, but it is the trabthk score with which it has the highest correlation (of 0.953). This is very important since it is much higher than the detbmd correlation of 0.720, which suggests that the LINELEN parameter may be returning a structural measure which is more closely related to the trabecular thickness than the overall BMD. Chapter 6 Recommendations for the future There are many ways the project can be taken forward. This sections contains just a few suggestions. 6.1 With the current material 1. The x-rays should be re-scanned at 40µm pixel resolution, and the analysis re-performed, to fully evaluate the effect of noise on the results of previous publications by Geraets et al. 2. The effects of using different sizes of filter mask should be investigated, to find the best compromise between noise removal and preservation of structural information. Filters based on Fourier transforms, e.g. the Butterworth filter may work better than the square masks, especially for the removal of low frequency information. 3. The effect of quantum noise has been shown to be an extremely important factor present in the radiographic trabecular pattern. The algorithms used should be tested on phantoms with varying levels of noise, to test the degree to which the scores reflect this. 4. A relatively simple method for objectively scoring the bone slices for structure would be to x-ray them flat, i.e. with the beam along the direction of the bone. The x-ray image could then be digitised, and analysed by computer. This would reduce the variability introduced by the subjective scores used in the present study. Trabecular density scores could be related to position within the slice, and it may be possible to perform an ‘inverse CT’ to locate the origin of the radiographic trabecular pattern. 95 CHAPTER 6. RECOMMENDATIONS FOR THE FUTURE 96 6.2 For future bone scans 1. A smoothly graded linear wedge of greater thickness should be used in future. Ideally this would be made from a material directly equivalent to bone but aluminium is probably sufficient. This would very easily allow the conversion of greyscale values into bone thicknesses (provided no soft tissue were present) 2. Real tissue equivalents (e.g. chicken) could be used to surround excised bones, and the effects quantified with different thicknesses. X-rays should also be taken using normal exposure parameters and with the film intensifier screen present. The current study requires this to be carried out to confirm that the results are clinically useful. 3. It should be possible to take two planar x-rays at differing energies, and effectively perform a DEXA scan. A dual material phantom would be needed made of overlayed wedges of aluminium and perspex (as available from Norland Inc.) to monitor drift in machine x-ray energies. 4. In clinical use, we would not be able to repeatedly re-scan the patient until the film exposure for the region of interest was correct. Errors are likely to result in compression of the histogram as the exposure range moves into the non-linear sections of the characteristic curve. If possible a film with a large dynamic range would minimise this problem. Alternatively, a electronic detector with a more linear response could be used, and this would also avoid the separate film digitization process. Suitable devices with sufficiently high resolution are currently under development (personal conversation with R.Finn). 5. The low frequency information was discarded from the images during the pre-processing, since we were investigating changes on the trabecular scale. This information may turn out to be useful in determining measures such as cortex uniformity. This would also need to be measured in conjunction with soft tissue, to confirm that the soft tissue did not unreasonably distort the results. 6. The methods used to obtain the internal bone structure were destructive and potentially inaccurate. It is difficult to relate an exact position on the slice to a position on the x-ray image. It would be well worth persuing 3D volume data acquisition techniques such as Micro-CT or MRI. It would be worth pursuing small bore MRI, possibly with higher field strengths of ∼8T. Imperial’s small CHAPTER 6. RECOMMENDATIONS FOR THE FUTURE 97 bore MRI scanner should be able to pick up gross changes in the trabecular structure. 6.3 Improvements in the methods 1. One major problem with continuation is the delay due to the digitization process. It may be possible to speed this by taking direct contact (positive) prints and using a hi-res flatbed scanner. If the scanning resolution is too low, optical enlargement could be used. This is unlikely to be a problem since we have had to low pass filter the image, indicating that the resolutions used in the present study are unnecessarily high. 2. There are very many ways in which image processing scores could be developed. In the future analysis of the angles of the skeleton image lines could be performed, possibly weighted by line length and analysis of line curvature. Greyscale analyses could be further developed, but the pixel remapping would have to be addressed first. There are very many ways to proceed. 3. For further studies, very many bones with approximately equal BMD but varying structure would be useful to help separate the structural and density effects. Structural information can then be used to give more information by combining this with density scores. Once the results have been confirmed as clinically relevant, application should be made for ethical committee clearance to perform x-rays of the radii of women before, during, and after the menopause. This would enable the tracking of the pattern over the progression of osteopenia. 4. Both BMD and structure are separate ways of measuring the progression of osteopenia, and the final test is the ability to predict the strength and fracture risk of the bone. Given enough bones, destructive testing could be carried out to provide fracture risk measures. This is difficult to perform with real patients due to uncontrolled causes of fracture. Chapter 7 Conclusion Geraets et al. have produced a set of computerised image analysis scores which give high correlations with the BMD values of the bones. The method of operation of these scores is dependent on the signal to noise ratio (SNR) in the ROI being tested. The SNR is, in turn, very dependent on BMD due to beam-hardening effects and quantum mottle. The high correlations between these scores and the BMD values are likely to be due to the SNR and not due to changes in the trabecular structure. This is supported by the finding that the BMD values correlate better than the structural scores obtained by bone slicing. Working with an ROI that has been much more heavily filtered to remove noise gives an image which can clearly be seen to correspond to the radiographic trabecular pattern. When applied to this image, the scoring algorithms used by Geraets et al. produce no significant correlations with either the BMD or with the structural scores obtained by bone slicing. Two new image processing scores, SPLANGSD and LINELEN, developed in the present study produce high correlations with both the BMD and the structural scores obtained by bone slicing. For LINELEN, the correlation with a particular structural score, trabecular thickness, is significantly greater than the correlation with BMD, suggesting that this measure is analysing the structure of the trabeculae rather than the bone density. This fulfills the main objective of the project, and warrants further investigation with a greater sample size and other structural assessment scores. Combining this promising score with information on the origin of the radiographic trabecular pattern is likely to indicate many ways of refining the analysis to give physiologically useful parameters which may help predict the development of osteoporosis using planar x-ray radiographs. Such a method may obviate the need for expensive BMD scanners, and may in fact give more useful, or at least complamentary information. 98 CHAPTER 7. CONCLUSION 99 The results of the present study could not be more encouraging, and there are very many avenues open for future work. Appendix A Full Digitized X-ray images The following pages show the digitized x-rays of the bones produced by the mammography scanner at 36kV, at exposures given on page 35. They are all shown at exactly 4 times actual size. 100 Figure A.1: Original (inverted) X-ray of Bone 150 APPENDIX A. FULL DIGITIZED X-RAY IMAGES 101 Figure A.2: Original (inverted) X-ray of Bone 153 APPENDIX A. FULL DIGITIZED X-RAY IMAGES 102 Figure A.3: Original (inverted) X-ray of Bone 155 APPENDIX A. FULL DIGITIZED X-RAY IMAGES 103 Figure A.4: Original (inverted) X-ray of Bone 162 APPENDIX A. FULL DIGITIZED X-RAY IMAGES 104 Figure A.5: Original (inverted) X-ray of Bone 163 APPENDIX A. FULL DIGITIZED X-RAY IMAGES 105 Appendix B Calibration wedges 106 APPENDIX B. CALIBRATION WEDGES 107 250 Greyscale value 200 150 100 0 degrees 10 degrees -10 degrees 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure B.1: Bone 150 calibration wedge Greylevel values 0 APPENDIX B. CALIBRATION WEDGES 108 250 Greyscale value 200 150 100 0 degrees 10 degrees -10 degrees 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure B.2: Bone 153 calibration wedge Greylevel values 0 APPENDIX B. CALIBRATION WEDGES 109 250 Greyscale value 200 150 100 0 degrees 10 degrees -10 degrees 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure B.3: Bone 155 calibration wedge Greylevel values 0 APPENDIX B. CALIBRATION WEDGES 110 250 Greyscale value 200 0 degrees 10 degrees -10 degrees 150 100 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure B.4: Bone 162 calibration wedge Greylevel values 0 APPENDIX B. CALIBRATION WEDGES 111 250 Greyscale value 200 0 degrees 10 degrees -10 degrees 150 100 50 0 8 7 6 5 4 3 2 1 Thickess of aluminium (layers) Figure B.5: Bone 163 calibration wedge Greylevel values 0 Appendix C Preprocessed Regions of Interest 112 APPENDIX C. PREPROCESSED REGIONS OF INTEREST (a) Bone150 (b) Bone153 (c) Bone155 (d) Bone162 (e) Bone163 Figure C.1: Pre-processed ROIs of rotated bones 113 Appendix D Skeletonized images This appendix contains images of the inverted, binarized, skeletonized images, with the lines running along the trabeculae. 114 APPENDIX D. SKELETONIZED IMAGES 115 (a) Bone 150 (b) Bone 153 (c) Bone 155 (d) Bone 162 (e) Bone 163 Figure D.1: Bone 163 filtered, skeletonized ROIs binarized at mode Appendix E FFT Angle Plots 116 APPENDIX E. FFT ANGLE PLOTS 117 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure E.1: Bone 150 FFT angle wedge plot 180 APPENDIX E. FFT ANGLE PLOTS 118 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure E.2: Bone 153 FFT angle wedge plot 180 APPENDIX E. FFT ANGLE PLOTS 119 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure E.3: Bone 155 FFT angle wedge plot 180 APPENDIX E. FFT ANGLE PLOTS 120 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure E.4: Bone 162 FFT angle wedge plot 180 APPENDIX E. FFT ANGLE PLOTS 121 2500 Value 2000 1500 1000 500 0 0 45 90 135 Angle (anticlockwise from horizontal) Figure E.5: Bone 163 FFT angle wedge plot 180 Appendix F Section Marking instructions 122 APPENDIX F. SECTION MARKING INSTRUCTIONS Figure F.1: Section Marking instructions – Page 1 123 APPENDIX F. SECTION MARKING INSTRUCTIONS Figure F.2: Section Marking instructions – Page 2 124 Appendix G Program Listings This section contains a listing of some of the functions written by the author and incorporated into MIDAS for processing the images. G.1 Segmentation by Connected Components Image ∗ segment(Image ∗ src im, int minsize) /∗ Segment image into separate regions of size above minsize using connected components. Returns an image in which each region is numbered with unique consecutive integers. Mark Dayel 7/96 ∗/ { Image ∗dst im; /∗ destination image pointer ∗/ int err=0; /∗ no errors yet... ∗/ int x,y,xmin,xmax,ymin,ymax; /∗ the image co-ordinates ∗/ int i,j; /∗ the relative offset co-ordiantes ∗/ int offset; /∗ offset position for image y position ∗/ int maxval; /∗ local maximum value ∗/ int changes,maxchanges; /∗ keeping track of the progress ∗/ int percentdone,biggestpercentdone; /∗ displayed progress ∗/ int count; /∗ initial numbering of pixels ∗/ int recount; /∗ re-numbering of pixels ∗/ float prefix[100]; MIcon ∗icon; 125 APPENDIX G. PROGRAM LISTINGS 126 char hinfo[500]; int dim[2]; float gx,gy,w[9],sumw,sumval,n,nsq; int ∗∗label; int ∗vector; int ∗regionsize; int ∗renumto; xmax = (src im→size[0]); ymax = (src im→size[1]); dst im=MCopyImage(src im); if (!dst im) { return NULL;}; sprintf(prefix,"SegmentMin%d",minsize); err=MBracketTitle(dst im,prefix); if (err) {MError(err); return NULL;} vector = (int∗) calloc( (xmax+3) ∗ (ymax+3) , sizeof(int) ); /∗ plus 3 because of padding ∗/ label = (int∗∗) calloc( (ymax+3) , sizeof(int∗) ); for (i = 0; i < (ymax+3); i++) label[i] = vector + i ∗ (xmax+3); count=1; /∗ label all the non-zero points ∗/ for(y = 0; y < ymax; y++) { offset= y ∗ xmax; for(x = 0; x < xmax; x++) if (src im→floatdata.ptr[(offset+x)]) label[x+1][y+1]=count++; } regionsize = (int∗) (calloc(count , sizeof(int))); APPENDIX G. PROGRAM LISTINGS 127 maxchanges=1000; biggestpercentdone=0; /∗ spread the max values ∗/ do { changes=0; /∗ zero changes count ∗/ for(y = 0; y < ymax; y++) /∗ loop over the image ∗/ { for(x = 0; x < xmax; x++) if (label[x+1][y+1]) /∗ is the pixel non-zero? ∗/ { maxval=0; for(i=−1; i≤1; i++) /∗ look at the adjacent pixels ∗/ { for(j=−1; j≤1; j++) { /∗ find the maximum value ∗/ if (label[x+j+1][y+i+1] > maxval) maxval = label[x+j+1][y+i+1]; } } if (maxval>label[x+1][y+1]) /∗ if adjacent pixels have a higher value ∗/ { label[x+1][y+1]=maxval; /∗ set this pixel value to it ∗/ changes++; } /∗ count the number of changes made ∗/ } } if (changes > maxchanges) maxchanges = changes; } while (changes>0); /∗ until no more changes are made ∗/ /∗ find the region sizes ∗/ for(y = 0; y < ymax; y++) { for(x = 0; x < xmax; x++) regionsize[(label[x+1][y+1])]++; APPENDIX G. PROGRAM LISTINGS 128 } /∗ re-number the regions ∗/ renumto = (int∗) (calloc(count , sizeof(int))); recount=−1; for( y = 0; y < ymax ; y++ ) /∗ loop over the image ∗/ { for( x = 0; x < xmax ; x++ ) { if (label[x+1][y+1]) /∗ if the pixel isn’t blank ∗/ { if (regionsize[(label[x+1][y+1])] ≥ minsize) { if ( !renumto[ (label[x+1][y+1]) ] ) /∗ do we have a lookup value? ∗/ renumto[(label[x+1][y+1])]= recount−−; /∗ no - then make one ∗/ } } label[x+1][y+1]=renumto[(label[x+1][y+1])]; /∗ renumber the pixel ∗/ } else label[x+1][y+1]=0; } MPrint("Image %s\nTotal number of regions: %d\n\n", src im→title, count); /∗ return the matrix to the destination image ∗/ for(y = 0; y < ymax; y++) { } offset= y ∗ xmax; for(x = 0; x < xmax; x++) dst im→floatdata.ptr[(offset+x)] = − label[x+1][y+1]; /∗∗ Add history ∗∗/ icon=MMakeIcon(dst im, dst im→title, −1, −1, &err); if(icon==(MIcon ∗)0) err=ERR IMP; if(err) { MError(err); return NULL; } sprintf(hinfo, "Segmented into %d regions of %d pixels or larger.", count, minsize); APPENDIX G. PROGRAM LISTINGS err=MAddToHistory(dst im, &icon, 1, hinfo); if(err) {MError(err); return NULL; } free(label); free(renumto); return dst im; } 129 APPENDIX G. PROGRAM LISTINGS G.2 Angle wedge plot t /∗ angle wedge plot ∗/ Image ∗ fftangleplot2(Image ∗ image) {/∗ Mark Dayel 8/96 ∗/ Image ∗fftanglewedgeplot; int n, total pels, dim[2], pels, err=ERR NON; float ∗ptr, r, b1, b2, b5, bsize, max, divisor ; float angle, xgrad, ygrad, sumk, meank; MBitStream bs; MIcon ∗icon; int region , maxregion, biggestregion, i, j, x, y, offset, xmax, ymax, bin, binsize; int maxvalue, freq, fmax, fmin, fnow; float value; int ∗regionsize, ∗size; float radius, radmin, radmax, radstep, anglestep, anglemax, anglemin, curangle; float minval, maxval, fftanglepolar, wheight, lefthalfangle, righthalfangle; float fwhm, fwtqm, fwqm; float midpeakhalf, midpeaktq, midpeakq; float val90deg,mean,sum; FILE ∗fp; double const pi=3.14159265; fmin=0; fmax=100; radmin=25; radmax=100; radstep=0.5; binsize=10; 130 APPENDIX G. PROGRAM LISTINGS 131 anglestep=0.05; anglemin=0; anglemax=180; xmax = (image→size[0]); ymax = (image→size[1]); radmax=(xmax/2); /∗ find the maximum image value number ∗/ maxvalue=0; for(y = 0; y < ymax; y++) { offset= y ∗ xmax; for(x = 0; x < xmax; x++) if (image→floatdata.ptr[(offset+x)] > maxvalue ) maxvalue = image→floatdata.ptr[(offset+x)]; } /∗∗ Create the fftanglewedgeplot image ∗∗/ dim[0]=180; if ((fftanglewedgeplot = MMakeEmptyImage(image→title, dim, 1, Float)) == (Image∗) 0) return NULL; if (err=MBracketTitle(fftanglewedgeplot,"fftAngleWedgePlot")) {MFreeImage(image);MFreeImage(fftanglewedgeplot); return NULL;} for (curangle=0; curangle < 180; curangle++ ) { anglemin=curangle−2; anglemax=curangle+2; value=0; APPENDIX G. PROGRAM LISTINGS 132 for (radius=radmin; radius < radmax; radius+=radstep) { freq=(int)radius; for (angle=anglemin; angle < anglemax ; angle+=anglestep) { xgrad=cos((angle∗pi)/180); ygrad=sin((angle∗pi)/180); x=(xmax/2)+freq∗xgrad; y=(ymax/2)+freq∗ygrad; value+=(image→floatdata.ptr[((y∗xmax)+x)]∗anglestep∗radstep)/ (anglemax−anglemin); } } /∗ scale by multiplying by the frequency ∗/ fftanglewedgeplot→floatdata.ptr[(int)curangle]+=value∗freq; } minval=9999999999; maxval=0; for (angle=0; angle < 180 ; angle++) { if (fftanglewedgeplot→floatdata.ptr[(int)(angle)] > maxval) { maxval = fftanglewedgeplot→floatdata.ptr[(int)(angle)]; anglemax = angle; } if (fftanglewedgeplot→floatdata.ptr[(int)(angle)] < minval) { minval = fftanglewedgeplot→floatdata.ptr[(int)(angle)]; anglemin=angle; } } /∗MPrint(”Maximum value: %d\nMinimum value: %d\n\n”,maxval,minval);∗/ APPENDIX G. PROGRAM LISTINGS 133 /∗ half-maximum ∗/ wheight=((maxval−minval)/2) + minval; lefthalfangle=−1; righthalfangle=−1; for (angle=0; angle < 180 ; angle++) if ( (lefthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) lefthalfangle = angle; for (angle=179; angle ≥0 ; angle−−) if ( (righthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) righthalfangle = angle; fwhm=righthalfangle−lefthalfangle; midpeakhalf=( (righthalfangle−lefthalfangle)/2 + lefthalfangle); /∗ 3/4 maximum ∗/ wheight=(3∗(maxval−minval)/4) + minval; lefthalfangle=−1; righthalfangle=−1; for (angle=0; angle < 180 ; angle++) if ( (lefthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) lefthalfangle = angle; for (angle=179; angle ≥0 ; angle−−) if ( (righthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) righthalfangle = angle; fwtqm=righthalfangle−lefthalfangle; midpeaktq=( (righthalfangle−lefthalfangle)/2 + lefthalfangle); APPENDIX G. PROGRAM LISTINGS 134 /∗ 1/4 maximum ∗/ wheight=((maxval−minval)/4) + minval; lefthalfangle=−1; righthalfangle=−1; for (angle=0; angle < 180 ; angle++) if ( (lefthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) lefthalfangle = angle; for (angle=179; angle ≥0 ; angle−−) if ( (righthalfangle==−1) && ( fftanglewedgeplot→floatdata.ptr[(int)(angle)] > wheight ) ) righthalfangle = angle; fwqm=righthalfangle−lefthalfangle; midpeakq=( (righthalfangle−lefthalfangle)/2 + lefthalfangle); /∗ get the value 90 deg away from peak ∗/ /∗ ( adds 270 to mean peak angle and takes mod 180) ∗/ val90deg= fftanglewedgeplot→floatdata.ptr[(int) ( ( ( (int) (midpeakhalf + midpeaktq + midpeakq)/3) + 270 ) % 180)]; /∗ get the mean ∗/ for (angle=0,sum=0; angle < 180 ; angle++) sum+= fftanglewedgeplot→floatdata.ptr[(int)(angle)]; mean=sum/180; fp = fopen ("/usr/users/msc/96/md6/matlab/output.log", "a"); if (fp == (FILE ∗)0) return; fprintf(fp,"%s ",image→title); APPENDIX G. PROGRAM LISTINGS 135 fprintf(fp,"%d %d %d %d %3.1f %3.1f %3.1f %3.2f %3.2f\n", (int)anglemax, (int)fwqm, (int)fwhm, (int)fwtqm, midpeaktq, midpeakhalf, midpeakq, mean, val90deg); fclose(fp); MPrint("Image: %s\n", image→title); MPrint("Maximum value at %d deg\n",(int)anglemax); MPrint("Full width 1/4 maximum: %d deg\n",(int)fwqm); MPrint("Full width half maximum: %d deg\n",(int)fwhm); MPrint("Full width 3/4 maximum: %d deg\n",(int)fwtqm); MPrint("Mid-peak 1/4 height angle: %3.1f deg\n", midpeaktq ); MPrint("Mid-peak half height angle: %3.1f deg\n", midpeakhalf ); MPrint("Mid-peak 3/4 height angle: %3.1f deg\n", midpeakq ); MPrint("Mean Mid-peak angle: %3.2f deg \n\n", (midpeakhalf + midpeaktq + midpeakq)/3); MPrint("Mean value %3.2f\n", mean ); MPrint("Value at 90 deg from peak %3.2f\n", val90deg ); fp = fopen ("/usr/users/msc/96/md6/matlab/anglewedge.log", "a"); if (fp == (FILE ∗)0) return; fprintf(fp,"%s ",image→title); for (angle=0; angle<180 ; angle++) fprintf(fp,"%f ",fftanglewedgeplot→floatdata.ptr[(int)(angle)]); fprintf(fp,"\n"); fclose(fp); /∗∗ Label axes then add to bank ∗∗/ if (err=MPutStrField(&fftanglewedgeplot→flex,"MiYlabel","Sum")) {MFreeImage(fftanglewedgeplot); MFreeImage(image);return NULL;} if (err=MPutStrField(&fftanglewedgeplot→flex,"MiXlabel","Angle")) {MFreeImage(fftanglewedgeplot); MFreeImage(image);return NULL;} APPENDIX G. PROGRAM LISTINGS 136 /∗∗ Copy relevant flex data ∗∗/ if (err=MCopyData (fftanglewedgeplot, image)) {MFreeImage(fftanglewedgeplot); MFreeImage(image);return NULL;} /∗∗ Add this operation to image history ∗∗/ if ((icon=MMakeIcon(fftanglewedgeplot, fftanglewedgeplot→title, −1, −1, &err))==(MIcon∗)0) return NULL; if (err=MAddToHistory(fftanglewedgeplot, &icon, 1, "FFTAngleWedgePlot applied to image: %s", image→title)) return NULL; return fftanglewedgeplot; } APPENDIX G. PROGRAM LISTINGS G.3 137 Fracal analysis of fork points int comparex(void ∗ a,void ∗b) { /∗ qsort function for markfract Called by the sorting function. Only compares the integer at the pointer, i.e. the x co-ordinate. ∗/ int p = ∗((int∗)a); int q = ∗((int∗)b); if (p < q) return 1; if (p > q) return −1; return 0; } void markfract(Image∗ src im) { /∗ Produces the data required for calculating fractal dimensions. Calculates the sum of the number of node points within squares of a particular size, centered on each node point. This is repeated for each square side length from 3 up to twice the image size (when all the point must be contained), stopping if all points are contained sooner. Output is sent to screen and file. The source image is the image produced by the above But markfpoints procedure. Mark Dayel 9/96 ∗/ int x,y,xmax,ymax; int ∗nodes; APPENDIX G. PROGRAM LISTINGS int dim[2]; int offset, pos; int count; int i,j; FILE ∗fp; int size; int curcount; int ∗nodesortx,∗nodesorty; int ∗nodex,∗nodey; xmax = (src im→size[0]); ymax = (src im→size[1]); /∗ count the no. of nodes ∗/ count=0; for(y = 0; y < ymax; y++) { offset= y ∗ xmax; for(x = 0; x < xmax; x++) if(src im→floatdata.ptr[offset+x]>128) count++; } MPrint("%d points\n",count); /∗ Allocate arrays for co-ordinates and for the node count ∗/ nodesortx = (int∗) (calloc(count +1 , 2∗sizeof(int))); nodes = (int∗) (calloc(xmax +1 , sizeof(int))); /∗ Put the node co-ordinates into the array ∗/ 138 APPENDIX G. PROGRAM LISTINGS i=0; for(y = 0; y < ymax; y++) { offset= y ∗ xmax; for(x = 0; x < xmax; x++) if(src im→floatdata.ptr[offset+x]>128) { nodesortx[(i∗2) ]=x; /∗ x co-ord in even indices ∗/ nodesortx[(i∗2)+1]=y; /∗ y co-ord in odd indices ∗/ i++; } } /∗ Sort by x co-ord value. Note: a single sort element is 2 ints – to include x and y co-ord pair. See comparex() above ∗/ qsort (nodesortx, count , 2∗sizeof(int), comparex); /∗ loop over all square sizes – square side length is (2∗size)+1 ∗/ for (size=1;size≤xmax;size++) { /∗ loop over all the nodes ∗/ for (i=0; i<count ;i++) { /∗ find the first node having x within size of i th node ∗/ j=−1; do j++; while ((nodesortx[j∗2] < (nodesortx[i∗2] − size)) && (j≤count)); j−−; 139 APPENDIX G. PROGRAM LISTINGS 140 /∗ go through nodes until last node having x within size of i th node ∗/ do { j++; if (abs((nodesortx[(j∗2)+1]−(nodesortx[(i∗2)+1])))≤size) /∗ is the y within size? ∗/ nodes[size]++; /∗ then add one to the corresponding node count ∗/ } while ((nodesortx[j∗2] ≤ (nodesortx[i∗2] + size)) && (j<(count−1))); } /∗ echo to screen ∗/ MPrint("Size: %d Nodes:%d\n",size,nodes[size]); if (nodes[size]==((count)∗(count))) /∗ have all nodes been counted? ∗/ { MPrint("All points done.\n\n"); break; } } for (size=1;size≤xmax;size++) { if (nodes[size]==0) nodes[size]=(count)∗(count); /∗ set the remainder to max ∗/ } /∗ send the output to the log file ∗/ fp = fopen ("/usr/users/msc/96/md6/matlab/frac.log", "a"); if (fp == (FILE ∗)0) return; fprintf(fp,"%s\n",(src im)→title); for (size=1;size≤xmax;size++) { fprintf(fp,"%d\n",nodes[size]); } fprintf(fp,"\n"); APPENDIX G. PROGRAM LISTINGS fclose(fp); /∗ free the memory ∗/ free(nodes); free(nodesortx); return; } 141 APPENDIX G. PROGRAM LISTINGS G.4 Fork point extraction int But markfpoints(int dum) { /∗ Routine expects to be given a thinned image, and produces an image containing a bright point for each fork in this image ∗/ /∗ Mark Dayel 9/96 ∗/ Image ∗src im, ∗dst im, ∗tmp im1, ∗tmp im2, ∗tmp im3; int err=0; int nodes; int connectedness; int xmax,ymax,numpels,i; int count; FILE ∗fp; MWorking(ON); /∗ get source image ∗/ src im = MGetHighlightedImage(VALID 2D|ALL SHAPES,Float,&err); if (err) {MError(err); return err;} xmax = (src im→size[0]); ymax = (src im→size[1]); numpels=xmax∗ymax; /∗ find the fork regions ∗/ tmp im1 = markforks(src im); /∗ number the regions using segment() ∗/ tmp im2 = segment(tmp im1,0); /∗ find the centre pixels of each region ∗/ dst im = markcenter(tmp im2); /∗ combine these fork points with the original thinned image... ∗/ tmp im3 = markadd2im(src im,dst im); 142 APPENDIX G. PROGRAM LISTINGS 143 /∗ count the total area and number of forks and output to .log file∗/ fp = fopen ("/usr/users/msc/96/md6/matlab/forks.log", "a"); if (fp == (FILE ∗)0) return; /∗ count the area ∗/ for(i=0,count=0;i<numpels;i++) count+= (src im→floatdata.ptr[i]>0); fprintf(fp,"%s %d ",(dst im)→title, count); /∗ count the forks ∗/ for(i=0,count=0;i<numpels;i++) count+= (dst im→floatdata.ptr[i]>128); fprintf(fp,"%d\n", count); fclose(fp); /∗ return the image ∗/ MAddImageToBank(tmp im3); /∗ free memory ∗/ MFreeImage(tmp im1); MFreeImage(src im); MFreeImage(dst im); MFreeImage(tmp im3); MFreeImage(tmp im2); return err; } /∗————————————–∗/ Image ∗ markforks(Image ∗ src im) { /∗ Produces an image of the fork regions. APPENDIX G. PROGRAM LISTINGS 144 Works by selecting all thinned pixels as candidate points from the thinned image, and going around a 5x5 square, centered on this pixel, counting the number of inversions. Counting inversions eliminates problems due to lines of 2 pixel thickness. However thick a line is, it only has two sides, and each inversion counts one side. Points with more than 4 inversions in the square are counted as fork points. This gives regions, rather than points for the forks. ∗/ Image ∗image, ∗dst im; int nodes=0; int dim[2]; int inversions,invstate,pos; int posx[16]= { −2,−1, 0, 1, 2, 2, 2, 2, 2, 1, 0, −1,−2,−2,−2,−2 }; /∗ going round a 5x5 square ∗/ int posy[16]= { −2,−2,−2,−2,−2,−1, 0, 1, 2, 2, 2, 2, 2, 1, 0,−1 }; /∗ clockwise from top left ∗/ int maxpos=15; int x,y,xmax,ymax; int threshold = 1; xmax = (src im→size[0]); ymax = (src im→size[1]); dst im=MCopyImage(src im); if (!dst im) { return NULL;}; MBracketTitle(dst im,"forks"); APPENDIX G. PROGRAM LISTINGS 145 /∗ pad the image – add two black pixels to each edge ∗/ dim[0]=xmax+4; dim[1]=ymax+4; image = MMakeEmptyImage("Temp",dim,2,Float); if (!image) { return NULL;}; for(y = 0; y < ymax; y++) for(x = 0; x < xmax; x++) image → floatdata.ptr[ ((y+2) ∗ (xmax+4) ) + x + 2 ] = src im → floatdata.ptr[ (y∗xmax) + x ]; /∗ count the inversions round the square ... posx[n] and posy[n] are the offsets to give the n th pixel round the square ∗/ for(y = 2; y < ymax+2; y++) for(x = 2; x < xmax+2; x++) if (image→floatdata.ptr[( y ∗(xmax+4))+x ]>threshold) { inversions=0; invstate = ( (image → floatdata.ptr[ (( y + posy[maxpos]) ∗ (xmax+4)) + x + posx[maxpos]]) > threshold); for(pos=0; pos≤maxpos; pos++) { if (((image → floatdata.ptr[(( y+posy[pos])∗(xmax+4)) + x + posx[pos]]) > threshold))=invstate) { invstate = !invstate; inversions++; } } /∗ 4 inversions means two lines going out - any more is a fork point ∗/ dst im→floatdata.ptr[( (y−2) ∗(xmax))+x−2 ] = 255 ∗ (inversions >4 ); } APPENDIX G. PROGRAM LISTINGS /∗ free memory ∗/ MFreeImage(image); /∗ return destination image ∗/ return dst im; } 146 Appendix H Breakdown of Logfile Data The .log files produced by routines produce raw ascii datafiles. The format is the image name at the beginning of a line, followed by a series of space delimited numbers. For files with much data, i.e. variab.log the numbers are separated by carrage returns, to aid importing into other packages. angput.log Summary information from angle wedge plot containing 1. Angle at Maximum value 2. Peak Width at quarter maximum 3. Peak Width at half maximum 4. Peak Width at three-quarter maximum 5. Mid peak angle at quarter maximum 6. Mid peak angle at half maximum 7. Mid peak angle at three-quarter maximum 8. Mean value 9. Value at 90 degrees from peak anglewedge.log Contains the raw angle wedge plot data condirn.log Contains the pixel connectedness for different directions 1. Upper Left 2. Upper Middle 3. Upper Right 4. Middle Right 147 APPENDIX H. BREAKDOWN OF LOGFILE DATA 148 5. Lower Right 6. Lower Middle 7. Lower Left 8. Middle Left variab.log Contains no. of points within each possible 100 × 100 area on the image (very long). Raster scanned. Used for thinned and fork variability measures forks.log Contains Total number of fork points frac.log nth value is the total of the number of fork points within all squares, size length n centred on all fork points. regions.log The sizes of the regions in the binarized image perims.log The perimeter lengths for all the regions circs.log The circularity for all the regions outreg.log Region summary info 1. Biggest Region 2. Total number of regions 3. Mean region size 4. Mean perimeter length 5. Mean circularity thinned.log First 9 values are the 0–8 pixel connectedness for the binarised thinned image, the next 9 are the same for the inverted binarised thinned image. Bibliography [1] R. Bartl and B. Frisch. Biopsy of Bone in Internal Medicine: An Atlas and Sourcebook. Kluwer Academic Publishers, 1993. [2] C.L. Benhamou, E. Lespessailles, and G. Jaquet et al. Fractal organisation of trabecular bone images of calcaneus radiographs. Journal of Bone and Mineral Research, 9, 1994. [3] G.H. Bourne, editor. The Biochemistry and Physiology of Bone, volume 1. Academic Press Inc., 2nd edition, 1972. [4] G.H. Bourne, editor. The Biochemistry and Physiology of Bone, volume 2. Academic Press Inc., 2nd edition, 1972. [5] G.H. Bourne, editor. The Biochemistry and Physiology of Bone, volume 3. Academic Press Inc., 2nd edition, 1972. [6] P. Caligiuri, M.L. Giger, and M. Favus. Computerized radiographic analysis of osteoperosis. Radiology, 186:471–474, 1993. [7] P. Caligiuri, M.L. Giger, and M. Favus. Multifractal radiographic analysis of osteoperosis. Medical Physics, 21, 1994. [8] D.R. Carter, M.L. Bouxsein, and R. Marcus. New approaches for interpreting projected bone densitometry data. Journal of Bone and Mineral Research, 7:137–145, 1992. [9] D.N. Chesney and M.O. Chesney. X-ray Equipment for Student Radiographers. Blackwell Scientific Publications, Oxford, 3nd edition, 1984. [10] E.E. Christensen, T.S. Curry, and J.E. Dowdey. An Introduction to the Physics of Diagnostic Radiology. Lea and Febiger, Philadelphia, 2nd edition, 1978. 149 BIBLIOGRAPHY 150 [11] F. Cosman, B. Herringtom, and Himmelstein. Radiographic absorbtiometry: A simple method for the determination of bone mass. Osteoperosis Int., 2:34– 38, 1991. [12] E. Durand and P. Rüegsegger. High-contrast resolution of computed tomography images for bone structure analysis. Medical Physics, 19, 1992. [13] R. Eastell, B.L. Riggs, and H.W. Wahner et al. Colles’ fracture and bone density of the ultra distal radius. J. Bone Miner Res., 4:607–12, 1989. [14] K.G. Faulkner, C. Gluer, and S. Majumdar et al. Noninvasive measurements of bone mass, structure, and strength: Current methods and experimental techniques. AJR, 157:1229–1237, 1991. [15] B.D. Ferris, L. Klenerman, and R.A. Dodds. Altered organisation of noncollagenous bone matrix in osteoporosis. Bone, 8, 1987. [16] W.G.M. Geraets and P.F. Van der Stelt. Analysis of the radiographic trabecular pattern. Pattern Recognition Letters, 12:575–581, 1991. [17] W.G.M. Geraets, P.F. Van der Stelt, and P.J.M. Elders. Experimentally produced bone lesions. Oral Surgery, 59:306–312, 1985. [18] W.G.M. Geraets, P.F. Van der Stelt, and P.J.M. Elders. The radiographic trabecular pattern during menopause. Bone, 14:859–864, 1993. [19] W.G.M. Geraets, P.F. Van der Stelt, C.J. Netelenbos, and P.J.M. Elders. A new method for automatic recognition of the radiographic trabecular pattern. Journal of Bone and Mineral Research, 5:227–233, 1990. [20] R.C. Gonzalez and R.E. Woods. Digital Image Processing. Addison-Wesley, 1992. [21] A.J Hamer, J.R Strachan, and M.M. Black et al. A new method of comparative bone strength measurement. Journal of Medical Engineering and Technology, 19:1–5, 1995. [22] Tam C.S. Heershe and J.M. Murray, editors. Metabolic bone disease: Cellular and Tissue Mechanics, page 239. CRC Press, 1989. [23] C.M. Korstjens, W.G.M. Geraets, and F.C. Van Ginkel et al. Longitudinal analysis of radiographic trabecular pattern by image processing. Bone, 17:527–532, 1995. BIBLIOGRAPHY 151 [24] R.B. Macess. Fracture risk: a role for compact bone. Calcif. Tissue. Int., 47:191, 1990. [25] B. Martin. Aging and strength of bone as a structural material. Calcified Tissue International, 53(suppl 1):S34–S40, 1993. [26] T.J. Martin, editor. Metabolic Bone Disease, page 103. London: Braillere Tindall, 1988. [27] F.H. Martini. Fundamentals of Anatomy and Physiology. Prentice Hall Inc.,Englewood Cliffs, New Jersey, 3nd edition, 1995. [28] W. Mayo-Smith and D.I. Rosenthal. Radiographic apperance of osteopenia. Radiol. Clin. NorthAmerica, 19:37, 1991. [29] U. Mennen. Bone strength of the radius and ulna in the non-human primate. Orthopedics, 12:173–180, 1989. [30] R. Müller and P. Rüegsegger. Three-dimensional finite element modelling of non-invasively assessed trabecular bone structures. Medical Engineering Physics, 17:126–133, 1995. [31] W.W. Von-Seggen R.A. Schlenker. Distribution of cortical and trabecular bone mass along the length of the radius and ulna and the implications for bone mass measurements. Calcif. Tissue Res, 20:41–52, 1976. [32] B.L. Riggs and L.J Melton. Involutional osteoperosis. The New England Journal of Medicine, pages 1676–1686, 1986. [33] D.P. Roberts and N.L. Smith. Radiographic Imaging – A Practical Approach. Longman Singapore Publishers (Pte) Ltd., 1988. [34] S.F. Schwartz and J.K. Foster. Roentgenographic interpretation of experimentally produced bony lesions part 1. Oral Surgery, Oral Medicine and Oral Pathology, 34:606–612, 1971. [35] K.M. Shah, J.C.H Goh, and R. Karunanithy et al. Effect of decalcification on bone mineral content and bending strength of feline femur. Calcif Tissue Int, 56:78–82, 1995. [36] Manmohan Singh, A.R. Nagrath, and P.S. Maini et al. Changes in trabecular pattern of the upper end of the femur as an index of osteoporosis. Journal of Bone and Joint Surgery, 52A, 1970. BIBLIOGRAPHY 152 [37] H. Wahner and I. Fogelman. The Evaluation of Osteoperosis: Dual engergy X-ray Absorptiometry in Clinical Practice. Martin Dunitz Ltd., 199? [38] W. Wathen-Dunn, editor. Models for the Perception of Speech and Visual Form. MIT Press, Cambridge, Mass., 1967. [39] S. Webb, editor. The Physics of Medical Imaging. Institute of Physics Publishing, Bristol and Philadelphia, 1988.