Filtering with Nonlinear
Anisotropic Diffusion (NAD)
University of Colorado,
This tutorial will guide you through filtering a cryo data set with Nonlinear
Anisotropic Diffusion (NAD).
Filtering with NAD is relatively slow and involves adjusting two parameters to
give the desired amount of filtering. The strategy is to do the operation
on a small test volume and compare the results from different parameter settings
in order to pick the right setting. After that, the full volume is
filtered by breaking it into chunks so that multiple processors can be used.
Filtering is done with the program nad_eed_3d, contributed to IMOD by Frangakis
and Hegerl. The man page for that program has a bit more information and a
reference to their paper.
- This example uses the "cryo" reconstruction produced in our basic cryo tutorial. If you have done
that tutorial, cd to the directory where that reconstruction is located and skip
to the last step in this section.
download the trimmed reconstruction from our web site.
- Move the data set file "cryoSubvol.tar.bz" to the directory where you want to
work on it. Its contents will unpack a file "cryoSubvol.rec" into a
subdirectory named "cryo".
- cd to the directory with the file "cryoSubvol.tar.bz"
- Enter the command:
or, anywhere except on Windows without Cygwin, you can use
tar -xjf cryoSubvol.tar.bz
- Enter the dataset directory with:
- Start Etomo by entering
and press Nonlinear Anisotropic Diffusion
Extracting the Test Volume:
Press the file chooser icon on the Pick a volume line and select
cryo.rec (if you did the "cryo" tutorial) or cryoSubset.rec (if
you downloaded this file).
Press View Full Volume.
Zoom the Zap window up to 1 if necessary, and draw a rubber band in the middle
that is about 300x300 pixels (see the size in the Zap toolbar).
Scroll through the slices and set the Lo and Hi limits to extract 25-30 slices.
Press Get Test Volume Range from 3dmod to fetch the range into Etomo.
Press Extract Test Volume.
- Press View Test Volume to make sure you got the selected area.
Finding K Value for the Test Volume:
For List of K values, enter 0.1,1,5,10,15,25,30,50,75
Keep the Iterations at 10.
Select some CPUs
(up to 9 if possible) and press Run with Different K Values. It computes
a volume for each K value, using multiple processors. The K value controls
how the diffusion of density occurs on each iteration. Where the image
gradient is higher than K, this is considered to represent an edge, and density
flows along the edge and not across it. Where the image gradient is
lower than K, density diffuses uniformly.
When done, press View Different K Values Test Results to load the
multiple volumes into 3dmod. The Zap window has a second toolbar with
4th D left and right arrows for stepping between the volumes (the keys 1 and
2 can also be used). The toolbar also shows the name of the file being
One way to compare the volumes is to step between them in one window; this is
the best way to see how they change from one to the next.
To see the volumes side-by-side, select Linked Slicers from the Image
menu. A slicer will open for each volume, each one locked to that volume
(note the red lock icon in the toolbar). The slicers will be kept at the
same orientation and position, controlled by a single floating toolbar.
Images look strange for intermediate K values (10 - 25), with regions of uniform
intensity. Above this range, K is too high to stop the diffusion across
places of high gradient, and diffusion is essentially isotropic. Within
this range, diffusion is blocked across medium to high gradients, so the density
probably gets trapped in medium-sized regions bounded by these gradients and
becomes evenly distributed. Below this K range, there are many, more
closely-spaced, gradients to block diffusion, and this probably prevents the
noticeable uniform regions.
Finding Iteration Number for the Test Volume:
Pick your preferred K value and enter it in the K value field.
For List of iterations, enter 2,5,8,11,15,21.
Press Run with Different Iterations. This time the nad_eed_3d
program runs once, saving the results at each selected iteration.
Press View Different Iteration Test Results. This time it is
probably easier to assess the preferred filtering by stepping through the
volumes in the Zap window.
Filtering the Full Volume:
Insert your selected K value in the K value field and number of
iterations in the Iterations field.
Select as many CPUs as possible and press Filter Full Volume.
When it is done, you can open it with View Filtered Volume, and delete
the test volumes with Clean Up Subdirectory. The final volume is
named by adding the extension ".nad" to the name of the original volume.
Note that the extensions ".rec" and ".nad" are simply conventions and do not
specify a file format; this volume is an MRC file.