image-ethics-and-data-integrity.md 10.7 KB
Newer Older
1
# Image data integrity
Christian Tischer's avatar
Christian Tischer committed
2 3 4 5 6 7 8 9 10 11 12 13

#### Prerequistes

- A computer with an image analysis software (e.g. [Fiji](www.fiji.sc)) already installed.
- Basic knowledge of how to use above software, e.g. 
    - open and save images
    - change image display settings
    - subtract a value from every pixel in the image
- The training [material](https://git.embl.de/grp-bio-it/image-analysis-training-resources/-/archive/master/image-analysis-training-resources-master.zip) 
- Access to this [document](https://git.embl.de/grp-bio-it/image-analysis-training-resources/blob/master/workshops/image-ethics-and-data-integrity.md#image-ethics-and-data-integrity).

#### Duration
14 15 16

1.5 hours

Christian Tischer's avatar
Christian Tischer committed
17
#### Learn more about image data integrity
18 19 20 21

- http://www.imagedataintegrity.com/about.html
- http://jcb.rupress.org/content/166/1/11.full

22 23 24 25 26 27 28 29 30 31 32 33 34 35
## Image data integrity concept map

<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    image_data_integrity -> image_content [label="  preserving"];
    image_content -> pixel_values;
    image_content -> pixel_coordinates;
    pixel_coordinates -> array_indices;
    pixel_coordinates -> physical_coordinates; 
 }
'/>


36 37
## Image data saving

38 39
### Motivation

Christian Tischer's avatar
Christian Tischer committed
40 41 42 43 44
Sometimes it can be necessary to resave your images in a different format. 
It needs some training to know how to do this properly.

What could be good reasons to resave your data in a different format (multiple answers)?

45 46 47 48 49 50 51
A. I want to share my scientific findings on twitter, thus I need to convert an image to a twitter compatible format.
B. I want to import images in PowerPoint, only some formats will work.
C. I need to save disk space, thus I need to find a format that makes the images smaller.
D. I want to use a special software that only accepts certain image data formats.
E. The journal I want to publish in, only accepts certain image formats.
F. I want to have everything in Tiff format, because this is the standard.
G. My boss says that (s)he cannot open .lif (Leica) or .czi (Zeiss) images, thus I should save them in a different format.
Christian Tischer's avatar
Christian Tischer committed
52

53

54
### Image data saving concept map
55

56 57 58 59 60 61 62
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    saving_images -> image_content [label="  can change"];
  }
'/>

63 64
### Activity: Save an image

65
- Open image: `calibrated_16bit__cells_eres_noisy.tif`
66 67
- Note down the value and coordinate of the pixel at [218, 332]
- Save the image in **jpg** format
68
- Reopen the image
69
- Compare the value and coordinate of the pixel at [218, 332] to your notes, did it change?
70

Christian Tischer's avatar
Christian Tischer committed
71
Repeat above workflow, but 
72

73 74 75
1. adjust the image display before saving 
2. save as **png**
3. open `xy_float__nuclei_probability.tif` and save as **png**
76

77
### Formative assessment
78

79 80 81 82 83 84
What can I do to preserve image integrity during image saving (multiple answers)?

A. I always save in Tiff format, this is safe.
B. I always check pixel values and coordinates before and after saving.
C. I ask my colleagues in the lab and do what they recommend..
D. I keep a copy of the raw data.
85

Christian Tischer's avatar
Christian Tischer committed
86 87

## Image display adjustment
88

Christian Tischer's avatar
Christian Tischer committed
89 90
### Motivation

91
Images are a collection of numbers. To visualise those numbers one needs to decide how to map them onto a color and a brightness. There is no default way of doing this. Thus one has be educated and thoughful about this topic. In fact, it is one of the great responsibilties of a microscopist to ajust the image display settings proplery.
92

93
### Image display concept map
94

Christian Tischer's avatar
Christian Tischer committed
95 96 97 98 99 100 101 102
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    image_content -> numbers [label="  contains"];
    numbers -> color_and_brightness [label="  lookup table (LUT)"];
  }
'/>

