1
1
******
2
- 2D Electron Microscopy Workflow (formally internally DM conversion workflow )
2
+ Small 2D Workflow (EM Microscopy )
3
3
******
4
4
5
5
Overview:
6
6
7
- This workflow supports generating thumbnails and key images form input images. Certain EM file formats and contents
7
+ This workflow generates a thumbnail and a key images for each input image in a directory. Specific EM file formats
8
8
use enhanced resampling and filtering techniques to reduce noise while adjusting the dynamic range of the images. This
9
9
workflow originally was designed to handle DM3 files from TEM or STEM microscopes but has been extended to handle
10
- other 2D EM image file formats, including MRC and TIFF files.
10
+ other 2D image file formats, including MRC, TIFF files and color figures .
11
11
12
12
Outputs:
13
13
1. A thumbnail image for each input image.
14
+ - An JPEG image with a maximum size of 300 pixels in both dimension.
15
+ - The aspect ratio is preserved and may be shortened to fit within the maximum size without padding.
16
+ - The image may be 8-bit RGB(A) or 8-bit gray-scale.
14
17
2. A key image for each input image.
18
+ - Similar to the thumbnail image but with a maximum size of 1024 pixels in both dimension.
15
19
16
20
.. list-table :: Supported Extensions for File Formats
17
21
:header-rows: 1
@@ -20,10 +24,10 @@ Outputs:
20
24
- Description
21
25
- Extensions
22
26
* - DM3
23
- - image format used by Digital Micrograph
27
+ - image format used by Digital Micrograph
24
28
- dm3
25
29
* - DM4
26
- - image format used by Digital Micrograph, possibly limited to 64-bit integers
30
+ - image format used by Digital Micrograph, maybe limited to 64-bit integers
27
31
- dm4
28
32
* - MRC
29
33
- image format used by the IMOD tool suite
@@ -52,7 +56,7 @@ processing tasks.
52
56
- Processing Information
53
57
* - JPEG, PNG, TIFF
54
58
- 8-bit RGB (palette) or RGBA
55
- - Images may be figures or rendered EM image of wells? .
59
+ - Example images include figure, TEM grid image or other illustrative images rendered into a color image .
56
60
- Images should directly resized without intensity scaling or advanced filtering.
57
61
* - TIFF, PNG, JPEG
58
62
- 8-bit gray-scale
@@ -61,8 +65,7 @@ processing tasks.
61
65
* - TIFF
62
66
- 16-bit (signed or unsigned) gray-scale
63
67
- EM images with a high dynamic range.
64
- - Convert to 8-bit
65
- - Use IMOD's `newstack `_ tool to resample, filter, and scale intensities to 8-bit.
68
+ - Use IMOD's `newstack `_ tool to resample, filter, and scale intensities to 8-bit.
66
69
* - DM4 or DM3 Images
67
70
- 32-bit float (after MRC conversion)
68
71
- Minimally processed EM images with a high dynamic range.
@@ -74,51 +77,31 @@ processing tasks.
74
77
- Convert to 8-bit TIFF via `newstack `_ command to resample, filter, and scale intensities to 8-bit.
75
78
76
79
77
- Format Conversion
78
- +++++++++++++++++
79
-
80
- The first step is to convert the input to a format compatible with the IMOD tool suite (e.g., MRC or TIFF).
81
-
82
- Inputs: DM3, DM4, MRC, or TIFF files
83
- Outputs: MRC or TIFF files
84
- Steps:
85
- 1. Use the `dm2mrc `_ tool to convert DM3 or DM4 files to MRC format.
86
- 2. For MRC files, no additional conversion is required.
87
- 3. For 16-bit TIFF files, convert them to 8-bit TIFF using the `newstack `_ tool.
80
+ EM Image Conversion
81
+ +++++++++++++++++++
88
82
89
- Resampling
90
- ++++++++++
83
+ High dynamic range EM images need to be rendered into an image that is suitable for display. The EM images are
84
+ resampled, filtered and resized to reduce the dynamic range and improve the signal-to-noise ratio.
91
85
92
- The EM images can be broadly characterized as having a low signal-to-noise ratio and a high dynamic range with potential
93
- outliers. The resampling or resizing of these images requires advanced algorithms and options that are not available
94
- with conventional image processing tools. Through proper resampling and filtering, the images' signal-to-noise ratio
95
- can be improved, and the dynamic range can be reduced for better visualization.
96
86
97
- The IMOD tool `newstack `_ is used to resample the images.
98
-
99
- Inputs: MRC or TIFF files
100
- Outputs: TIFF files as 8-bit images
87
+ Inputs: DM3, DM4, MRC, or TIFF (16-bit) file
88
+ Output: TIFF file
101
89
Steps:
102
- 1. Determine the size or dimensions of the input images .
103
- 2. Compute the factor to reduce the size of the input image to the desired key image size .
104
- 3. Use the `newstack `_ tool to filter and resize/shrink the input image to approximately the desired size.
105
-
106
- .. code-block :: bash
90
+ 1. If the input image is a DM4 or DM3 then the ` dm2mrc `_ tool converts the input to an MRC format .
91
+ process also converts the pixel type to 32-bit float .
92
+ 2. After computing the input image size, the `newstack `_ tool is used to resample and filter the image to reduce the
93
+ dynamic range and improve the signal-to-noise ratio. The ` newstack `_ tool also converts the pixel type to 8-bit
94
+ unsigned integer.
107
95
108
- newstack -format TIFF -shrink $shrink_factor -antialias 6 -mode 0 -float 1 input.tiff output.tiff
109
96
110
- Conditionals:
111
- - If the input image size is less than the desired key image size, then `-shrink ` and `-antialias ` options are not
112
- used.
113
- - If the input pixel type is 8-bit, then the `float ` option is not used.
97
+ .. code-block :: bash
98
+ newstack -format TIFF -shrink $shrink_factor -antialias 6 -mode 0 [-float 1| -meansd 140,50] input.tiff output.tiff
114
99
115
- The above command converts any supported scalar pixel input type to an 8-bit image with a dynamic range reasonable for
116
- visualization. The `float ` option is used so the resampled pixel intensities are normalized to fill the output range.
117
100
118
101
Output Generation
119
102
+++++++++++++++++
120
103
121
- The final step is to generate the thumbnail and key images using `SimpleITK `. The compression and filtering options are
104
+ The final step is to generate the thumbnail and key image using `SimpleITK `. The compression and filtering options are
122
105
tuned for web display.
123
106
124
107
Inputs: TIFF files
@@ -132,7 +115,7 @@ Steps:
132
115
sitk.WriteImage(img, output_path, useCompression = True , compressionLevel = compression_level)
133
116
134
117
Note: The resizing operation ensures that the maximum dimension of the output matches the desired size, while preserving
135
- the input aspect ratio. The compression level is tunable and varies between thumbnails and key images .
118
+ the input aspect ratio. If the input image is smaller than the desired size, it will not be resized .
136
119
137
120
.. _IMOD : https://bio3d.colorado.edu/imod/
138
121
.. _dm2mrc : https://bio3d.colorado.edu/imod/doc/man/dm2mrc.html
0 commit comments