{"id":540,"date":"2012-04-10T07:45:46","date_gmt":"2012-04-10T11:45:46","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/?p=540"},"modified":"2019-10-31T14:45:59","modified_gmt":"2019-10-31T18:45:59","slug":"imzoneplate-on-the-file-exchange","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2012\/04\/10\/imzoneplate-on-the-file-exchange\/","title":{"rendered":"imzoneplate on the File Exchange"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p>Last year I <a href=\"https:\/\/blogs.mathworks.com\/steve\/2011\/07\/19\/jahne-test-pattern-take-3\/\">posted a few times<\/a> about the \"J&auml;hne test pattern,\" something that readers then told me was called a zone plate. This is a radial sinusoid pattern\r\n      with low frequency in the middle of the image and high frequency toward the edges.\r\n   <\/p>\r\n  \r\n   <p>In my 02-Jul-2012 post, <a href=\"https:\/\/blogs.mathworks.com\/steve\/2011\/07\/22\/filtering-fun\/\">Filtering fun<\/a>, I used the zone plate image to illustrate the effects of different kinds of frequency-selective filtering.\r\n   <\/p>\r\n   <p>Lowpass:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_02.jpg\"> <\/p>\r\n   <p>Bandpass:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_04.jpg\"> <\/p>\r\n   <p>Directional:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_09.jpg\"> <\/p>\r\n   <p>Last week I submitted a function called <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35961-zone-plate-test-image\"><tt>imzoneplate<\/tt><\/a> to the MATLAB Central File Exchange.\r\n   <\/p>\r\n   <p>I resisted the urge to give <tt>imzoneplate<\/tt> a lot of optional parameters. Instead there's only one, the size of the image.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">imshow(imzoneplate(301))<\/pre><p>Here's a smaller zone plate image and its horizontal cross-section.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">I = imzoneplate(151);\r\nimshow(I)<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">plot(I(76,:))<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2012\/zone_plate_02.jpg\"> <p>Let's zoom in at the edge of the plot.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">xlim([140 151])<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2012\/zone_plate_03.jpg\"> <p>You can see that, with the parameters I've chosen for <tt>imzoneplate<\/tt>, the sinusoidal period decreases to about 3 samples at the edge of the image.\r\n   <\/p>\r\n   <p>Be sure to download <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35961-zone-plate-test-image\"><tt>imzoneplate<\/tt><\/a> and give it a try. Post a comment here if you have a particular application for it.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_8df1554297904ad696551a3b286b5931() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='8df1554297904ad696551a3b286b5931 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 8df1554297904ad696551a3b286b5931';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Steve Eddins';\r\n        copyright = 'Copyright 2012 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_8df1554297904ad696551a3b286b5931()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p>\r\n<\/div>\r\n<!--\r\n8df1554297904ad696551a3b286b5931 ##### SOURCE BEGIN #####\r\n%%\r\n% Last year I\r\n% <https:\/\/blogs.mathworks.com\/steve\/2011\/07\/19\/jahne-test-pattern-take-3\/\r\n% posted a few times> about the \"J\u00c3\u00a4hne test pattern,\" something that\r\n% readers then told me was called a zone plate. This is a radial sinusoid\r\n% pattern with low frequency in the middle of the image and high frequency\r\n% toward the edges:\r\n%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/35961\/1\/preview.jpg>>\r\n%\r\n% In my 02-Jul-2012 post, <https:\/\/blogs.mathworks.com\/steve\/2011\/07\/22\/filtering-fun\/ \r\n% Filtering fun>, I used the zone plate image to\r\n% illustrate the effects of different kinds of frequency-selective\r\n% filtering.\r\n%\r\n% Lowpass:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_02.jpg>>\r\n%\r\n% Bandpass:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_04.jpg>>\r\n%\r\n% Directional:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2011\/filtering_fun_09.jpg>>\r\n%\r\n% Last week I submitted a function called\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35961-zone-plate-test-image\r\n% |imzoneplate|> to the MATLAB Central File Exchange. \r\n%\r\n% I resisted the urge to give |imzoneplate| a lot of optional parameters.\r\n% Instead there's only one, the size of the image.\r\n\r\nimshow(imzoneplate(301))\r\n\r\n%%\r\n% Here's a smaller zone plate image and its horizontal cross-section.\r\n\r\nI = imzoneplate(151);\r\nimshow(I)\r\n\r\n%%\r\nplot(I(76,:))\r\n\r\n%%\r\n% Let's zoom in at the edge of the plot.\r\n\r\nxlim([140 151])\r\n\r\n%%\r\n% You can see that, with the parameters I've chosen for |imzoneplate|, the\r\n% sinusoidal period decreases to about 3 samples at the edge of the image.\r\n%\r\n% Be sure to download <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35961-zone-plate-test-image\r\n% |imzoneplate|> and give it a try. Post a comment here if you have a\r\n% particular application for it.\r\n##### SOURCE END ##### 8df1554297904ad696551a3b286b5931\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   Last year I posted a few times about the \"J&auml;hne test pattern,\" something that readers then told me was called a zone plate. This is a radial sinusoid pattern\r\n      with low frequency in... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2012\/04\/10\/imzoneplate-on-the-file-exchange\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[36,68,360],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/540"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":2465,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/540\/revisions\/2465"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}