103 104 105 106
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    lookup_table_settings -> image_appearance [label="  change"];
107
    lookup_table_settings -> no_default [label="  have"];
108 109 110 111 112
    image_appearance -> scientific_message [label="  changes"];
    responsible_scientist -> lookup_table_settings [label="  configures thoughtfully"];
  }
'/>

113
### Activity: Quantitative image display
114

115
- Open image: `xy_calibrated_16bit__nuclear_protein_control.tif`
116
    - This image shows a nuclear protein in control cells.   
117
- Open image: `xy_calibrated_16bit__nuclear_protein_treated.tif`
118 119 120
    - The cells in this image have been subjected to a drug.
- Inspect the images:
    - Did the drug affect the amount of the nuclear protein?
121
- Adjust the lookup-tables (LUTs) of both images to be the same
Christian Tischer's avatar
Christian Tischer committed
122
- Add a LUT calibration to both images 
123

124
### Formative Assessment
Christian Tischer's avatar
Christian Tischer committed
125

126
What helps to scientifically convey image intensity information (multiple answers)?
127

128
1. Use grayscale LUT whenever possible.
129 130
3. Add a LUT calibration bar.
4. Use the same LUT for all images.
131
5. Adjust the LUT to the image's full bit-depth.
132 133
6. Never change the LUT of images! Always keep as in raw data.

134

Christian Tischer's avatar
Christian Tischer committed
135 136 137 138 139

## High dynamic range image display

### Motivation

140 141
The number range in images of biological samples can cover large ranges.
For example, a GFP tagged protein could occur in the same cell at different locations either 1 or 10000 times. This means that the dynamic range can be 10^4 or more. Due to limitations of image display and preception such large dynamics ranges are difficult to display.
142

143
### High dynamics range image display concept map
144

145 146 147
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
148
    image_dynamic_range -> ratio_max_to_min_value [label="  is"];
Christian Tischer's avatar
Christian Tischer committed
149
    biological_images -> high_dynamic_range [label="  can have"];
150 151 152
    paper_reflectance -> low_dynamic_range [label="  has"];
    computer_monitors -> low_dynamic_range [label="  has"];
    high_dynamic_range -> display [label="  is challenging"];
153 154 155
  }
'/>

Christian Tischer's avatar
Christian Tischer committed
156 157 158 159 160 161 162 163 164 165 166 167
### Activity: High dynamic range image display

- Open image: `xy_16bit__nuclei_high_dynamic_range.tif`
- Try to adjust the grayscale LUT such that everything can be seen
	- Do you manage?
- Try finding other LUTs that help showing all data
	- Add LUT calibration to image

### Formative Assessment

What can you do to show images with a high dynamic range (multiple answers)?

168 169 170 171
A. Adjust the LUT such that the scientifically relevant information can be seen.
B. Adjust the LUT such that the scientifically relevant information can be seen, 
  - and state that the LUT has been adjusted in the figure legend
  - and show the same image with other LUT settings in the supplemental material.
Christian Tischer's avatar
Christian Tischer committed
172 173
C. Try to find a LUT that shows all data.
D. Never use multi color LUTs, they are confusing.
174 175 176
E. Already on the  microscope change the settings such that only relevant structures are visible, e.g. lower the gain such that dark irrelevant objects have zero pixel values.
F. Adjust LUT settings such that background noise is not visible, because this is distracting.
G. Add a LUT calibration to the image, such that readers can see that not all information might be visible.
Christian Tischer's avatar
Christian Tischer committed
177 178 179 180 181 182


## Image math

### Motivation

183 184
It sometimes is necessary to change numberic content of images. It is important to understand how to do this properly in order to avoid uncontrolled artifacts.

Christian Tischer's avatar
Christian Tischer committed
185 186 187
What are good reasons to change the pixel values in an image?

