{"action":"created","issue":{"url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/1","labels_url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/1/comments","events_url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/1/events","html_url":"https://github.com/joe-jordan/pylibtiff3d/issues/1","id":119053473,"number":1,"title":"32-bit TIFF conversion problem","user":{"login":"ZsuzsannaPuspoki","id":7972937,"avatar_url":"https://avatars.githubusercontent.com/u/7972937?v=3","gravatar_id":"","url":"https://api.github.com/users/ZsuzsannaPuspoki","html_url":"https://github.com/ZsuzsannaPuspoki","followers_url":"https://api.github.com/users/ZsuzsannaPuspoki/followers","following_url":"https://api.github.com/users/ZsuzsannaPuspoki/following{/other_user}","gists_url":"https://api.github.com/users/ZsuzsannaPuspoki/gists{/gist_id}","starred_url":"https://api.github.com/users/ZsuzsannaPuspoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZsuzsannaPuspoki/subscriptions","organizations_url":"https://api.github.com/users/ZsuzsannaPuspoki/orgs","repos_url":"https://api.github.com/users/ZsuzsannaPuspoki/repos","events_url":"https://api.github.com/users/ZsuzsannaPuspoki/events{/privacy}","received_events_url":"https://api.github.com/users/ZsuzsannaPuspoki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-26T14:19:13Z","updated_at":"2015-11-26T22:56:20Z","closed_at":"2015-11-26T22:56:20Z","body":"Hello,\r\n\r\nI want to read 32-bit TIFF files (3D volumes) with pylibtiff3d. Illustration of the problem: I have created a 32-bit image with ImageJ. It has the following values:\r\n- 30.3197 and -30.5624.\r\n\r\nI am running the script:\r\n\r\nIn [1]: import libtiff3d\r\nIn [2]: t1 = libtiff3d.TIFF3D.open(\"Clipboard.tif\")\r\nIn [3]: arr1 = t1.read_image()\r\nIn [4]: print arr1\r\n[[[ -2.53927115e-13  -9.53510664e-07]]]\r\nIn [5]: arr1.dtype\r\nOut[5]: dtype('float32')\r\n\r\nThe above code is working well for 8-bit images. I am wondering what's going wrong. \r\nThanks for your help. \r\nZsuzsanna\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/comments/160001988","html_url":"https://github.com/joe-jordan/pylibtiff3d/issues/1#issuecomment-160001988","issue_url":"https://api.github.com/repos/joe-jordan/pylibtiff3d/issues/1","id":160001988,"user":{"login":"joe-jordan","id":1413842,"avatar_url":"https://avatars.githubusercontent.com/u/1413842?v=3","gravatar_id":"","url":"https://api.github.com/users/joe-jordan","html_url":"https://github.com/joe-jordan","followers_url":"https://api.github.com/users/joe-jordan/followers","following_url":"https://api.github.com/users/joe-jordan/following{/other_user}","gists_url":"https://api.github.com/users/joe-jordan/gists{/gist_id}","starred_url":"https://api.github.com/users/joe-jordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joe-jordan/subscriptions","organizations_url":"https://api.github.com/users/joe-jordan/orgs","repos_url":"https://api.github.com/users/joe-jordan/repos","events_url":"https://api.github.com/users/joe-jordan/events{/privacy}","received_events_url":"https://api.github.com/users/joe-jordan/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T22:56:20Z","updated_at":"2015-11-26T22:56:20Z","body":"I tested your code on the main pylibtiff and it works fine:\r\n\r\n```\r\n# imports:\r\n\r\nIn [1]: import libtiff\r\n\r\nIn [4]: import numpy\r\n\r\nIn [5]: arr = numpy.array\r\n\r\n# create sample file:\r\n\r\nIn [11]: t = libtiff.TIFF.open('test.tif', 'w')\r\n\r\nIn [12]: t.write_image(arr([[[30.3197 , -30.5624]]], dtype=numpy.dtype('float32')))\r\n\r\nIn [13]: t.close()\r\n\r\n# read sample file back in:\r\n\r\nIn [15]: t = libtiff.TIFF3D.open('test.tif', 'r')\r\n\r\nIn [17]: t.read_image()\r\nOut[17]: array([[[ 30.31970024, -30.56240082]]], dtype=float32)\r\n\r\nIn [18]: t.close()\r\n```\r\n\r\nI recommend you use the main pylibtiff for this task."}}