Differences between revisions 30 and 51 (spanning 21 versions)
Revision 30 as of 2009-01-21 18:06:42
Size: 2644
Comment:
Revision 51 as of 2009-04-11 00:48:59
Size: 3933
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
= 2D =
EMAN2 includes a good selection of test images that can be generated in no time at all. They come in many shapes and forms, from simple gradients and shapes to basic noise models.
= Python test images =
EMAN2 includes a good selection of test images. They come in many shapes and forms, from simple gradients and shapes to basic noise models.
Line 5: Line 5:
== Using the test_image function in Python == == test_image (2D) ==
Line 9: Line 9:
{{{ {{{#!python
Line 23: Line 23:
||{{attachment:test_0.png}} ||{{attachment:test_1.png}}||
|| test_image(0): The EMAN scurve || test_image(1): Gaussian noise ||
||{{attachment:test_2.png}} ||{{attachment:test_3.png}}||
|| test_image(2): Dark square || test_image(3): Light square ||
||{{attachment:test_4.png}} ||{{attachment:test_5.png}}||
|| test_image(4): Scurve and line wave || test_image(5) ||
||{{attachment:test_6.png}} ||{{attachment:test_7.png}}||
|| test_image(6) || test_image(7) ||
||{{attachment:test_8.png}} ||{{attachment:test_9.png}}||
|| test_image(8) || test_image(9) ||
== Using the processor framework ==
If you don't specify the size argument the returned image is 128x128. The following table shows each of the currently defined test_images.
Line 35: Line 25:
||<:>{{attachment:test_0.png}} ||<:>{{attachment:test_1.png}}||
||<:>{{{test_image(0)}}}: The EMAN scurve ||<:> {{{test_image(1)}}}: Gaussian noise ||
||<:>{{attachment:test_2.png}} ||<:>{{attachment:test_3.png}}||
||<:>{{{test_image(2)}}}: Dark square ||<:>{{{test_image(3)}}}: Light square ||
||<:>{{attachment:test_4.png}} ||<:>{{attachment:test_5.png}}||
||<:>{{{test_image(4)}}}: Scurve and random frequency line wave ||<:>{{{test_image(5)}}}: Axes ||
||<:>{{attachment:test_6.png}} ||<:>{{attachment:test_7.png}}||
||<:>{{{test_image(6)}}}: Random frequency line wave ||<:>{{{test_image(7)}}}: Scurve and directional gradient ||
||<:>{{attachment:test_8.png}} ||<:>{{attachment:test_9.png}}||
||<:>{{{test_image(8)}}}: Randomly rotated, mirrored and translated scurve ||<:>{{{test_image(9)}}}: Scurve and Gaussian noise ||

== test_image_3d (3D) ==

At present there are 6 3D test images that are accessible using the test_image_3d function, which is defined in EMAN2.py.

{{{#!python

#] e2.py

Welcome to EMAN2
Prompt provided by IPython
Enter '?' for ipython help

In [3]: e = test_image_3d(0)

In [4]: display(e)

}}}

The following table shows the currently available 3D test images.

||<:>{{attachment:test_3d_0.png}} ||<:>{{attachment:test_3d_1.png}}||
||<:>{{{test_image_3d(0)}}}: Axes ||<:>{{{test_image_3d(1)}}}: Spherical waves ||
||<:>{{attachment:test_3d_2.png}} ||<:>{{attachment:test_3d_3.png}}||
||<:>{{{test_image_3d(2)}}}: Tomography test image ||<:>{{{test_image_3d(3)}}}: Solid cube ||
||<:>{{attachment:test_3d_4.png}} ||<:>{{attachment:test_3d_5.png}} ||
||<:>{{{test_image_3d(4)}}}: Solid sphere ||<:>{{{test_image_3d(5)}}}: Rotated ellipse with holes ||


= Using the processor framework =

== 2D ==
Line 37: Line 69:
{{{ {{{#!python
Line 53: Line 85:
||{{attachment:xcoord.png}} ||{{attachment:ycoord.png}}||
||{{{ e.process_inplace("testimage.gradient")}}}||{{{ e.process_inplace("testimage.gradient", {'axis','y'}) }}}||
||{{attachment:axes.png}}|| {{attachment:circle.png}} ||
||<:>{{attachment:xcoord.png}} ||<:>{{attachment:ycoord.png}}||
||{{{ e.process_inplace("testimage.gradient")}}}||{{{ e.process_inplace("testimage.gradient", {'axis':'y'}) }}}||
||<:>{{attachment:axes.png}}||<:>{{attachment:circle.png}} ||
Line 57: Line 89:
||{{attachment:scurve.png}}|| {{attachment:gaussnoise_large.png}}|| ||<:>{{attachment:scurve.png}}||<:>{{attachment:gaussnoise_large.png}}||
Line 62: Line 94:
{{{ {{{#!python
Line 71: Line 103:
{{{ {{{#!python
Line 79: Line 111:

= 3D =

To come

Python test images

EMAN2 includes a good selection of test images. They come in many shapes and forms, from simple gradients and shapes to basic noise models.

test_image (2D)

At present there are 10 2D test images that are accessible using the test_image function, which is defined in EMAN2.py.

   1 #] e2.py
   2 
   3 Welcome to EMAN2
   4 Prompt provided by IPython
   5 Enter '?' for ipython help
   6 
   7 In [3]: e = test_image(0,size=(256,256))
   8 
   9 In [4]: display(e)

If you don't specify the size argument the returned image is 128x128. The following table shows each of the currently defined test_images.

test_0.png

test_1.png

test_image(0): The EMAN scurve

test_image(1): Gaussian noise

test_2.png

test_3.png

test_image(2): Dark square

test_image(3): Light square

test_4.png

test_5.png

test_image(4): Scurve and random frequency line wave

test_image(5): Axes

test_6.png

test_7.png

test_image(6): Random frequency line wave

test_image(7): Scurve and directional gradient

test_8.png

test_9.png

test_image(8): Randomly rotated, mirrored and translated scurve

test_image(9): Scurve and Gaussian noise

test_image_3d (3D)

At present there are 6 3D test images that are accessible using the test_image_3d function, which is defined in EMAN2.py.

   1 #] e2.py
   2 
   3 Welcome to EMAN2
   4 Prompt provided by IPython
   5 Enter '?' for ipython help
   6 
   7 In [3]: e = test_image_3d(0)
   8 
   9 In [4]: display(e)

The following table shows the currently available 3D test images.

test_3d_0.png

test_3d_1.png

test_image_3d(0): Axes

test_image_3d(1): Spherical waves

test_3d_2.png

test_3d_3.png

test_image_3d(2): Tomography test image

test_image_3d(3): Solid cube

test_3d_4.png

test_3d_5.png

test_image_3d(4): Solid sphere

test_image_3d(5): Rotated ellipse with holes

Using the processor framework

2D

To create a test image using the processor framework start by running e2.py and by creating an empty image that is appropriately sized, for example as follows:

   1 #] e2.py
   2 
   3 Welcome to EMAN2
   4 Prompt provided by IPython
   5 Enter '?' for ipython help
   6 
   7 In [3]: e = EMData()
   8 
   9 In [4]: e.set_size(256,256)

Then issue one of the commands shown below in the table to generate the test image

xcoord.png

ycoord.png

 e.process_inplace("testimage.gradient")

 e.process_inplace("testimage.gradient", {'axis':'y'}) 

axes.png

circle.png

 e.process_inplace("testimage.axes")

 e.process_inplace("testimage.circlesphere") 

scurve.png

gaussnoise_large.png

 e.process_inplace("testimage.scurve")

 e.process_inplace("testimage.noise.gauss") 

Note that this is not all of the test images, and that you can get a complete list by typying e2help.py processors on the command prompt (or see http://blake.bcm.edu/eman2/processors.html). Finally, you can display the image

   1 In [5]: e.process_inplace("testimage.scurve")
   2 
   3 In [6]: display(e)

You can write the image to disk if you need to:

   1 In [7]: e.write_image("scurve.img")
   2 
   3 In [8]: e.write_image("scurve.mrc")

Also, a great many of the test images work on 3D (and 1D) images, so feel free to play around.

EMAN2/Galleries/Testimages (last edited 2009-04-11 00:48:59 by DavidWoolford)