|
89 | 89 | # For this ``Simulation`` we set all 2D offset vectors to zero, |
90 | 90 | # but by default offset vectors will be randomly distributed. |
91 | 91 | # We cache the Simulation to prevent regenerating the projections |
92 | | -# for each preproccesing stage. |
| 92 | +# for each preprocessing stage. |
93 | 93 | src = Simulation( |
94 | 94 | n=2500, # number of projections |
95 | 95 | vols=original_vol, # volume source |
|
137 | 137 | # efficiency of subsequent pipeline stages. Metadata such as pixel size is |
138 | 138 | # scaled accordingly to correspond correctly with the image resolution. |
139 | 139 |
|
140 | | -src = src.downsample(res).cache() |
| 140 | +src = src.downsample(res) |
141 | 141 | src.images[:10].show() |
142 | 142 |
|
143 | 143 | # %% |
144 | 144 | # CTF Correction |
145 | 145 | # -------------- |
146 | 146 | # We apply ``phase_flip()`` to correct for CTF effects. |
147 | 147 |
|
148 | | -src = src.phase_flip().cache() |
| 148 | +src = src.phase_flip() |
149 | 149 | src.images[:10].show() |
150 | 150 |
|
151 | 151 | # %% |
152 | 152 | # Normalize Background |
153 | 153 | # -------------------- |
154 | 154 | # We apply ``normalize_background()`` to prepare the image class averaging. |
155 | 155 |
|
156 | | -src = src.normalize_background().cache() |
| 156 | +src = src.normalize_background() |
157 | 157 | src.images[:10].show() |
158 | 158 |
|
159 | 159 | # %% |
160 | 160 | # Noise Whitening |
161 | 161 | # --------------- |
162 | 162 | # We apply ``whiten()`` to estimate and whiten the noise. |
163 | 163 |
|
164 | | -src = src.whiten().cache() |
| 164 | +src = src.whiten() |
165 | 165 | src.images[:10].show() |
166 | 166 |
|
167 | 167 | # %% |
168 | 168 | # Contrast Inversion |
169 | 169 | # ------------------ |
170 | 170 | # We apply ``invert_contrast()`` to ensure a positive valued signal. |
171 | 171 |
|
172 | | -src = src.invert_contrast().cache() |
| 172 | +src = src.invert_contrast() |
| 173 | + |
| 174 | +# %% |
| 175 | +# Caching |
| 176 | +# ------- |
| 177 | +# We apply ``cache`` to store the results of the ``ImageSource`` |
| 178 | +# pipeline up to this point. This is optional, but can provide |
| 179 | +# benefit when used intently on machines with adequate memory. |
| 180 | +src = src.cache() |
173 | 181 |
|
174 | 182 | # %% |
175 | 183 | # Class Averaging |
|
0 commit comments