PHYS2135 | ASSIGNMENT 1: Image Processing | Other

Home Recent Questions PHYS2135 | ASSIGNMENT 1: Image Processing | Other


Most image file formats support the inclusion of metadata – this is additional data stored in the file, other than the image itself (i.e. pixel values, colours). The file format dictates what information can be stored. It may be restricted to basics such as the image dimensions, size, colour bit depth, or in the case of medical applications, be much more comprehensive. For example, JPEG has limited metadata (width, height, bit-depth etc.) while TIFF and DICOM support a wide range of information including image properties, patient and physician names, acquisition parameters and much more. [Note that the possibility of medical image files containing names or other identifying information, requires that images used for things outside of their clinical management are “de-identified” prior to use or distribution. Medical Physicists often have to do this for research and education purposes, so always make sure you know the details of file formats used].

DICOM (Digital Imaging and Communications in Medicine) is a standard for handling, storing, printing, and transmitting information in medical imaging. While it is a worldwide ‘standard’, it should be noted that is an evolving set of definitions, and not every metadata field appears in every DICOM file. Similarly, one data type might exist in one of several fields having similar names. Images acquired using different hardware/software may have different fields in the metadata. This can become a problem when transferring images between different platforms, as information may be displayed in an incorrect field or simply lost. A study of DICOM could fill many lectures. You should be aware that in a professional context, you may be confronted with having to detect and deal with DICOM incompatibility at some stage.

Let’s start by opening and viewing some files…

❖ Open “foot.tif”. This is a TIFF image converted from DICOM.

If available in a file, ImageJ displays the image size (in both pixels and distance), bit-depth/colour model and file size below the title bar in the image window. The cursor coordinates and pixel value are displayed below the toolbar in the main ImageJ window. The complete metadata can be viewed by going to >Image -> Show Info…

1. What imaging modality was used to acquire this image?
2. What is the resolution of this image? (in this case, as a consequence of the Computed Radiography (CR) image panel pixel size and pitch)
3. What kVp was used to acquire this image?
4. From the Patient’s Name field, what do you deduce about the subject of the image?
5. Why do the bones toward the toes appear darker where there is less material for the photons to penetrate? (compare to pixel values)

❖ Now open “mri-stack.tif”.

This is an MRI brain scan… a set of tomographic (‘slice’) images in a ‘stack’. Scroll through the images (using scroll bars or mouse wheel) and observe the excellent soft tissue contrast afforded by MRI.

6. How many slices are there in the stack?
7. Do the transverse slice numbers increase from superior to inferior or from inferior to superior?

❖ Open the CT image set (File -> Import -> Image Sequence… and select one of the files in the CT_image directory).

This CT scan of a torso spans the range occupied by the lungs. Note the presence of a lung tumour in slices 11-21 in the posterior of the right lung.

8. What is the slice spacing?
9. There is a small radio-opaque trace marker on the surface of the patient’s chest. What are the coordinates of this marker (to the nearest millimetre)?

Brightness and contrast

As you are aware from reading the ACPSEM position paper on mammography QA, test patterns are used to assess monitors. For the purposes of this assignment, the older SMPTE test pattern is more suitable than the recommended TG18-QC image as many of the regions are labelled making instructions less ambiguous.

❖ Open “SMPTE_test_pattern.tiff”.

View its pixel intensity histogram (Analyze -> Histogram).

Observe the two regions in the image labelled 5 % / 0 % and 95 % / 100 %. You should just be able to make out that 5 % / 0 % is a black square with a slightly lighter square in the middle and 95 % / 100 % is a white square with a slightly darker square in the middle.

10. Describe what happens to the “visibility” of these two squares when you increase the brightness of the image (Image -> Adjust -> Brightness/Contrast)?

11. What happens when you decrease the brightness?

Reset the brightness and contrast back to the default. Now adjust only the contrast.

12. Does increasing or decreasing the total image contrast make the apparent contrast between 5 % / 0 % and 95 % / 100 % regions better?

Note: So long as you don’t press “Apply” when adjusting contrast, brightness, window etc. there is no change to the data contained in the image, only the way it is displayed on your monitor. Check this by opening the histogram again (the histogram does not update when changes are made, you must open it a second time).

The visibility of the 5 % / 0 % and 95 % / 100 % regions (or at least the visibility of their boundaries) can also be adjusted using low pass or high pass filters. In ImageJ this can be done using “Convolve” (Process -

>vFilters -> Convolve…). This tool applies spatial convolution using a kernel entered into a text area. A kernel is a matrix whose centre corresponds to the source pixel and the other elements correspond to neighbouring pixels. The destination pixel (the new value of the source pixel in the new filtered image) is calculated by multiplying each source pixel by its corresponding kernel coefficient and adding the results.

