{"action":"created","comment":{"url":"https://api.github.com/repos/Slicer/Slicer/pulls/comments/199905498","pull_request_review_id":134109605,"id":199905498,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTkwNTQ5OA==","diff_hunk":"@@ -0,0 +1,803 @@\n+/*==============================================================================\n+\n+  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)\n+  Queen's University, Kingston, ON, Canada. All Rights Reserved.\n+\n+  See COPYRIGHT.txt\n+  or http://www.slicer.org/copyright/copyright.txt for details.\n+\n+  Unless required by applicable law or agreed to in writing, software\n+  distributed under the License is distributed on an \"AS IS\" BASIS,\n+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+  See the License for the specific language governing permissions and\n+  limitations under the License.\n+\n+  This file was originally developed by Csaba Pinter, PerkLab, Queen's University\n+  and was supported through the Applied Cancer Research Unit program of Cancer Care\n+  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care\n+  and CANARIE.\n+\n+==============================================================================*/\n+\n+// Segmentations includes\n+#include \"qMRMLSegmentationGeometryWidget.h\"\n+\n+#include \"ui_qMRMLSegmentationGeometryWidget.h\"\n+\n+#include \"vtkSlicerSegmentationsModuleLogic.h\"\n+#include \"vtkMRMLSegmentationNode.h\"\n+\n+// SegmentationCore includes\n+#include \"vtkSegmentation.h\"\n+#include \"vtkSegmentationConverter.h\"\n+#include \"vtkOrientedImageData.h\"\n+#include \"vtkOrientedImageDataResample.h\"\n+#include \"vtkCalculateOversamplingFactor.h\"\n+\n+// MRML includes\n+#include \"vtkMRMLScalarVolumeNode.h\"\n+#include \"vtkMRMLTransformNode.h\"\n+#include \"vtkMRMLAnnotationROINode.h\"\n+#include \"vtkMRMLModelNode.h\"\n+\n+// VTK includes\n+#include <vtkWeakPointer.h>\n+#include <vtkMatrix4x4.h>\n+#include <vtkTransform.h>\n+#include <vtkGeneralTransform.h>\n+#include <vtkAddonMathUtilities.h>\n+\n+// Qt includes\n+#include <QDebug>\n+\n+//-----------------------------------------------------------------------------\n+class qMRMLSegmentationGeometryWidgetPrivate: public Ui_qMRMLSegmentationGeometryWidget\n+{\n+  Q_DECLARE_PUBLIC(qMRMLSegmentationGeometryWidget);\n+\n+protected:\n+  qMRMLSegmentationGeometryWidget* const q_ptr;\n+public:\n+  qMRMLSegmentationGeometryWidgetPrivate(qMRMLSegmentationGeometryWidget& object);\n+  virtual ~qMRMLSegmentationGeometryWidgetPrivate();\n+  void init();\n+\n+  /// Calculate output geometry into \\sa GeometryImageData based on selection\n+  /// \\return Error message. Empty when successful\n+  QString calculateOutputGeometry();\n+\n+  /// Fill geometry info section from geometry image data containing geometry information \\sa GeometryImageData\n+  void updateGeometryWidgets();\n+\n+  /// Reset geometry image data \\sa GeometryImageData\n+  void resetGeometryImageData();\n+\n+  /// Determine if source node is a non-empty segmentation with a labelmap master\n+  bool isSourceASegmentationWithBinaryLabelmapMaster();\n+\n+  /// Determine if input segmentation is non-empty, and with binary labelmap master\n+  bool inputSegmentationCanBeResampled();\n+\n+  // Match the axes of the input labelmap to the axes of the transformed source node.\n+  // Use this calculated permutation for updating spacing widget from geometry and interpreting spacing input\n+  void matchInputAndSourceAxes(vtkMRMLNode* sourceNode);\n+\n+public:\n+  /// Segmentation MRML node\n+  vtkWeakPointer<vtkMRMLSegmentationNode> SegmentationNode;\n+\n+  /// Oriented image data containing output geometry\n+  vtkOrientedImageData* GeometryImageData;\n+\n+  /// Source to input axes mapping \\sa matchInputAndSourceAxes\n+  int InputAxisIndexForSourceAxis[3];\n+  /// Inverse permutation of \\sa InputAxisIndexForSourceAxis\n+  int SourceAxisIndexForInputAxis[3];\n+\n+  /// Flag indicating whether editing is enabled in the widget\n+  bool EditEnabled;\n+};\n+\n+//-----------------------------------------------------------------------------\n+qMRMLSegmentationGeometryWidgetPrivate::qMRMLSegmentationGeometryWidgetPrivate(qMRMLSegmentationGeometryWidget& object)\n+  : q_ptr(&object)\n+  , InputAxisIndexForSourceAxis{ 0, 1, 2 }\n+  , SourceAxisIndexForInputAxis{ 0, 1, 2 }\n+  , EditEnabled(false)\n+{\n+  this->SegmentationNode = nullptr;","path":"Modules/Loadable/Segmentations/Widgets/qMRMLSegmentationGeometryWidget.cxx","position":108,"original_position":108,"commit_id":"a61216f47350240cb25b4fcd8e1a3a2edf7ec22b","original_commit_id":"a61216f47350240cb25b4fcd8e1a3a2edf7ec22b","user":{"login":"lassoan","id":307929,"node_id":"MDQ6VXNlcjMwNzkyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/307929?v=4","gravatar_id":"","url":"https://api.github.com/users/lassoan","html_url":"https://github.com/lassoan","followers_url":"https://api.github.com/users/lassoan/followers","following_url":"https://api.github.com/users/lassoan/following{/other_user}","gists_url":"https://api.github.com/users/lassoan/gists{/gist_id}","starred_url":"https://api.github.com/users/lassoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lassoan/subscriptions","organizations_url":"https://api.github.com/users/lassoan/orgs","repos_url":"https://api.github.com/users/lassoan/repos","events_url":"https://api.github.com/users/lassoan/events{/privacy}","received_events_url":"https://api.github.com/users/lassoan/received_events","type":"User","site_admin":false},"body":"I don't think weak pointers need initialization.","created_at":"2018-07-03T18:16:03Z","updated_at":"2018-07-03T18:33:45Z","html_url":"https://github.com/Slicer/Slicer/pull/975#discussion_r199905498","pull_request_url":"https://api.github.com/repos/Slicer/Slicer/pulls/975","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/comments/199905498"},"html":{"href":"https://github.com/Slicer/Slicer/pull/975#discussion_r199905498"},"pull_request":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/975"}}},"pull_request":{"url":"https://api.github.com/repos/Slicer/Slicer/pulls/975","id":196291740,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjkxNzQw","html_url":"https://github.com/Slicer/Slicer/pull/975","diff_url":"https://github.com/Slicer/Slicer/pull/975.diff","patch_url":"https://github.com/Slicer/Slicer/pull/975.patch","issue_url":"https://api.github.com/repos/Slicer/Slicer/issues/975","number":975,"state":"open","locked":false,"title":"ENH: Add widget to specify labelmap geometry in segmentations","user":{"login":"cpinter","id":1325980,"node_id":"MDQ6VXNlcjEzMjU5ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/1325980?v=4","gravatar_id":"","url":"https://api.github.com/users/cpinter","html_url":"https://github.com/cpinter","followers_url":"https://api.github.com/users/cpinter/followers","following_url":"https://api.github.com/users/cpinter/following{/other_user}","gists_url":"https://api.github.com/users/cpinter/gists{/gist_id}","starred_url":"https://api.github.com/users/cpinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpinter/subscriptions","organizations_url":"https://api.github.com/users/cpinter/orgs","repos_url":"https://api.github.com/users/cpinter/repos","events_url":"https://api.github.com/users/cpinter/events{/privacy}","received_events_url":"https://api.github.com/users/cpinter/received_events","type":"User","site_admin":false},"body":"- Add qMRMLSegmentationGeometryWidget that allows the user to specify a volume/segmentation/model/ROI as source, and set geometry details\r\n  - For segmentation with labelmap master it is possible to set isotropic spacing and oversampling factor. Spacing cannot be set manually in these cases\r\n  - For model, ROI, or segmentation with poly data master the parent transform is used for orientation, user input for spacing, and the bounding box for origin and extent\r\n- Add qMRMLSegmentationGeometryDialog that has a geometry widget in it, and OK and Cancel buttons if editing is enabled, and an OK button otherwise. If resampling is requested, then besides setting the reference image geometry conversion parameter, the existing segments are resampled to the specified geometry\r\n- Add button in row of master volume in Segment Editor widget that opens the geometry dialog\r\n- Replace button in conversion parameters dialog for specifying reference image geometry. Before it was a simple dialog that allowed selecting a volume, now the new geometry dialog shows up\r\n- Add python test for testing all kinds of scenarios for segmentation labelmap geometry calculation\r\n- Crash fixed in vtkCalculateOversamplingFactor: when factor was very low, invalid extent was calculated and then crashed when calculating spacing based on that","created_at":"2018-06-20T22:40:58Z","updated_at":"2018-07-03T18:33:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e347c3b3775c3088659bdf8f6ef54fce83aa55b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Slicer/Slicer/pulls/975/commits","review_comments_url":"https://api.github.com/repos/Slicer/Slicer/pulls/975/comments","review_comment_url":"https://api.github.com/repos/Slicer/Slicer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Slicer/Slicer/issues/975/comments","statuses_url":"https://api.github.com/repos/Slicer/Slicer/statuses/a61216f47350240cb25b4fcd8e1a3a2edf7ec22b","head":{"label":"cpinter:segment-editor-geometry-widget","ref":"segment-editor-geometry-widget","sha":"a61216f47350240cb25b4fcd8e1a3a2edf7ec22b","user":{"login":"cpinter","id":1325980,"node_id":"MDQ6VXNlcjEzMjU5ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/1325980?v=4","gravatar_id":"","url":"https://api.github.com/users/cpinter","html_url":"https://github.com/cpinter","followers_url":"https://api.github.com/users/cpinter/followers","following_url":"https://api.github.com/users/cpinter/following{/other_user}","gists_url":"https://api.github.com/users/cpinter/gists{/gist_id}","starred_url":"https://api.github.com/users/cpinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpinter/subscriptions","organizations_url":"https://api.github.com/users/cpinter/orgs","repos_url":"https://api.github.com/users/cpinter/repos","events_url":"https://api.github.com/users/cpinter/events{/privacy}","received_events_url":"https://api.github.com/users/cpinter/received_events","type":"User","site_admin":false},"repo":{"id":14346962,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM0Njk2Mg==","name":"Slicer","full_name":"cpinter/Slicer","owner":{"login":"cpinter","id":1325980,"node_id":"MDQ6VXNlcjEzMjU5ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/1325980?v=4","gravatar_id":"","url":"https://api.github.com/users/cpinter","html_url":"https://github.com/cpinter","followers_url":"https://api.github.com/users/cpinter/followers","following_url":"https://api.github.com/users/cpinter/following{/other_user}","gists_url":"https://api.github.com/users/cpinter/gists{/gist_id}","starred_url":"https://api.github.com/users/cpinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpinter/subscriptions","organizations_url":"https://api.github.com/users/cpinter/orgs","repos_url":"https://api.github.com/users/cpinter/repos","events_url":"https://api.github.com/users/cpinter/events{/privacy}","received_events_url":"https://api.github.com/users/cpinter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cpinter/Slicer","description":"Multi-platform, free open source software for visualization and image computing.","fork":true,"url":"https://api.github.com/repos/cpinter/Slicer","forks_url":"https://api.github.com/repos/cpinter/Slicer/forks","keys_url":"https://api.github.com/repos/cpinter/Slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cpinter/Slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cpinter/Slicer/teams","hooks_url":"https://api.github.com/repos/cpinter/Slicer/hooks","issue_events_url":"https://api.github.com/repos/cpinter/Slicer/issues/events{/number}","events_url":"https://api.github.com/repos/cpinter/Slicer/events","assignees_url":"https://api.github.com/repos/cpinter/Slicer/assignees{/user}","branches_url":"https://api.github.com/repos/cpinter/Slicer/branches{/branch}","tags_url":"https://api.github.com/repos/cpinter/Slicer/tags","blobs_url":"https://api.github.com/repos/cpinter/Slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cpinter/Slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cpinter/Slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/cpinter/Slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cpinter/Slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/cpinter/Slicer/languages","stargazers_url":"https://api.github.com/repos/cpinter/Slicer/stargazers","contributors_url":"https://api.github.com/repos/cpinter/Slicer/contributors","subscribers_url":"https://api.github.com/repos/cpinter/Slicer/subscribers","subscription_url":"https://api.github.com/repos/cpinter/Slicer/subscription","commits_url":"https://api.github.com/repos/cpinter/Slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/cpinter/Slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/cpinter/Slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/cpinter/Slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/cpinter/Slicer/contents/{+path}","compare_url":"https://api.github.com/repos/cpinter/Slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cpinter/Slicer/merges","archive_url":"https://api.github.com/repos/cpinter/Slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cpinter/Slicer/downloads","issues_url":"https://api.github.com/repos/cpinter/Slicer/issues{/number}","pulls_url":"https://api.github.com/repos/cpinter/Slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/cpinter/Slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/cpinter/Slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cpinter/Slicer/labels{/name}","releases_url":"https://api.github.com/repos/cpinter/Slicer/releases{/id}","deployments_url":"https://api.github.com/repos/cpinter/Slicer/deployments","created_at":"2013-11-12T22:24:59Z","updated_at":"2018-06-15T02:15:03Z","pushed_at":"2018-07-03T17:51:29Z","git_url":"git://github.com/cpinter/Slicer.git","ssh_url":"git@github.com:cpinter/Slicer.git","clone_url":"https://github.com/cpinter/Slicer.git","svn_url":"https://github.com/cpinter/Slicer","homepage":"www.slicer.org","size":439645,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Slicer:master","ref":"master","sha":"3ea26dae3e461899f8ecf51ec7ae02f7bab10d15","user":{"login":"Slicer","id":324362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNDM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/324362?v=4","gravatar_id":"","url":"https://api.github.com/users/Slicer","html_url":"https://github.com/Slicer","followers_url":"https://api.github.com/users/Slicer/followers","following_url":"https://api.github.com/users/Slicer/following{/other_user}","gists_url":"https://api.github.com/users/Slicer/gists{/gist_id}","starred_url":"https://api.github.com/users/Slicer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slicer/subscriptions","organizations_url":"https://api.github.com/users/Slicer/orgs","repos_url":"https://api.github.com/users/Slicer/repos","events_url":"https://api.github.com/users/Slicer/events{/privacy}","received_events_url":"https://api.github.com/users/Slicer/received_events","type":"Organization","site_admin":false},"repo":{"id":2006302,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA2MzAy","name":"Slicer","full_name":"Slicer/Slicer","owner":{"login":"Slicer","id":324362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNDM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/324362?v=4","gravatar_id":"","url":"https://api.github.com/users/Slicer","html_url":"https://github.com/Slicer","followers_url":"https://api.github.com/users/Slicer/followers","following_url":"https://api.github.com/users/Slicer/following{/other_user}","gists_url":"https://api.github.com/users/Slicer/gists{/gist_id}","starred_url":"https://api.github.com/users/Slicer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slicer/subscriptions","organizations_url":"https://api.github.com/users/Slicer/orgs","repos_url":"https://api.github.com/users/Slicer/repos","events_url":"https://api.github.com/users/Slicer/events{/privacy}","received_events_url":"https://api.github.com/users/Slicer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Slicer/Slicer","description":"Multi-platform, free open source software for visualization and image computing.","fork":false,"url":"https://api.github.com/repos/Slicer/Slicer","forks_url":"https://api.github.com/repos/Slicer/Slicer/forks","keys_url":"https://api.github.com/repos/Slicer/Slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slicer/Slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slicer/Slicer/teams","hooks_url":"https://api.github.com/repos/Slicer/Slicer/hooks","issue_events_url":"https://api.github.com/repos/Slicer/Slicer/issues/events{/number}","events_url":"https://api.github.com/repos/Slicer/Slicer/events","assignees_url":"https://api.github.com/repos/Slicer/Slicer/assignees{/user}","branches_url":"https://api.github.com/repos/Slicer/Slicer/branches{/branch}","tags_url":"https://api.github.com/repos/Slicer/Slicer/tags","blobs_url":"https://api.github.com/repos/Slicer/Slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slicer/Slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slicer/Slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slicer/Slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slicer/Slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/Slicer/Slicer/languages","stargazers_url":"https://api.github.com/repos/Slicer/Slicer/stargazers","contributors_url":"https://api.github.com/repos/Slicer/Slicer/contributors","subscribers_url":"https://api.github.com/repos/Slicer/Slicer/subscribers","subscription_url":"https://api.github.com/repos/Slicer/Slicer/subscription","commits_url":"https://api.github.com/repos/Slicer/Slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slicer/Slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slicer/Slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slicer/Slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Slicer/Slicer/contents/{+path}","compare_url":"https://api.github.com/repos/Slicer/Slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slicer/Slicer/merges","archive_url":"https://api.github.com/repos/Slicer/Slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slicer/Slicer/downloads","issues_url":"https://api.github.com/repos/Slicer/Slicer/issues{/number}","pulls_url":"https://api.github.com/repos/Slicer/Slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/Slicer/Slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/Slicer/Slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slicer/Slicer/labels{/name}","releases_url":"https://api.github.com/repos/Slicer/Slicer/releases{/id}","deployments_url":"https://api.github.com/repos/Slicer/Slicer/deployments","created_at":"2011-07-06T12:27:18Z","updated_at":"2018-07-03T01:00:17Z","pushed_at":"2018-07-03T17:51:31Z","git_url":"git://github.com/Slicer/Slicer.git","ssh_url":"git@github.com:Slicer/Slicer.git","clone_url":"https://github.com/Slicer/Slicer.git","svn_url":"https://github.com/Slicer/Slicer","homepage":"http://www.slicer.org","size":441156,"stargazers_count":533,"watchers_count":533,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":373,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":373,"open_issues":24,"watchers":533,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/975"},"html":{"href":"https://github.com/Slicer/Slicer/pull/975"},"issue":{"href":"https://api.github.com/repos/Slicer/Slicer/issues/975"},"comments":{"href":"https://api.github.com/repos/Slicer/Slicer/issues/975/comments"},"review_comments":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/975/comments"},"review_comment":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/975/commits"},"statuses":{"href":"https://api.github.com/repos/Slicer/Slicer/statuses/a61216f47350240cb25b4fcd8e1a3a2edf7ec22b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lassoan"}}