Skip to content

Commit 7b0d693

Browse files
Finalised
1 parent 77d33be commit 7b0d693

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

_pages/imaging/principles.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
mediawiki: Principles
32
title: Principles of Scientific Imaging
43
section: Learn:Scientific Imaging
54
nav-links: true
@@ -22,7 +21,7 @@ Spatial resolution refers to the number (or density, if you prefer) of samples i
2221

2322
## Avoid lossy compression
2423

25-
Original data should be saved in a way that preserves the exact sample values. Do not store raw image data in file formats such as JPEG which use lossy compression. See [Why (lossy) JPEGs should not be used in imaging](/imaging/principles#why-lossy-jpegs-should-not-be-used-in-imaging) below for details.
24+
Original data should be saved in a way that preserves the exact sample values. Do not store raw image data in file formats such as JPEG which use lossy compression. See [Why (lossy) JPEGs should not be used in imaging](#why-lossy-jpegs-should-not-be-used-in-imaging) below for details.
2625

2726
## Illuminate as evenly as possible
2827

@@ -84,32 +83,34 @@ Once an image has been saved as compressed JPEG there is no way of reverting to
8483

8584
Below is an ImageJ macro which demonstrates the issue. It requires the [Glasbey](/plugins/glasbey) LUT, part of the [Fiji](/software/fiji) distribution of ImageJ.
8685

87-
// load Boats
88-
run("Boats (356K)");
89-
run("Out [-]");
90-
rename("Original");
91-
92-
// convert to JPEG
93-
run("Duplicate...", " ");
94-
run("Out [-]");
95-
run("Save As JPEG... [j]", "jpeg=85");
96-
run("Revert");
97-
rename("JPEG");
98-
99-
// compute the difference
100-
imageCalculator("Subtract create 32-bit", "Original","JPEG");
101-
run("Out [-]");
102-
rename("Difference");
103-
104-
// display windows side by side
105-
run("Tile");
106-
107-
// highlight artifacts using Glasbey LUT
108-
selectWindow("Original");
109-
run("glasbey");
110-
selectWindow("JPEG");
111-
run("glasbey");
112-
selectWindow("Difference");
86+
```java
87+
// load Boats
88+
run("Boats (356K)");
89+
run("Out [-]");
90+
rename("Original");
91+
92+
// convert to JPEG
93+
run("Duplicate...", " ");
94+
run("Out [-]");
95+
run("Save As JPEG... [j]", "jpeg=85");
96+
run("Revert");
97+
rename("JPEG");
98+
99+
// compute the difference
100+
imageCalculator("Subtract create 32-bit", "Original","JPEG");
101+
run("Out [-]");
102+
rename("Difference");
103+
104+
// display windows side by side
105+
run("Tile");
106+
107+
// highlight artifacts using Glasbey LUT
108+
selectWindow("Original");
109+
run("glasbey");
110+
selectWindow("JPEG");
111+
run("glasbey");
112+
selectWindow("Difference");
113+
```
113114

114115
## Considerations during image segmentation (binarization)
115116

0 commit comments

Comments
 (0)