Thus, each pixel is altered as a function of its immediate surroundings in the image – such as intensity gradient.

Checking “Normalize Kernel” causes each coefficient to be divided by the sum of the coefficients, preserving image brightness. There is no arbitrary limit to the size of the kernel but it must be square and have an odd width (so that there is a ‘centre’ pixel).

13. When you first open the convolve tool, is the default kernel a low or high pass filter?

14. Apply a high pass filter to the image and paste a screenshot of the result (use Alt + Print Scrn to only grab the active window) as Figure 1.1 (14a) and a copy of the convolve window panel as Figure 1.2 (14b).

15. What general effect does the high pass filter have?

16. Construct and apply a low pass filter to the image and paste the result as Figure 2.1 (16a) and the convolve window as Figure 2.2 (16b).

Look-up tables (LUTs)

Displayed brightness and contrast are changed by updating the image's look-up table (LUT), so pixel values in the image file are unchanged – only the LUT converted value that is displayed on the screen. With 16-bit and 32-bit images (i.e. usually displayed as “greyscale” images), the display is updated by changing the mapping from pixel values to 8-bit display values, so pixel values are also unchanged. Brightness and contrast of RGB (colour) images are changed by modifying the pixel values. It is quite common to display x-ray radiographs using an inverted LUT as this reflects the way the image would appear if it were film on a light box, i.e. where there is more exposure (less attenuation) the film has greater optical density and actually appears darker.

❖ Open “brain.tiff”

View the LUT (Image -> Color -> Show LUT …). You can see that the default is simply a linear relationship between pixel value and grey level. Change the LUT to “RedGreenBlue.lut” (Image -> Color -> Edit LUT … -

Open… and select the .lut file provided) and now view the new LUT plot.

17. Paste screenshots of the image and the LUT plot as Figures 3.1 (17a) and 3.2 (17b) respectively.

The LUT can also be manually edited by clicking the coloured squares in the Edit LUT window. You can edit a range of values easily by clicking and dragging a selection of squares, then entering the start and end RGB values for that pixel range. Make a simple binary LUT (only black and white present, no grey shades) and apply it to the image.

18. Paste screenshots of the image and LUT as Figures 4.1 (18a) and 4.2 (18b) respectively.

There are various selection and drawing tools in the main ImageJ window below the menu bar.

❖ Open “Contrast-Noise-1.tif” and “Contrast-Noise-2.tif”

The images are noticeably noisy, however there are techniques we can employ to reduce this. The contrast to noise ratio (CNR) can be used to assess the effectiveness of the noise reduction techniques. The simplest method for calculating CNR is to use the Weber contrast definition leading to
=    −
where Īref is the mean pixel intensity of the reference region, Ī is the mean pixel intensity of the region being evaluated and ref is the standard deviation of the pixel intensities in the reference region and is an estimate of the pure image noise.

The next exercises will require you to set some Regions of Interest (ROIs) – straight lines, circular regions, etc. It may be useful to use the ROI manager so you can select the exact same regions later (Analyze -> Tools -> ROI Manager… After selecting a ROI you can ‘Add’ it and ‘rename’ it).

For the largest circular feature in each of the images…

19. Using the straight line tool, select a line profile across the middle of the circle (make the profile about twice the diameter length to include some background) and plot the intensity profile: Analyze -> Plot Profile. Capture and paste the profiles as Fig’s 5.1 & 5.2

20. Calculate CNR: If needed, use the Brightness/Contrast or Window/Level tools to improve the visibility of these regions for placing a circular ROI… using the ‘elipse’ selection tool - holding the Shift key while you drag creates a circle. Information about the regions can be extracted by going to Analyze -> Measure. Choose Set Measurements under Results menu to select what data are included and displayed in the Results list (e.g. st dev). Calculate the CNR for this large circle in these two images.

21. How sensitive is your measured CNR to your choice of background region? Show some results and comment.

Use smoothing (Process -> Smooth) to reduce the noise and repeat the calculation. Note that you must not have any region selected when applying the smoothing, because if there is a region selected the smoothing will only be applied to that region.

22. What are the CNRs of these two objects now?
❖ Open “foot.tif” again.

By plotting line profiles through the image, determine the orientation and gradient of the heel effect.

23. Paste a screenshot of the relevant line profile as Figure 6.1, and a screenshot of the image window showing where your profile was taken as Fig 6.2.

