This example runs each of the filters wrapped from ITK.
#Example a/testing/image_processing_2D.com: Testing all the cmiss operations with computed fields. { my $filename; my %filter_tests; # Each key will generate a new test with the filename and parameters given. # The keys are listed alphabetically, add new filters to be tested in the # correct place so that missing filters can be easily identified. # binary dilate image filter $filter_tests{'binary_dilate_1.png'} = ['binary_dilate', 'dilate_value 1 radius 1']; $filter_tests{'binary_dilate_3.png'} = ['binary_dilate', 'dilate_value 1 radius 3']; # binary erode image filter $filter_tests{'binary_erode_1.png'} = ['binary_erode', 'erode_value 1 radius 1']; $filter_tests{'binary_erode_3.png'} = ['binary_erode', 'erode_value 1 radius 3']; # binary threshold image filter $filter_tests{'threshold_0.5.png'} = ['binary_threshold_filter', 'lower_threshold 0.5']; $filter_tests{'threshold_0.4_0.6.png'} = ['binary_threshold_filter', 'lower_threshold 0.4 upper_threshold 0.6']; # canny edge image filter $filter_tests{'canny_edge.png'} = ['canny_edge_detection_filter', '']; # connected threshold image filter $filter_tests{'connected_threshold.png'} = ['connected_threshold', 'lower_threshold 0.5 upper_threshold 1 num_seed_points 1 dimension 2 seed_points 0.5 0.2']; # curvature anisotropic diffusion image filter $filter_tests{'curvature_anisotropic_diffusion.png'} = ['curvature_anisotropic_diffusion', '']; # derivative image filter $filter_tests{'derivative_y.png'} = ['derivative', 'xi_index 2']; # discrete gaussian image filter $filter_tests{'discrete_gaussian.png'} = ['discrete_gaussian', 'variance 3 max_kernel_width 6']; # fast marching image filter $filter_tests{'fast_marching.png'} = ['fast_marching', 'num_seed_points 1 dimension 2 seed_points 0.5 0.2 ']; # gradient magnitude recursive gaussian image filter $filter_tests{'gradient_magnitude_recursive_gaussian.png'} = ['gradient_magnitude_recursive_gaussian', '']; # histogram image filter $filter_tests{'histogram64.png'} = ['histogram', 'number_of_bins 64']; $filter_tests{'histogram8.png'} = ['histogram', 'number_of_bins 8']; $filter_tests{'histogram8minmax.png'} = ['histogram', 'number_of_bins 8 histogram_minimum -0.25 histogram_maximum 1.5']; # image resample $filter_tests{'resample.png'} = ['image_resample', 'sizes 64 64']; # mean image filter $filter_tests{'mean_1.png'} = ['mean_filter', 'radius_sizes 1 1']; $filter_tests{'mean_3.png'} = ['mean_filter', 'radius_sizes 3 3']; # rescale intensity image filter $filter_tests{'rescale_intensity.png'} = ['rescale_intensity', 'output_min 0.5 output_max 0.7']; # sigmoid image filter $filter_tests{'sigmoid_0_1_0.1_0.7.png'} = ['sigmoid_filter', 'minimum 0.0 maximum 1.0 alpha 0.1 beta 0.7']; # threshold filter $filter_tests{'threshold_below_0.3.png'} = ['threshold_filter', 'below below_value 0.3 outside_value 0.0']; $filter_tests{'threshold_above_0.6.png'} = ['threshold_filter', 'above above_value 0.6 outside_value 0.0']; $filter_tests{'threshold_outside_0.3_0.6.png'} = ['threshold_filter', 'outside below_value 0.3 above_value 0.6 outside_value 0.0']; sub test_filter { my $filename = shift; my $filter_name = shift; my $parameters = shift; print "$filter_name => $filename \'$parameters\'\n"; cmiss::cmiss("gfx define field intermediate_image $filter_name field input_image $parameters"); gfx modify texture output_image nearest width 1 height 1 evaluate_image field intermediate_image spectrum gray_spectrum texture_coord xi element_group square; gfx write texture output_image file $filename; } # Read in a mesh which is currently required for cmiss. gfx read nodes $example/square.exnode gfx read elements $example/square.exelem gfx create texture original image $example/cmiss_2D_test.png nearest width 1 height 1; gfx define field input_image sample_texture coordinate xi field original; #Just set up a dummy image of the correct size gfx create texture output_image image $example/cmiss_2D_test.png specify_format i nearest width 1 height 1; gfx create spectrum gray_spectrum clear overwrite_colour gfx modify spectrum gray_spectrum linear range 0 1 extend_above extend_below monochrome colour_range 0 1 ambient diffuse component 1 for $filename (sort keys %filter_tests) { test_filter($filename, ${$filter_tests{$filename}}[0], ${$filter_tests{$filename}}[1]); } print "derivative => derivative_x.png 'xi_index 1'\n"; gfx define field intermediate_image1 derivative field input_image xi_index 1 gfx modify texture output_image nearest width 1 height 1 evaluate_image field intermediate_image1 spectrum gray_spectrum texture_coord xi element_group square; gfx write texture output_image file derivative_x.png; }
Name Modified Size
image_processing_2D.com 17-Mar-2014 4.6k COPYRIGHT 17-Mar-2014 504 cmiss_2D_test.png 17-Mar-2014 1.7k square.exelem 17-Mar-2014 1.5k square.exnode 17-Mar-2014 400
Name Modified Size
examples_a_testing_image_processing_2D.tar.gz 09-Mar-2016 7.4k
Status | Tested | Real time (s) | |
i686-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:05:57 2016 | 1 |
last break | Mon Aug 25 13:15:00 2014 | 3 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:09:42 2016 | 2 |
last break | Mon Aug 25 13:00:00 2014 | 5 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:10:26 2016 | 2 |
last break | Mon Aug 25 13:00:00 2014 | 4 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 01:26:11 2016 | 83 |
last break | Tue Feb 24 00:31:00 2015 | 87 | |
x86_64-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:01:34 2016 | 0 |
last break | Fri Aug 15 00:43:00 2014 | 1 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:01:48 2016 | 1 |
last break | Fri Aug 15 00:43:00 2014 | 1 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:01:34 2016 | 1 |
last break | Fri Aug 15 00:43:00 2014 | 1 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 00:07:19 2016 | 68 |
last break | Sun Mar 6 00:06:00 2016 | 68 |
i686-linux | |||
Failure | cmgui-wx: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-memorycheck: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. | |
x86_64-linux | |||
Failure | cmgui-wx: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-memorycheck: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. |
Html last generated: Wed Mar 9 16:02:45 2016
Input last modified: Wed Mar 9 15:49:35 2016