{"action":"created","issue":{"url":"https://api.github.com/repos/dpschreiner/icb/issues/37","repository_url":"https://api.github.com/repos/dpschreiner/icb","labels_url":"https://api.github.com/repos/dpschreiner/icb/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/dpschreiner/icb/issues/37/comments","events_url":"https://api.github.com/repos/dpschreiner/icb/issues/37/events","html_url":"https://github.com/dpschreiner/icb/issues/37","id":178794007,"number":37,"title":"write YouScope plugin to save as OME-TIFF","user":{"login":"dpschreiner","id":4560485,"avatar_url":"https://avatars.githubusercontent.com/u/4560485?v=3","gravatar_id":"","url":"https://api.github.com/users/dpschreiner","html_url":"https://github.com/dpschreiner","followers_url":"https://api.github.com/users/dpschreiner/followers","following_url":"https://api.github.com/users/dpschreiner/following{/other_user}","gists_url":"https://api.github.com/users/dpschreiner/gists{/gist_id}","starred_url":"https://api.github.com/users/dpschreiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpschreiner/subscriptions","organizations_url":"https://api.github.com/users/dpschreiner/orgs","repos_url":"https://api.github.com/users/dpschreiner/repos","events_url":"https://api.github.com/users/dpschreiner/events{/privacy}","received_events_url":"https://api.github.com/users/dpschreiner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dpschreiner/icb/labels/coding","name":"coding","color":"e99695"},{"url":"https://api.github.com/repos/dpschreiner/icb/labels/omero","name":"omero","color":"b60205"},{"url":"https://api.github.com/repos/dpschreiner/icb/labels/youscope","name":"youscope","color":"c2e0c6"}],"state":"open","locked":false,"assignee":{"login":"dpschreiner","id":4560485,"avatar_url":"https://avatars.githubusercontent.com/u/4560485?v=3","gravatar_id":"","url":"https://api.github.com/users/dpschreiner","html_url":"https://github.com/dpschreiner","followers_url":"https://api.github.com/users/dpschreiner/followers","following_url":"https://api.github.com/users/dpschreiner/following{/other_user}","gists_url":"https://api.github.com/users/dpschreiner/gists{/gist_id}","starred_url":"https://api.github.com/users/dpschreiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpschreiner/subscriptions","organizations_url":"https://api.github.com/users/dpschreiner/orgs","repos_url":"https://api.github.com/users/dpschreiner/repos","events_url":"https://api.github.com/users/dpschreiner/events{/privacy}","received_events_url":"https://api.github.com/users/dpschreiner/received_events","type":"User","site_admin":false},"assignees":[{"login":"dpschreiner","id":4560485,"avatar_url":"https://avatars.githubusercontent.com/u/4560485?v=3","gravatar_id":"","url":"https://api.github.com/users/dpschreiner","html_url":"https://github.com/dpschreiner","followers_url":"https://api.github.com/users/dpschreiner/followers","following_url":"https://api.github.com/users/dpschreiner/following{/other_user}","gists_url":"https://api.github.com/users/dpschreiner/gists{/gist_id}","starred_url":"https://api.github.com/users/dpschreiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpschreiner/subscriptions","organizations_url":"https://api.github.com/users/dpschreiner/orgs","repos_url":"https://api.github.com/users/dpschreiner/repos","events_url":"https://api.github.com/users/dpschreiner/events{/privacy}","received_events_url":"https://api.github.com/users/dpschreiner/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-09-23T06:17:29Z","updated_at":"2016-10-25T04:26:28Z","closed_at":null,"body":"assuming we go with Omero"},"comment":{"url":"https://api.github.com/repos/dpschreiner/icb/issues/comments/255933024","html_url":"https://github.com/dpschreiner/icb/issues/37#issuecomment-255933024","issue_url":"https://api.github.com/repos/dpschreiner/icb/issues/37","id":255933024,"user":{"login":"dpschreiner","id":4560485,"avatar_url":"https://avatars.githubusercontent.com/u/4560485?v=3","gravatar_id":"","url":"https://api.github.com/users/dpschreiner","html_url":"https://github.com/dpschreiner","followers_url":"https://api.github.com/users/dpschreiner/followers","following_url":"https://api.github.com/users/dpschreiner/following{/other_user}","gists_url":"https://api.github.com/users/dpschreiner/gists{/gist_id}","starred_url":"https://api.github.com/users/dpschreiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpschreiner/subscriptions","organizations_url":"https://api.github.com/users/dpschreiner/orgs","repos_url":"https://api.github.com/users/dpschreiner/repos","events_url":"https://api.github.com/users/dpschreiner/events{/privacy}","received_events_url":"https://api.github.com/users/dpschreiner/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T04:26:28Z","updated_at":"2016-10-25T04:26:28Z","body":"from OME forum thread https://www.openmicroscopy.org/community/viewtopic.php?f=4&t=8086&p=17564#p17564\r\n\r\n```\r\nfor (int t=0; t<timePoints; t++) {\r\n      for (int c=0; c<channels; c++) {\r\n        String inId = base + \"t\" + String.format(\"%04d\", t) + \"c\"+ c +\".tiff\";\r\n        int planeIndex = (t*c) + c;\r\n        in.setMetadataStore(meta);\r\n\r\n        //Check if the file exists, otherwise use plane from previous timepoint\r\n        File wantedFile = new File(inId);\r\n        int wantedTimePoint = t;\r\n        while (!wantedFile.exists() && wantedTimePoint >= 0) {\r\n          wantedTimePoint --;\r\n          inId = base + \"t\" + String.format(\"%04d\", wantedTimePoint) + \"c\"+ c +\".tiff\";\r\n          wantedFile = new File(inId);\r\n        }\r\n        in.setId(inId);\r\n\r\n        // read first image plane\r\n        byte[] image = in.openBytes(0);\r\n        in.close();\r\n\r\n        if (t == 0 && c == 0) {\r\n          meta.setPixelsSizeC(new PositiveInteger(channels), 0);\r\n          meta.setPixelsSizeT(new PositiveInteger(timePoints), 0);\r\n          out.setMetadataRetrieve(meta);\r\n          out.setId(outId);\r\n          // read first IFD\r\n          RandomAccessInputStream ras = new RandomAccessInputStream(inId);\r\n          TiffParser parser = new TiffParser(ras);\r\n          IFD ifd = parser.getFirstIFD();\r\n          ras.close();\r\n\r\n          // preserve TIFF comment\r\n          String desc = ifd.getComment();\r\n\r\n          if (desc != null) {\r\n            ifd = new IFD();\r\n            ifd.putIFDValue(IFD.IMAGE_DESCRIPTION, desc);\r\n            comment = true;\r\n            out.saveBytes(planeIndex, image, ifd);\r\n            System.out.print(\".\");\r\n            continue;\r\n          }\r\n        }\r\n\r\n        // write image plane\r\n        out.saveBytes(planeIndex, image);\r\n      }\r\n    }\r\n```"}}
{"actor":{"display_login":"dpschreiner"}}