{"action":"opened","issue":{"url":"https://api.github.com/repos/BIC-MNI/mni_autoreg/issues/12","repository_url":"https://api.github.com/repos/BIC-MNI/mni_autoreg","labels_url":"https://api.github.com/repos/BIC-MNI/mni_autoreg/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/BIC-MNI/mni_autoreg/issues/12/comments","events_url":"https://api.github.com/repos/BIC-MNI/mni_autoreg/issues/12/events","html_url":"https://github.com/BIC-MNI/mni_autoreg/issues/12","id":137713104,"number":12,"title":"autocrop's round application in FixBounds always rounds up, sometimes breaking \"-from\" functionality","user":{"login":"gdevenyi","id":3001850,"avatar_url":"https://avatars.githubusercontent.com/u/3001850?v=3","gravatar_id":"","url":"https://api.github.com/users/gdevenyi","html_url":"https://github.com/gdevenyi","followers_url":"https://api.github.com/users/gdevenyi/followers","following_url":"https://api.github.com/users/gdevenyi/following{/other_user}","gists_url":"https://api.github.com/users/gdevenyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gdevenyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdevenyi/subscriptions","organizations_url":"https://api.github.com/users/gdevenyi/orgs","repos_url":"https://api.github.com/users/gdevenyi/repos","events_url":"https://api.github.com/users/gdevenyi/events{/privacy}","received_events_url":"https://api.github.com/users/gdevenyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-01T22:59:30Z","updated_at":"2016-03-01T22:59:30Z","closed_at":null,"body":"A case study:\r\n```sh\r\n> mincinfo trunc-final.mnc\r\nfile: trunc-final.mnc\r\nimage: signed__ float 0.40647819638252258301 to 658.44122314453125\r\nimage dimensions: zspace yspace xspace\r\n    dimension name         length         step        start\r\n    --------------         ------         ----        -----\r\n    zspace                    256            1       -127.5\r\n    yspace                    240            1       -119.5\r\n    xspace                    176          1.2         -105\r\n> autocrop -from trunc-final.mnc otsu_expanded_closed.mnc otsu_closed.mnc -clobber -debug\r\nGetVolumeBounds:\r\n  xspace: start=-105, stop=105\r\n  yspace: start=-119.5, stop=119.5\r\n  zspace: start=-127.5, stop=127.5\r\nGetTagBounds:\r\n  xspace: start=-105, extent=211.2\r\n  yspace: start=-119.5, extent=240\r\n  zspace: start=-127.5, extent=256\r\nFixBounds:\r\n  xspace: start=-105, extent=212.4\r\n  yspace: start=-119.5, extent=240\r\n  zspace: start=-127.5, extent=256\r\nModifyBounds:\r\n  xspace: start=-105, extent=212.4\r\n  yspace: start=-119.5, extent=240\r\n  zspace: start=-127.5, extent=256\r\nParams: -start 50,50,42 -count 256,240,177\r\nDimension order: 2 1 0\r\nParams:  -dimrange zspace=50,256 -dimrange yspace=50,240 -dimrange xspace=42,177\r\n[autocrop] [devgab@cicws24:/tmp/tmp.W8UDpESQWO] [2016-03-01 17:40:52] /opt/quarantine/minc-toolkit/1.9.11/build/bin/mincreshape -clobber otsu_expanded_closed.mnc otsu_closed.mnc  -dimrange zspace=50,256 -dimrange yspace=50,240 -dimrange xspace=42,177\r\nCopying chunks:................................................................................................................................................................................................................................................................Done.\r\n> mincinfo otsu_closed.mnc\r\nfile: otsu_closed.mnc\r\nimage: unsigned byte 0 to 255\r\nimage dimensions: zspace yspace xspace\r\n    dimension name         length         step        start\r\n    --------------         ------         ----        -----\r\n    zspace                    256            1       -127.5\r\n    yspace                    240            1       -119.5\r\n    xspace                    177          1.2         -105\r\n```\r\nDespite the original file having 176 xslices, the new volumes has 177.\r\n\r\nOn line https://github.com/BIC-MNI/mni_autoreg/blob/develop/perl/autocrop.in#L844 the round funcion is biased to always round to larger (negative or positive) values, sometimes this results in an extra slice being added where it shouldn't be."}}