{"action":"created","comment":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/comments/48012098","id":48012098,"diff_hunk":"@@ -0,0 +1,459 @@\n+# Copyright 2014, 2015 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+\"\"\"Detectors.\"\"\"\n+\n+# Imports for common Python 2/3 codebase\n+from __future__ import print_function, division, absolute_import\n+from abc import ABCMeta, abstractmethod, abstractproperty\n+from future import standard_library\n+standard_library.install_aliases()\n+from future.utils import with_metaclass\n+from builtins import object, super\n+\n+# External\n+import numpy as np\n+\n+# Internal\n+from odl.set.domain import IntervalProd\n+from odl.discr.grid import TensorGrid\n+\n+\n+__all__ = ('Detector', 'LineDetector', 'Flat2dDetector',\n+           'CircleSectionDetector')\n+\n+\n+class Detector(with_metaclass(ABCMeta, object)):\n+\n+    \"\"\"Abstract detector class.\n+\n+    A detector is described by\n+\n+    * a dimension parameter,\n+    * a set of parameters for surface parametrization,\n+    * a function mapping motion and surface parameters to the location\n+      of a detector point relative to the reference point,\n+    * optionally a surface measure function defined on the surface\n+      parametrization parameters only\n+    * optionally a sampling grid for the parameters\n+    \"\"\"\n+\n+    def __init__(self, params, grid=None):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        params : `IntervalProd`\n+            The parameter set defining the detector area\n+        grid : `TensorGrid`, optional\n+            A sampling grid for the parameter set, in which it must be\n+            contained\n+        \"\"\"\n+        if not isinstance(params, IntervalProd):\n+            raise TypeError('parameter set {} is not a an interval product.'\n+                            ''.format(params))\n+\n+        if grid is not None:\n+            if not isinstance(grid, TensorGrid):\n+                raise TypeError('grid {} is not a `TensorGrid` instance.'\n+                                ''.format(grid))\n+            if not params.contains_set(grid):\n+                raise ValueError('grid {} not contained in parameter set {}.'\n+                                 ''.format(grid, params))\n+\n+        self._params = params\n+        self._param_grid = grid\n+\n+    @abstractproperty\n+    def ndim(self):","path":"odl/tomo/geometry/detector.py","position":82,"original_position":82,"commit_id":"3ffe1a6235efffa1605f2d6301b0345d99891c86","original_commit_id":"3ffe1a6235efffa1605f2d6301b0345d99891c86","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":"I'd prefer if this was not a `@abstractproperty` but that it was instead set by a call to `super().__init__` in subclasses, that way we dont need to write this all over the place and can have the doc (and tests) in one place.","created_at":"2015-12-18T10:23:14Z","updated_at":"2015-12-18T10:23:14Z","html_url":"https://github.com/odlgroup/odl/pull/178#discussion_r48012098","pull_request_url":"https://api.github.com/repos/odlgroup/odl/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments/48012098"},"html":{"href":"https://github.com/odlgroup/odl/pull/178#discussion_r48012098"},"pull_request":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/178","id":54007567,"html_url":"https://github.com/odlgroup/odl/pull/178","diff_url":"https://github.com/odlgroup/odl/pull/178.diff","patch_url":"https://github.com/odlgroup/odl/pull/178.patch","issue_url":"https://api.github.com/repos/odlgroup/odl/issues/178","number":178,"state":"open","locked":false,"title":"Issue 87  conebeam","user":{"login":"moosmann","id":6815901,"avatar_url":"https://avatars.githubusercontent.com/u/6815901?v=3","gravatar_id":"","url":"https://api.github.com/users/moosmann","html_url":"https://github.com/moosmann","followers_url":"https://api.github.com/users/moosmann/followers","following_url":"https://api.github.com/users/moosmann/following{/other_user}","gists_url":"https://api.github.com/users/moosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/moosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moosmann/subscriptions","organizations_url":"https://api.github.com/users/moosmann/orgs","repos_url":"https://api.github.com/users/moosmann/repos","events_url":"https://api.github.com/users/moosmann/events{/privacy}","received_events_url":"https://api.github.com/users/moosmann/received_events","type":"User","site_admin":false},"body":"The ASTRA wrapper functions and related geometries are implemented. Tests and builds are working. However, there are inconsistencies within the geometry module. On the one hand because cone beam geometries are now using the ASTRA convention regarding the initial orientation of source and detector. (This was a quick fix to get ASTRA running with the helical cone beam geometry). On the other because the geometry class functions for the detector rotation, the source position, the detector position, the detector to source vector, etc are not working properly and/or need to be modified for rotations about arbitrary axes.\r\n\r\n### TODO\r\n- [ ] ASTRA data wrapping\r\n- [ ] Thin wrapper for ASTRA #152 \r\n- [ ] Curved detectors\r\n- [ ] Scaling of projectors to get the adjoint right\r\n- [ ] Non-isotropic voxels\r\n- [ ] Rotation about an arbitrary axis in 3D\r\n- [ ] Convenience function to create geometries\r\n- [ ] Consistent geometries\r\n- [ ] More comprehensive tests\r\n- [ ] ...\r\n\r\n","created_at":"2015-12-17T17:39:21Z","updated_at":"2015-12-18T10:23:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odlgroup/odl/pulls/178/commits","review_comments_url":"https://api.github.com/repos/odlgroup/odl/pulls/178/comments","review_comment_url":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odlgroup/odl/issues/178/comments","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/3ffe1a6235efffa1605f2d6301b0345d99891c86","head":{"label":"odlgroup:issue-87__conebeam","ref":"issue-87__conebeam","sha":"3ffe1a6235efffa1605f2d6301b0345d99891c86","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}","created_at":"2015-11-05T07:57:55Z","updated_at":"2015-12-08T12:12:11Z","pushed_at":"2015-12-18T10:19:50Z","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":13903,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":64,"forks":2,"open_issues":64,"watchers":2,"default_branch":"master"}},"base":{"label":"odlgroup:master","ref":"master","sha":"bfd232352725f67ce45e2ffa4288e115ea1dfbc1","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}","created_at":"2015-11-05T07:57:55Z","updated_at":"2015-12-08T12:12:11Z","pushed_at":"2015-12-18T10:19:50Z","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":13903,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":64,"forks":2,"open_issues":64,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/178"},"html":{"href":"https://github.com/odlgroup/odl/pull/178"},"issue":{"href":"https://api.github.com/repos/odlgroup/odl/issues/178"},"comments":{"href":"https://api.github.com/repos/odlgroup/odl/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/odlgroup/odl/statuses/3ffe1a6235efffa1605f2d6301b0345d99891c86"}}}}