• Keine Ergebnisse gefunden

4 Image Pre-Processing

Algorithm 1: Import DICOM data and save as MetaImage Input: Folder with DICOM images of the knee

4.3 Automated Cropping

zstands for the number of slices of the corresponding 3D image. Then, foreground is separated8from background to further reduce the computational cost. Finally, N4ITK uses the foreground to estimate the bias field in the original image and subsequently corrects it. The pseudo-code for the implementation of the BFC can be found in Algorithm 2.

Original Bias Field Corrected

Figure 4.4:Bias field correction of a knee MR image slice. The corrected image (right) shows improved contrast in comparison to the original image (left). The estimated bias field (center) shows an over-exposed region to the left and an under-exposed area to the top of the image slice.

Algorithm 2: Bias Field Correction Input: MetaImage (.mhd/.raw) Output: uncorrupted MetaImage

downsample each image slice to 448×448 pixels separate image foreground and background

execute N4ITK algorithm to correct bias field in input MetaImage

4.3 Automated Cropping

The third data preprocessing module is the automated cropping (Fig. 4.1). It gener-ates standardized VOIs around the growth plgener-ates of the knee regardless of the field of view (FOV) of the original MRIs (Fig. 4.5). The cropping is useful to reduce the amount of undesired anatomical structures in the image (e.g. fat and muscles) and

8https://itk.org/Doxygen49/html/classitk_1_1OtsuThresholdImageFilter.html

to increase the size ratio of the target structures, i.e. the growth plates of the knee, with respect to the entire image.

To find the exact location of the VOI in the image an approach namedPatch Match-ing, also Template Matching, was employed. The principle of this approach is to determine correspondences between a characteristic region, i.e. apatchortemplate, and equally sized regions across the entire target image [5, 11]. The optimal location of the patch in the image is then determined at the point of it’s highest correlation with the image. The normalized cross-correlation (NCC) is used as a similarity measure since it is invariant to local changes in brightness and contrast [11, 228].

To enable the automated cropping of this work, characteristic regions were selected in the knee MRIs. Theintercondyloid eminencewas defined as patch for MRIs in coronal orientation (Fig. 4.6). For sagittal MRIs, the posterior cruciate ligament (PCL) was defined as characteristic region (Fig 4.7).

The patches were extracted from downsampled and uncorrupted images resulting from the previous pre-processing modules. Moreover, two patches for each image

OriginalStandardizedVOI

Figure 4.5: Automated cropping is used to generate standardized volumes of in-terest (bottom row) around the knee growth plates regardless of the FOVs of the original MRIs (top row)

4.3 Automated Cropping

Intercondyloid eminence

Intercondyloid eminence

Figure 4.6:Intercondyloid eminenceof the proximal tibia (left; adapted from [70]) and it’s representation in a coronal knee MRI slice (right)

Posterior Cruciate Ligament

Posterior Cruciate Ligament

Figure 4.7:Posterior view of the knee joint with theposterior cruciate ligament highlighted (left; adapted from [70]) and its representation in a sagit-tal knee MRI slice (right)

orientation were extracted to account for spacing and resolution differences between images of the three datasets (Table 3.2). One for lower in-plane resolutions at around 0.4×0.4 mm2 and another one for higher resolutions at approximately 0.2×0.2 mm2. The spacing encoded in the MetaImage and the template filename enabled the automatic selection of the correct patch for a given image.

The implementation of the automated cropping is composed of multiple parts (Fig. 4.8). First, a volume smaller in size than the MRIs is defined to search for the best location of the patch in the image. This reduces the computational cost of the sliding-window principle of patch matching and increases it’s robustness. In the z-dimension, i.e. along the slicing direction, 12 central slices was sufficient to successfully detect the intercondyloid eminence and the PCL in coronal and sagittal MRIs, respectively. In thex-y-plane, the search area covered 75% of the image slice (green area in Fig. 4.8). This setting covered the variations of the positions of the characteristic anatomical structures in all MRIs.

Patch

Patch Matching Correlation Map

Standardized VOI

center of VOI search area

...

... ...

Figure 4.8: Patch Matchingbetween a small characteristic region orpatch(left) and equally sized image regions (center-left). The patch is slid across the search area (green) and for each pixel the normalized cross-cor-relation between the patch and the image region is computed. The brightest point in the correlation map (center-right) represents the best location of the patch in the image. A standardized VOI is built around this point (right).

4.3 Automated Cropping

The second part of automated cropping is to slide the patch across the search volume and compute the NCC at each position.9 Afterwards, the maximum value NCCmax per slicezand it’s position (x,y) is determined and saved to a vectorv:

v(z) =x y NCCmax

(4.1)

Choosing the position with the highest overall NCC among all twelve slices, led to a false localization of the patch in a number of cases. Therefore, a refined selection of the best position was necessary. In an iterative approach, three adjacent slices of the search volume are selected and their average NCC is calculated. The three adjacent slices with the highest average NCC are shortlisted. Then, the best vertical positionybestis calculated as the median of they’s of the three shortlisted vectors (equation 4.1). The median of they’s was chosen here over the mean, since it was more robust to erroneous localizations. To finalize,xbestis extracted from the vector containingybest.

The third and final step is to crop the image.10 For this purpose, a VOI is formed with it’s center at (xbest,ybest,zbest). The size of the VOI was defined in mm and not in pixels, since the images from the three datasets (A, B, C) had different spatial resolutions. The final size of the VOI was 130×130×dz mm3. The VOI included the entire image volume depth dz, i.e. all slices, indicating that the images were in fact only cropped in-plane. The pseudo-code for the automated cropping can be found in Algorithm 3.

9https://itk.org/Doxygen49/html/classitk_1_1NormalizedCorrelationImageFilter.

10When preparing the data for the training of the segmentation network, the cropping was per-html formed after the image augmentation instead (see section 5.2)

Algorithm 3: Automated cropping