{"action":"created","issue":{"url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/274","labels_url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/274/comments","events_url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/274/events","html_url":"https://github.com/neuropoly/spinalcordtoolbox/issues/274","id":62090275,"number":274,"title":"Register to template provides correct anat_to_template warping field but incorrect inverse","user":{"login":"benjamindeleener","id":7757117,"avatar_url":"https://avatars.githubusercontent.com/u/7757117?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamindeleener","html_url":"https://github.com/benjamindeleener","followers_url":"https://api.github.com/users/benjamindeleener/followers","following_url":"https://api.github.com/users/benjamindeleener/following{/other_user}","gists_url":"https://api.github.com/users/benjamindeleener/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamindeleener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamindeleener/subscriptions","organizations_url":"https://api.github.com/users/benjamindeleener/orgs","repos_url":"https://api.github.com/users/benjamindeleener/repos","events_url":"https://api.github.com/users/benjamindeleener/events{/privacy}","received_events_url":"https://api.github.com/users/benjamindeleener/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/labels/priority:%20high","name":"priority: high","color":"e11d21"},{"url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/labels/sct_register_to_template","name":"sct_register_to_template","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"benjamindeleener","id":7757117,"avatar_url":"https://avatars.githubusercontent.com/u/7757117?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamindeleener","html_url":"https://github.com/benjamindeleener","followers_url":"https://api.github.com/users/benjamindeleener/followers","following_url":"https://api.github.com/users/benjamindeleener/following{/other_user}","gists_url":"https://api.github.com/users/benjamindeleener/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamindeleener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamindeleener/subscriptions","organizations_url":"https://api.github.com/users/benjamindeleener/orgs","repos_url":"https://api.github.com/users/benjamindeleener/repos","events_url":"https://api.github.com/users/benjamindeleener/events{/privacy}","received_events_url":"https://api.github.com/users/benjamindeleener/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-03-16T14:01:54Z","updated_at":"2015-03-16T20:49:34Z","closed_at":null,"body":"Data are located here: /Volumes/folder_shared/sct_issues/20150316_allan\r\n\r\nTo reproduce the issue:\r\n```\r\nsct_register_to_template -i t2r.nii.gz -l t2r-labels.nii.gz -m t2r_seg.nii.gz -s fast -r 0\r\n```"},"comment":{"url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/comments/81928865","html_url":"https://github.com/neuropoly/spinalcordtoolbox/issues/274#issuecomment-81928865","issue_url":"https://api.github.com/repos/neuropoly/spinalcordtoolbox/issues/274","id":81928865,"user":{"login":"benjamindeleener","id":7757117,"avatar_url":"https://avatars.githubusercontent.com/u/7757117?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamindeleener","html_url":"https://github.com/benjamindeleener","followers_url":"https://api.github.com/users/benjamindeleener/followers","following_url":"https://api.github.com/users/benjamindeleener/following{/other_user}","gists_url":"https://api.github.com/users/benjamindeleener/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamindeleener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamindeleener/subscriptions","organizations_url":"https://api.github.com/users/benjamindeleener/orgs","repos_url":"https://api.github.com/users/benjamindeleener/repos","events_url":"https://api.github.com/users/benjamindeleener/events{/privacy}","received_events_url":"https://api.github.com/users/benjamindeleener/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T20:49:34Z","updated_at":"2015-03-16T20:49:34Z","body":"The issue seemed to be caused by SliceReg when the segmentation did not covered the whole image. In some case, the generated warping field is nearly nul everywhere but some small values (~ e^-308) cause instabilities when inverting warping fields.\r\n\r\nSolution: when registering to the template, make sure that the segmentation covers the whole image by cropping the segmentation image with sct_crop_image with the option -bzmax and -dim (0,1 or 2, is the dimensio of Z). sct_crop_image integrates -bzmax option since commit 715491a."}}