A. For intensity measurements, the image background (e.g. camera based offset) should be subtracted from all pixels.
188
B. For threshold based image segmentation (object detection), it helps to first filter noise in the image.
Christian Tischer's avatar
Christian Tischer committed
189
C. For intensity measurements, it helps to filter noise in the image.
190 191 192 193
D. The image appears to dark, multiplication of all pixels by a constant number is a means to make it brighter.
E. For uneven illumination (e.g. occuring in wide-field microscopy with large camera chips), one should do flat-field correction, which makes the intensity values even across the image.
F. Our microscope was broken. We took images on a replacement microscope. The pixel values were consistently higher than on our usual microscope. We multiplied the pixels on all images from the replacement microscope by a constant factor to make them comparable to our usual data.

Christian Tischer's avatar
Christian Tischer committed
194 195 196

### Concepts

197 198 199
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
Christian Tischer's avatar
Christian Tischer committed
200 201 202 203 204
    image_math -> pixel_values [label="  changes"];
    image_math -> pixel_data_type [label="  does not change"];
    image_math -> wrong_pixel_values [label = "  can yield"] 
  }
'/>
205

Christian Tischer's avatar
Christian Tischer committed
206
### Activity: Perform pixel based background subtraction
207

Christian Tischer's avatar
Christian Tischer committed
208 209 210 211 212 213 214 215 216 217
- Open image: xy_8bit__nuclei_noisy_different_intensity.tif
- Appreciate the significant background intensity
- Measure pixel value at [ 28 , 35 ] and [ 28, 39 ]
- Measure background intensity in this region:
	- upper left corner at [20,35]
	- width = 10
	- height = 10 
- Subtract the measured background intensity from each pixel 
- Measure pixel values again at above coordinates ( [ 28 , 35 ] and [ 28, 39 ] )
- Discuss how the pixel values changed during background subtraction
218

Christian Tischer's avatar
Christian Tischer committed
219
Repeat above activity, but:
220

Christian Tischer's avatar
Christian Tischer committed
221
- Convert the image to a floating point format after opening
222

Christian Tischer's avatar
Christian Tischer committed
223
### Formative Assessment
224

Christian Tischer's avatar
Christian Tischer committed
225 226
Considering image math operations, which of below statements is correct 
(multiple answers)?
227

Christian Tischer's avatar
Christian Tischer committed
228 229 230 231 232 233
A. Never change the pixel data type, because it violates image integrity.
B. One sometimes should change pixel data type, otherwise one gets wrong image processing results.
C. Changing the pixel data type does not change pixel values.
D. One should check pixel values after changing pixel data type.
E. It is forbidden to perform mathematical operations on images, because it changes the pixel values.
F. As a scientist, one is allowed to perform mathematical operations on images.
234 235 236



Christian Tischer's avatar
Christian Tischer committed
237
## Display of 3-D images
238

Christian Tischer's avatar
Christian Tischer committed
239
Biological images are often 3D. However paper and monitors can only show 2D images. It is thus important to understand how to show 3D images in 2D without compromising the scientific message.
240 241 242 243 244 245

### Concepts

<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
Christian Tischer's avatar
Christian Tischer committed
246 247
    _3D_data -> visualisation [label="  multiple options"];
    visualisation -> scientific_message [label="  affects"];
248 249 250
  }
'/>

Christian Tischer's avatar
Christian Tischer committed
251 252 253 254 255 256 257 258 259
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    _3D_visualisation -> sum_projection;
    _3D_visualisation -> max_projection;
    _3D_visualisation -> slice_animation;
    _3D_visualisation -> slice_gallery;
  }
'/>
260 261


Christian Tischer's avatar
Christian Tischer committed
262 263 264 265 266 267 268 269 270
### Activity: Explore 3D visualisations

- Open image: `xyzt_calibrated_16bit__golgi_bfa.zip`
- Explore and discuss different options how to present this data
    - slice gallery
    - sum projection
    - max projection
    - slice animation

271
### Formative Assessment
272

Christian Tischer's avatar
Christian Tischer committed
273 274 275 276 277 278
Which statements about visualisation and quantification of 3D images are correct (multiple answers)?

A. Always use maximum intensity projection, it is by far the most commonly used..
B. Any projection can make sense, you just have scientifically justify it.
C. Intensity quanitifcations ideally should be done in 3D, not in projections.
D. It is impossible to quantify intensities in projections.
279