{"action":"created","comment":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/comments/92168549","pull_request_review_id":12677798,"id":92168549,"diff_hunk":"@@ -0,0 +1,86 @@\n+# Copyright 2014-2016 The ODL development group\n+#\n+# This file is part of ODL.\n+#\n+# ODL is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# ODL is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with ODL.  If not, see <http://www.gnu.org/licenses/>.\n+\n+\"\"\"\n+Example using a filtered backprojection (FBP) in helical 3d using `fbp_op`.\n+\n+Note that the FBP is only approximate in this geometry, but still gives a\n+decent reconstruction that can be used as an initial guess in more complicated\n+methods.\n+\n+In helical geometries, the data is in general over-sampled which causes\n+streaking artefacts and a wrong scaling. This can be reduced using a\n+Tam-Danielson window.\n+\"\"\"\n+\n+import numpy as np\n+import odl\n+\n+\n+# --- Set-up geometry of the problem --- #\n+\n+\n+# Discrete reconstruction space: discretized functions on the cube\n+# [-20, 20]^2 x [0, 40] with 300 samples per dimension.\n+reco_space = odl.uniform_discr(\n+    min_pt=[-20, -20, 0], max_pt=[20, 20, 40], shape=[300, 300, 300],\n+    dtype='float32')\n+\n+# Make a helical cone beam geometry with flat detector\n+# Angles: uniformly spaced, n = 2000, min = 0, max = 8 * 2 * pi\n+angle_partition = odl.uniform_partition(0, 8 * 2 * np.pi, 2000)\n+# Detector: uniformly sampled, n = (558, 60), min = (-30, -4), max = (30, 4)\n+detector_partition = odl.uniform_partition([-40, -4], [40, 4], [558, 60])\n+# Spiral has a pitch of 5, we run 8 rounds (due to max angle = 8 * 2 * pi)\n+geometry = odl.tomo.HelicalConeFlatGeometry(\n+    angle_partition, detector_partition, src_radius=100, det_radius=100,\n+    pitch=5.0)\n+\n+\n+# --- Create FilteredBackProjection (FBP) operator --- #\n+\n+\n+# Ray transform (= forward projection). We use the ASTRA CUDA backend.\n+ray_trafo = odl.tomo.RayTransform(reco_space, geometry, impl='astra_cuda')\n+\n+# Unwindowed fbp\n+fbp = odl.tomo.fbp_op(ray_trafo, filter_type='Hann', filter_cutoff=0.8)\n+\n+# Create Tam-Danielson window to improve result\n+windowed_fbp = fbp * odl.tomo.tam_danielson_window(ray_trafo)\n+\n+\n+# --- Show some examples --- #\n+\n+\n+# Create a discrete Shepp-Logan phantom (modified version)\n+phantom = odl.phantom.shepp_logan(reco_space, modified=True)\n+\n+# Create projection data by calling the ray transform on the phantom\n+proj_data = ray_trafo(phantom)\n+\n+# Calculate filtered backprojection of data\n+fbp_reconstruction = fbp(proj_data)\n+w_fbp_reconstruction = windowed_fbp(proj_data)\n+\n+# Shows a slice of the phantom, projections, and reconstruction\n+phantom.show(title='Phantom')\n+proj_data.show(title='Projection data (sinogram)')","path":"examples/tomo/filtered_backprojection_helical_3d.py","position":82,"original_position":82,"commit_id":"379a5d0ea74555e24a5ee1ac9fafceed25937929","original_commit_id":"379a5d0ea74555e24a5ee1ac9fafceed25937929","user":{"login":"kohr-h","id":5030250,"avatar_url":"https://avatars.githubusercontent.com/u/5030250?v=3","gravatar_id":"","url":"https://api.github.com/users/kohr-h","html_url":"https://github.com/kohr-h","followers_url":"https://api.github.com/users/kohr-h/followers","following_url":"https://api.github.com/users/kohr-h/following{/other_user}","gists_url":"https://api.github.com/users/kohr-h/gists{/gist_id}","starred_url":"https://api.github.com/users/kohr-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohr-h/subscriptions","organizations_url":"https://api.github.com/users/kohr-h/orgs","repos_url":"https://api.github.com/users/kohr-h/repos","events_url":"https://api.github.com/users/kohr-h/events{/privacy}","received_events_url":"https://api.github.com/users/kohr-h/received_events","type":"User","site_admin":false},"body":"In 2D it's equivalent ;-), so needs fix only in 3D","created_at":"2016-12-13T13:34:55Z","updated_at":"2016-12-13T13:34:55Z","html_url":"https://github.com/odlgroup/odl/pull/756#discussion_r92168549","pull_request_url":"https://api.github.com/repos/odlgroup/odl/pulls/756","_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments/92168549"},"html":{"href":"https://github.com/odlgroup/odl/pull/756#discussion_r92168549"},"pull_request":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/756"}}},"pull_request":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/756","id":97318275,"html_url":"https://github.com/odlgroup/odl/pull/756","diff_url":"https://github.com/odlgroup/odl/pull/756.diff","patch_url":"https://github.com/odlgroup/odl/pull/756.patch","issue_url":"https://api.github.com/repos/odlgroup/odl/issues/756","number":756,"state":"open","locked":false,"title":"Add filter to fbp","user":{"login":"adler-j","id":2202312,"avatar_url":"https://avatars.githubusercontent.com/u/2202312?v=3","gravatar_id":"","url":"https://api.github.com/users/adler-j","html_url":"https://github.com/adler-j","followers_url":"https://api.github.com/users/adler-j/followers","following_url":"https://api.github.com/users/adler-j/following{/other_user}","gists_url":"https://api.github.com/users/adler-j/gists{/gist_id}","starred_url":"https://api.github.com/users/adler-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adler-j/subscriptions","organizations_url":"https://api.github.com/users/adler-j/orgs","repos_url":"https://api.github.com/users/adler-j/repos","events_url":"https://api.github.com/users/adler-j/events{/privacy}","received_events_url":"https://api.github.com/users/adler-j/received_events","type":"User","site_admin":false},"body":"* Adds filters, the same as in matlab, to `fbp_op`. Frequency response as follows:\r\n\r\n![filters](https://cloud.githubusercontent.com/assets/2202312/21112236/4f6b86a2-c0a5-11e6-904f-710385cf89c3.png)\r\n\r\n* Adds `tam_danielson_window` which allows good helical reconstructions.\r\n\r\nHelical reconstruction before windowing:\r\n\r\n![filtered_backprojection](https://cloud.githubusercontent.com/assets/2202312/21110202/92e48c70-c09c-11e6-9cd7-88b09b79ed87.png)\r\n\r\nAfter windowing:\r\n\r\n![windowed_filtered_backprojection](https://cloud.githubusercontent.com/assets/2202312/21110208/953e96e6-c09c-11e6-972c-f732da9d91be.png)\r\n\r\nas you can see the results are basically \"perfect\".","created_at":"2016-12-09T14:29:31Z","updated_at":"2016-12-13T13:34:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7510bdd90cde2a9831bcbe2bfeab66ebde5c7c85","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/odlgroup/odl/pulls/756/commits","review_comments_url":"https://api.github.com/repos/odlgroup/odl/pulls/756/comments","review_comment_url":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odlgroup/odl/issues/756/comments","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/379a5d0ea74555e24a5ee1ac9fafceed25937929","head":{"label":"odlgroup:add_filter_to_fbp","ref":"add_filter_to_fbp","sha":"379a5d0ea74555e24a5ee1ac9fafceed25937929","user":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45596393,"name":"odl","full_name":"odlgroup/odl","owner":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odlgroup/odl","description":"Operator Discretization Library","fork":false,"url":"https://api.github.com/repos/odlgroup/odl","forks_url":"https://api.github.com/repos/odlgroup/odl/forks","keys_url":"https://api.github.com/repos/odlgroup/odl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odlgroup/odl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odlgroup/odl/teams","hooks_url":"https://api.github.com/repos/odlgroup/odl/hooks","issue_events_url":"https://api.github.com/repos/odlgroup/odl/issues/events{/number}","events_url":"https://api.github.com/repos/odlgroup/odl/events","assignees_url":"https://api.github.com/repos/odlgroup/odl/assignees{/user}","branches_url":"https://api.github.com/repos/odlgroup/odl/branches{/branch}","tags_url":"https://api.github.com/repos/odlgroup/odl/tags","blobs_url":"https://api.github.com/repos/odlgroup/odl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odlgroup/odl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odlgroup/odl/git/refs{/sha}","trees_url":"https://api.github.com/repos/odlgroup/odl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/{sha}","languages_url":"https://api.github.com/repos/odlgroup/odl/languages","stargazers_url":"https://api.github.com/repos/odlgroup/odl/stargazers","contributors_url":"https://api.github.com/repos/odlgroup/odl/contributors","subscribers_url":"https://api.github.com/repos/odlgroup/odl/subscribers","subscription_url":"https://api.github.com/repos/odlgroup/odl/subscription","commits_url":"https://api.github.com/repos/odlgroup/odl/commits{/sha}","git_commits_url":"https://api.github.com/repos/odlgroup/odl/git/commits{/sha}","comments_url":"https://api.github.com/repos/odlgroup/odl/comments{/number}","issue_comment_url":"https://api.github.com/repos/odlgroup/odl/issues/comments{/number}","contents_url":"https://api.github.com/repos/odlgroup/odl/contents/{+path}","compare_url":"https://api.github.com/repos/odlgroup/odl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odlgroup/odl/merges","archive_url":"https://api.github.com/repos/odlgroup/odl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odlgroup/odl/downloads","issues_url":"https://api.github.com/repos/odlgroup/odl/issues{/number}","pulls_url":"https://api.github.com/repos/odlgroup/odl/pulls{/number}","milestones_url":"https://api.github.com/repos/odlgroup/odl/milestones{/number}","notifications_url":"https://api.github.com/repos/odlgroup/odl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odlgroup/odl/labels{/name}","releases_url":"https://api.github.com/repos/odlgroup/odl/releases{/id}","deployments_url":"https://api.github.com/repos/odlgroup/odl/deployments","created_at":"2015-11-05T07:57:55Z","updated_at":"2016-11-03T16:59:19Z","pushed_at":"2016-12-13T12:51:12Z","git_url":"git://github.com/odlgroup/odl.git","ssh_url":"git@github.com:odlgroup/odl.git","clone_url":"https://github.com/odlgroup/odl.git","svn_url":"https://github.com/odlgroup/odl","homepage":null,"size":38087,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":137,"forks":7,"open_issues":137,"watchers":15,"default_branch":"master"}},"base":{"label":"odlgroup:master","ref":"master","sha":"7d16e40f50f35e4990f0d5503c31638aa0c0b1fa","user":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45596393,"name":"odl","full_name":"odlgroup/odl","owner":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odlgroup/odl","description":"Operator Discretization Library","fork":false,"url":"https://api.github.com/repos/odlgroup/odl","forks_url":"https://api.github.com/repos/odlgroup/odl/forks","keys_url":"https://api.github.com/repos/odlgroup/odl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odlgroup/odl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odlgroup/odl/teams","hooks_url":"https://api.github.com/repos/odlgroup/odl/hooks","issue_events_url":"https://api.github.com/repos/odlgroup/odl/issues/events{/number}","events_url":"https://api.github.com/repos/odlgroup/odl/events","assignees_url":"https://api.github.com/repos/odlgroup/odl/assignees{/user}","branches_url":"https://api.github.com/repos/odlgroup/odl/branches{/branch}","tags_url":"https://api.github.com/repos/odlgroup/odl/tags","blobs_url":"https://api.github.com/repos/odlgroup/odl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odlgroup/odl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odlgroup/odl/git/refs{/sha}","trees_url":"https://api.github.com/repos/odlgroup/odl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/{sha}","languages_url":"https://api.github.com/repos/odlgroup/odl/languages","stargazers_url":"https://api.github.com/repos/odlgroup/odl/stargazers","contributors_url":"https://api.github.com/repos/odlgroup/odl/contributors","subscribers_url":"https://api.github.com/repos/odlgroup/odl/subscribers","subscription_url":"https://api.github.com/repos/odlgroup/odl/subscription","commits_url":"https://api.github.com/repos/odlgroup/odl/commits{/sha}","git_commits_url":"https://api.github.com/repos/odlgroup/odl/git/commits{/sha}","comments_url":"https://api.github.com/repos/odlgroup/odl/comments{/number}","issue_comment_url":"https://api.github.com/repos/odlgroup/odl/issues/comments{/number}","contents_url":"https://api.github.com/repos/odlgroup/odl/contents/{+path}","compare_url":"https://api.github.com/repos/odlgroup/odl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odlgroup/odl/merges","archive_url":"https://api.github.com/repos/odlgroup/odl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odlgroup/odl/downloads","issues_url":"https://api.github.com/repos/odlgroup/odl/issues{/number}","pulls_url":"https://api.github.com/repos/odlgroup/odl/pulls{/number}","milestones_url":"https://api.github.com/repos/odlgroup/odl/milestones{/number}","notifications_url":"https://api.github.com/repos/odlgroup/odl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odlgroup/odl/labels{/name}","releases_url":"https://api.github.com/repos/odlgroup/odl/releases{/id}","deployments_url":"https://api.github.com/repos/odlgroup/odl/deployments","created_at":"2015-11-05T07:57:55Z","updated_at":"2016-11-03T16:59:19Z","pushed_at":"2016-12-13T12:51:12Z","git_url":"git://github.com/odlgroup/odl.git","ssh_url":"git@github.com:odlgroup/odl.git","clone_url":"https://github.com/odlgroup/odl.git","svn_url":"https://github.com/odlgroup/odl","homepage":null,"size":38087,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":137,"forks":7,"open_issues":137,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/756"},"html":{"href":"https://github.com/odlgroup/odl/pull/756"},"issue":{"href":"https://api.github.com/repos/odlgroup/odl/issues/756"},"comments":{"href":"https://api.github.com/repos/odlgroup/odl/issues/756/comments"},"review_comments":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/756/comments"},"review_comment":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/756/commits"},"statuses":{"href":"https://api.github.com/repos/odlgroup/odl/statuses/379a5d0ea74555e24a5ee1ac9fafceed25937929"}}}}
{"actor":{"display_login":"kohr-h"}}