image-ethics-and-data-integrity.md 10.4 KB
Newer Older
1
# Image ethics and data integrity
Christian Tischer's avatar
Christian Tischer committed
2

Christian Tischer's avatar
Christian Tischer committed
3 4 5 6 7 8 9 10 11
"No novel training material will survive the first contact with students".

#### 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
12 13
- Please download the training [material](https://git.embl.de/grp-bio-it/image-analysis-training-resources/-/archive/master/image-analysis-training-resources-master.zip) 
- Make sure you can 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).
Christian Tischer's avatar
Christian Tischer committed
14 15

#### Duration
16 17 18

1.5 hours

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

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

24 25
## Image data saving

Christian Tischer's avatar
Christian Tischer committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Sometimes it can be necessary to resave your images in a different format. 
It needs some training to know how to do this properly.

### Motivation

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

- I want to publish images on the internet, only some image formats will be possible.
- I want to import images in PowerPoint, only some formats will work.
- I want to save disk space, thus I need to find a format that makes the images smaller.
- I want to use a special software that only accepts certain image data formats.
- The journal I want to publish in only accepts special image formats.
- My boss says that (s)he only accepts Tiff images, because this is the standard.
- My boss says that (s)he cannot open .lif (Leica) or .czi (Zeiss) images.

41
### Concepts
42 43 44 45 46 47 48 49 50 51

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

52 53 54 55
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    saving_images -> image_content [label="  can change"];
Christian Tischer's avatar
Christian Tischer committed
56
    saving_images -> pixel_data_type [label="  can change"];
57 58 59 60
  }
'/>


61 62 63
### Activity: Save an image

![image](/uploads/284ad5edadf96234037f895a86338a58/image.png)
64

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 70
- Compare the pixel to your notes, did it change?

Christian Tischer's avatar
Christian Tischer committed
71 72 73 74
Repeat above workflow, but 
- adjust the image display before saving
- save in **png** instead of **tif** format
- open `xy_float__nuclei_probability.tif` and save as **png**
75 76


77
### Formative assessment
78

Christian Tischer's avatar
Christian Tischer committed
79
What can I do to avoid data loss during image saving (multiple answers)?
80

Christian Tischer's avatar
Christian Tischer committed
81 82
1. I always save in Tiff format, this is safe.
2. I always check pixel values and coordinates before and after saving.
83
3. I ask my colleagues in the lab, and do what they do.
Christian Tischer's avatar
Christian Tischer committed
84 85 86
4. I keep a copy of the raw data.

## Image display adjustment
87

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

Images are just 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.
91 92 93

### Concepts

Christian Tischer's avatar
Christian Tischer committed
94 95 96 97 98 99 100 101
<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)"];
  }
'/>

102 103 104 105
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    lookup_table_settings -> image_appearance [label="  change"];
Christian Tischer's avatar
Christian Tischer committed
106
    lookup_table_settings -> no_default
107 108 109 110 111 112 113 114 115 116 117
    image_appearance -> scientific_message [label="  changes"];
  }
'/>

<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    responsible_scientist -> lookup_table_settings [label="  configures thoughtfully"];
  }
'/>

118

119
### Activity: Quantitative image display
120

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

130
### Formative Assessment
Christian Tischer's avatar
Christian Tischer committed
131

132
What helps to scientifically convey image intensity information (multiple answers)?
133

134
1. Use grayscale LUT whenever possible.
135 136
3. Add a LUT calibration bar.
4. Use the same LUT for all images.
137 138
5. Adjust the LUT to the image's full bit-depth.
6. Never change the LUT of images! Always keep it as is.
139

Christian Tischer's avatar
Christian Tischer committed
140 141 142 143 144 145 146

## High dynamic range image display

### Motivation

The intensity in images of biological samples can cover large ranges.
For example, a GFP tagged protein could occur in the same cell in a diffraction limited volume either 1 or 10000 times. The human visual system can only distinguish about 200 gray values 
147 148 149

### Concepts

150 151 152
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
Christian Tischer's avatar
Christian Tischer committed
153 154 155 156 157
    image_dynamic_range -> highest_to_lowest_value [label="  is"];
    biological_images -> high_dynamic_range [label="  can have"];
    paper_reflectance -> lower_dynamic_range [label="  has"];
    computer_monitors -> lower_dynamic_range [label="  has"];
    biological_images -> display [label="  is challenging"];
158 159 160
  }
'/>

Christian Tischer's avatar
Christian Tischer committed
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
### 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)?

A. Adjust the LUT that the relevant information can be seen.
B. Adjust the LUT that the relevant information can be seen, state that this has been done in the
figure legend, and show the same image with other LUT settings in the supplemental material.
C. Try to find a LUT that shows all data.
D. Never use multi color LUTs, they are confusing.
E. Change microscope settings such that only relevant structures are visible, e.g. lower the gain such that 
too dark objects have zero pixel values.
F. Avoid showing background noise, as this is distracting.



## Image math

It sometimes is necessary to change the numbers in images. It is important to understand how to do this properly in order to avoid uncontrolled artifacts.

### Motivation

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.
B. For threshold based image segmentation (object detection), it helps to filter noise in the image.
C. For intensity measurements, it helps to filter noise in the image.
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.
F. Images taken on a different microscope had consitently lower gray values than on our usual microscope. It is useful to adjust the values to make them similar.  

### Concepts

201 202 203
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
Christian Tischer's avatar
Christian Tischer committed
204 205
    image_math -> pixel_values [label="  changes"];
    image_math -> scientific_image_content [label="  can distort"];
206 207 208
  }
'/>

Christian Tischer's avatar
Christian Tischer committed
209 210 211 212 213 214 215
<img src='https://g.gravizo.com/svg?
 digraph G {
    shift [fontcolor=white,color=white];
    image_math -> pixel_data_type [label="  does not change"];
    image_math -> wrong_pixel_values [label = "  can yield"] 
  }
'/>
216

Christian Tischer's avatar
Christian Tischer committed
217
### Activity: Perform pixel based background subtraction
218

Christian Tischer's avatar
Christian Tischer committed
219 220 221 222 223 224 225 226 227 228
- 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
229

Christian Tischer's avatar
Christian Tischer committed
230
Repeat above activity, but:
231

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

Christian Tischer's avatar
Christian Tischer committed
234
### Formative Assessment
235

Christian Tischer's avatar
Christian Tischer committed
236 237
Considering image math operations, which of below statements is correct 
(multiple answers)?
238

Christian Tischer's avatar
Christian Tischer committed
239 240 241 242 243 244
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.
245 246 247



Christian Tischer's avatar
Christian Tischer committed
248
## Display of 3-D images
249

Christian Tischer's avatar
Christian Tischer committed
250
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.
251 252 253 254 255 256

### Concepts

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

Christian Tischer's avatar
Christian Tischer committed
262 263 264 265 266 267 268 269 270
<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;
  }
'/>
271 272


Christian Tischer's avatar
Christian Tischer committed
273 274 275 276 277 278 279 280 281
### 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

282
### Formative Assessment
283

Christian Tischer's avatar
Christian Tischer committed
284 285 286 287 288 289
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.
290