24. Hovering the mouse pointer over points in the image, or points in a profile plot, gives position coordinates and pixel values. Estimate the gradient of the heel effect in this image. Include units.

25. What would be the implication of this finding if you were estimating the CNR from test images that featured a substantial heel effect gradient?

Clear the Results window list (Edit -> Clear).

In the following exercises, we are going to use a dimension measurement tool, but please be aware that we do not know the x-ray-source-to-object or x-ray-source-to-imager distances and hence we don’t know the magnification factor for objects in these images. So we are really talking about the dimensions in the image, rather than of the real object.

Use the “Straight” tool to measure the width of the thinnest part of the hallucal (first) metatarsal, including an estimate of the uncertainty (you may need to zoom in quite a bit to measure accurately). Don’t close the Results window or clear this measurement as you will need it later.

Undo the smoothing (or just reopen the original image) and measure the width again. Use the Mean filter with an appropriate radius (Process -> Filters -> Mean…), then measure the width a third time. Repeat this process once more using Gaussian blur with an appropriate standard deviation (Process -> Filters -> Gaussian Blur…). You can analyse the distribution of measurements you have made by going to Analyze -> Summarize.

26. What is the standard deviation of the measurements you made?

27. Taking into account your estimates of the uncertainties, what would you report the width of the thinnest part of the hallucal metatarsal to be?

You can manually adjust the scale of an image (Analyze -> Set Scale…). Change the scale from 10 to 12 pixels/mm and measure the hallucal metatarsal again.

28. Given that you don’t know the history of the image (what processing has been carried out previously), what conclusions can you make regarding the accuracy of measurements taken from radiographs?

29. Would it be possible to regain the fine detail (e.g. striations) lost after applying each noise reduction technique by adjusting the window and level?
❖ Open “femur.dcm”.

This is a reasonably large, high resolution image file… explore the zoom in and out functions on the Image menu (and shortcut keys). This image shows orthopaedic implants in the pelvis and femur. You will notice that the large screw holding the distal end of the intramedullary rod in place protrudes quite a bit from the femur.

30. Using the “Straight” tool to measure the distance, how far does the screw protrude from the femur?

You will notice that the head of the screw appears elliptical. This implies that the screw does not actually lie in the image plane but points in to or out of the screen. By measuring the major and minor axis of the ellipse, and using some basic geometry, you can calculate an estimate of the actual distance the screw protrudes from the femur.

31. What is that oblique distance that the screw protrudes from the femur?

That is the end of the exercise. This assignment has given you an excuse to explore some of the features of an image processing software package. There is an enormous range of functionality available and you should make the time to familiarise yourself with more of the capabilities of ImageJ. It is a very useful tool to have in your skill collection.

All assignments will be assessed on accuracy, completeness, scientific quality (including referencing) and presentation. Demonstrating your understanding of the key aspects and concepts involved is important. You should reference all sources from which you obtain material – include a bibliography as well as specific citations where appropriate.

The standard RMIT assessment scale will be used: HD>80 %, DI>70%, CR>60%, PA≥50%, NN<50%


• You should submit the assignment via the Assignments link in Canvas.
• Please submit your assignment as a Word Processed document (preferably MS Word) or an electronically generated pdf file (i.e. not scanned from paper).
• By submitting your assignment electronically using RMIT’s online learning management system, you agree to the following:

o "I declare that in submitting all work for this assessment I have read, understood and agree to the content and expectations of the assessment declaration."

Your submission must be your own work, and submission of an assignment for assessment includes a declaration to this effect. Please be aware of the RMIT Plagiarism policy (link below) and note that RMIT uses Turnitin plagiarism detection software to compare submissions against all published and on-line material including previously submitted assignments at all participating universities. Please ensure that you write in your own words and reference all sources correctly. (You may submit your own work for Turnitin analysis at

Search Here

Latest Reviews

  • Marcus
    30 Apr, 2019

    My assignment help services are provided in the best way by this website. The writers have completed my assignment in such a way that they helped me increase my overall performance.

  • Emy
    29 Apr, 2019

    Awesome work done by the experts of this company. I visited this site to get math assignment completed. My assignment was complete in every aspect. Thanks to the professionals who provided assignment writing help.

  • Darina
    25 Apr, 2019

    All thanks to the writers of Assignment Help 4 Me who completed my Physics assignment in the right manner. The structure of the assignment was totally customized according to my needs and that too at cheap prices.

View All Reviews


Assignment Help 4 Me