{"action":"opened","issue":{"url":"https://api.github.com/repos/freeman-lab/thunder/issues/77","labels_url":"https://api.github.com/repos/freeman-lab/thunder/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/freeman-lab/thunder/issues/77/comments","events_url":"https://api.github.com/repos/freeman-lab/thunder/issues/77/events","html_url":"https://github.com/freeman-lab/thunder/issues/77","id":53599920,"number":77,"title":"Cropping fails to squeeze empty dimensions","user":{"login":"freeman-lab","id":3387500,"avatar_url":"https://avatars.githubusercontent.com/u/3387500?v=3","gravatar_id":"","url":"https://api.github.com/users/freeman-lab","html_url":"https://github.com/freeman-lab","followers_url":"https://api.github.com/users/freeman-lab/followers","following_url":"https://api.github.com/users/freeman-lab/following{/other_user}","gists_url":"https://api.github.com/users/freeman-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/freeman-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeman-lab/subscriptions","organizations_url":"https://api.github.com/users/freeman-lab/orgs","repos_url":"https://api.github.com/users/freeman-lab/repos","events_url":"https://api.github.com/users/freeman-lab/events{/privacy}","received_events_url":"https://api.github.com/users/freeman-lab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/freeman-lab/thunder/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-07T05:44:47Z","updated_at":"2015-01-07T05:44:47Z","closed_at":null,"body":"When cropping an image, if an empty selection is provided for one of more axes, it is not handled appropriately. It currently yields an empty selection over the entire image or volume, but should instead squeeze out the dropped dimension(s) and leave the others intact. For example:\r\n\r\n```\r\ndata = tsc.loadExample('fish-images')\r\nimg = data.crop([0,0,0],[20,20,0]).first()[1]\r\nimg\r\n>> array([], shape=(20, 20, 0), dtype=uint8)\r\nimg.shape\r\n>> (20,20,0)\r\n```\r\n\r\nThis should instead yield something with shape (20,20), as in:\r\n\r\n```\r\nimg = data.first()[1][0:20,0:20,0]\r\nimg.shape\r\n>> (20,20)\r\n```\r\n\r\nThe problem is that slice indexing with, for example, `[x:xx, y:yy, 0:0]` does not give the same output as `[x:xx, y:yy, 0]`, which is what we want.\r\n\r\n"}}