{"action":"created","comment":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/40879744","id":40879744,"diff_hunk":"@@ -168,56 +191,76 @@ protected void initFile(String id) throws FormatException, IOException\n     }\n \n     MetadataStore ome = makeFilterMetadata();\n-    MetadataTools.populatePixels(ome, this);\n-\n-    for (int series = 0; series != core.size(); ++ series)\n+    if (fileVersion == 1)\n     {\n-      CoreMetadata obf = core.get(series);\n+      MetadataTools.populatePixels(ome, this);\n+      for (int series = 0; series != core.size(); ++ series)\n+      {\n+        CoreMetadata obf = core.get(series);\n \n-      final String name = obf.seriesMetadata.get(\"Name\").toString();\n-      ome.setImageName(name, series);\n+        final String name = obf.seriesMetadata.get(\"Name\").toString();\n+        ome.setImageName(name, series);\n \n-      @SuppressWarnings(\"unchecked\")\n-      final List<Double> lengths = (List<Double>) obf.seriesMetadata.get(\"Lengths\");\n+        @SuppressWarnings(\"unchecked\")\n+        final List<Double> lengths = (List<Double>) obf.seriesMetadata.get(\"Lengths\");\n \n-      if (lengths.size() > 0)\n-      {\n-        double lengthX = Math.abs(lengths.get(0)) ;\n-        if (lengthX < 0.01)\n+        if (lengths.size() > 0)\n         {\n-          lengthX *= 1000000;\n-        }\n-        if (lengthX > 0)\n-        {\n-          final Length physicalSizeX = FormatTools.createLength( lengthX / obf.sizeX , UNITS.MICROM);\n-          ome.setPixelsPhysicalSizeX(physicalSizeX, series);\n+          double lengthX = Math.abs(lengths.get(0)) ;\n+          if (lengthX < 0.01)\n+          {\n+            lengthX *= 1000000;\n+          }\n+          if (lengthX > 0)\n+          {\n+            final Length physicalSizeX = FormatTools.createLength( lengthX / obf.sizeX , UNITS.MICROM);\n+            ome.setPixelsPhysicalSizeX(physicalSizeX, series);\n+          }\n         }\n-      }\n-      if (lengths.size() > 1)\n-      {\n-        double lengthY = Math.abs(lengths.get(1));\n-        if (lengthY < 0.01)\n+        if (lengths.size() > 1)\n         {\n-          lengthY *= 1000000;\n+          double lengthY = Math.abs(lengths.get(1));\n+          if (lengthY < 0.01)\n+          {\n+            lengthY *= 1000000;\n+          }\n+          if (lengthY > 0)\n+          {\n+            final Length physicalSizeY = FormatTools.createLength( lengthY / obf.sizeY , UNITS.MICROM);\n+            ome.setPixelsPhysicalSizeY(physicalSizeY, series);\n+          }\n         }\n-        if (lengthY > 0)\n+        if (lengths.size() > 2)\n         {\n-          final Length physicalSizeY = FormatTools.createLength( lengthY / obf.sizeY , UNITS.MICROM);\n-          ome.setPixelsPhysicalSizeY(physicalSizeY, series);\n+          double lengthZ = Math.abs(lengths.get(2));\n+          if (lengthZ < 0.01)\n+          {\n+            lengthZ *= 1000000 ;\n+          }\n+          if (lengthZ > 0)\n+          {\n+            final Length physicalSizeZ = FormatTools.createLength( lengthZ / obf.sizeZ  , UNITS.MICROM);\n+            ome.setPixelsPhysicalSizeZ(physicalSizeZ, series);\n+          }\n         }\n       }\n-      if (lengths.size() > 2)\n+    }\n+    else\n+    {\n+      try \n       {\n-        double lengthZ = Math.abs(lengths.get(2));\n-        if (lengthZ < 0.01)\n-        {\n-          lengthZ *= 1000000 ;\n-        }\n-        if (lengthZ > 0)\n-        {\n-          final Length physicalSizeZ = FormatTools.createLength( lengthZ / obf.sizeZ  , UNITS.MICROM);\n-          ome.setPixelsPhysicalSizeZ(physicalSizeZ, series);\n-        }\n+        ServiceFactory factory = new ServiceFactory() ;\n+        OMEXMLService service = factory.getInstance( OMEXMLService.class ) ;\n+\n+        service.convertMetadata( ome_xml, ome ) ;","path":"components/formats-bsd/src/loci/formats/in/OBFReader.java","position":168,"original_position":157,"commit_id":"e9d40c0b4d93916fada7cd80d4d799f7660f2efd","original_commit_id":"1ee47fa17808d8ca2609f496e6e58567fba692e4","user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"body":"See https://ci.openmicroscopy.org/job/BIOFORMATS-5.1-merge-test_images_good/648/console. This line generated a `NullPointerException` for some `msr` data. Excluding for a rebuild.","created_at":"2015-10-01T05:16:05Z","updated_at":"2015-10-01T05:16:05Z","html_url":"https://github.com/openmicroscopy/bioformats/pull/1901#discussion_r40879744","pull_request_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/40879744"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/1901#discussion_r40879744"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901"}}},"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901","id":41133006,"html_url":"https://github.com/openmicroscopy/bioformats/pull/1901","diff_url":"https://github.com/openmicroscopy/bioformats/pull/1901.diff","patch_url":"https://github.com/openmicroscopy/bioformats/pull/1901.patch","issue_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/1901","number":1901,"state":"open","locked":false,"title":"use OME XML meta data in file format version 2","user":{"login":"bjoernthiel","id":3530740,"avatar_url":"https://avatars.githubusercontent.com/u/3530740?v=3","gravatar_id":"","url":"https://api.github.com/users/bjoernthiel","html_url":"https://github.com/bjoernthiel","followers_url":"https://api.github.com/users/bjoernthiel/followers","following_url":"https://api.github.com/users/bjoernthiel/following{/other_user}","gists_url":"https://api.github.com/users/bjoernthiel/gists{/gist_id}","starred_url":"https://api.github.com/users/bjoernthiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjoernthiel/subscriptions","organizations_url":"https://api.github.com/users/bjoernthiel/orgs","repos_url":"https://api.github.com/users/bjoernthiel/repos","events_url":"https://api.github.com/users/bjoernthiel/events{/privacy}","received_events_url":"https://api.github.com/users/bjoernthiel/received_events","type":"User","site_admin":false},"body":"please review","created_at":"2015-07-29T14:58:45Z","updated_at":"2015-10-01T05:16:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b642f2b0ed869ac5370c3a825e768c05198fe91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901/commits","review_comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901/comments","review_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/1901/comments","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/e9d40c0b4d93916fada7cd80d4d799f7660f2efd","head":{"label":"bjoernthiel:develop","ref":"develop","sha":"e9d40c0b4d93916fada7cd80d4d799f7660f2efd","user":{"login":"bjoernthiel","id":3530740,"avatar_url":"https://avatars.githubusercontent.com/u/3530740?v=3","gravatar_id":"","url":"https://api.github.com/users/bjoernthiel","html_url":"https://github.com/bjoernthiel","followers_url":"https://api.github.com/users/bjoernthiel/followers","following_url":"https://api.github.com/users/bjoernthiel/following{/other_user}","gists_url":"https://api.github.com/users/bjoernthiel/gists{/gist_id}","starred_url":"https://api.github.com/users/bjoernthiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjoernthiel/subscriptions","organizations_url":"https://api.github.com/users/bjoernthiel/orgs","repos_url":"https://api.github.com/users/bjoernthiel/repos","events_url":"https://api.github.com/users/bjoernthiel/events{/privacy}","received_events_url":"https://api.github.com/users/bjoernthiel/received_events","type":"User","site_admin":false},"repo":{"id":8135385,"name":"bioformats","full_name":"bjoernthiel/bioformats","owner":{"login":"bjoernthiel","id":3530740,"avatar_url":"https://avatars.githubusercontent.com/u/3530740?v=3","gravatar_id":"","url":"https://api.github.com/users/bjoernthiel","html_url":"https://github.com/bjoernthiel","followers_url":"https://api.github.com/users/bjoernthiel/followers","following_url":"https://api.github.com/users/bjoernthiel/following{/other_user}","gists_url":"https://api.github.com/users/bjoernthiel/gists{/gist_id}","starred_url":"https://api.github.com/users/bjoernthiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjoernthiel/subscriptions","organizations_url":"https://api.github.com/users/bjoernthiel/orgs","repos_url":"https://api.github.com/users/bjoernthiel/repos","events_url":"https://api.github.com/users/bjoernthiel/events{/privacy}","received_events_url":"https://api.github.com/users/bjoernthiel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bjoernthiel/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":true,"url":"https://api.github.com/repos/bjoernthiel/bioformats","forks_url":"https://api.github.com/repos/bjoernthiel/bioformats/forks","keys_url":"https://api.github.com/repos/bjoernthiel/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bjoernthiel/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bjoernthiel/bioformats/teams","hooks_url":"https://api.github.com/repos/bjoernthiel/bioformats/hooks","issue_events_url":"https://api.github.com/repos/bjoernthiel/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/bjoernthiel/bioformats/events","assignees_url":"https://api.github.com/repos/bjoernthiel/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/bjoernthiel/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/bjoernthiel/bioformats/tags","blobs_url":"https://api.github.com/repos/bjoernthiel/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bjoernthiel/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bjoernthiel/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/bjoernthiel/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bjoernthiel/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/bjoernthiel/bioformats/languages","stargazers_url":"https://api.github.com/repos/bjoernthiel/bioformats/stargazers","contributors_url":"https://api.github.com/repos/bjoernthiel/bioformats/contributors","subscribers_url":"https://api.github.com/repos/bjoernthiel/bioformats/subscribers","subscription_url":"https://api.github.com/repos/bjoernthiel/bioformats/subscription","commits_url":"https://api.github.com/repos/bjoernthiel/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/bjoernthiel/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/bjoernthiel/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/bjoernthiel/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/bjoernthiel/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/bjoernthiel/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bjoernthiel/bioformats/merges","archive_url":"https://api.github.com/repos/bjoernthiel/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bjoernthiel/bioformats/downloads","issues_url":"https://api.github.com/repos/bjoernthiel/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/bjoernthiel/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/bjoernthiel/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/bjoernthiel/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bjoernthiel/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/bjoernthiel/bioformats/releases{/id}","created_at":"2013-02-11T09:29:19Z","updated_at":"2015-01-30T09:15:58Z","pushed_at":"2015-08-25T08:20:15Z","git_url":"git://github.com/bjoernthiel/bioformats.git","ssh_url":"git@github.com:bjoernthiel/bioformats.git","clone_url":"https://github.com/bjoernthiel/bioformats.git","svn_url":"https://github.com/bjoernthiel/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":248518,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"openmicroscopy:develop","ref":"develop","sha":"9d5e0e9dfcb48af789521298260726c427bd4e3d","user":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"repo":{"id":2510503,"name":"bioformats","full_name":"openmicroscopy/bioformats","owner":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmicroscopy/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":false,"url":"https://api.github.com/repos/openmicroscopy/bioformats","forks_url":"https://api.github.com/repos/openmicroscopy/bioformats/forks","keys_url":"https://api.github.com/repos/openmicroscopy/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmicroscopy/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmicroscopy/bioformats/teams","hooks_url":"https://api.github.com/repos/openmicroscopy/bioformats/hooks","issue_events_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/openmicroscopy/bioformats/events","assignees_url":"https://api.github.com/repos/openmicroscopy/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/openmicroscopy/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/tags","blobs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/openmicroscopy/bioformats/languages","stargazers_url":"https://api.github.com/repos/openmicroscopy/bioformats/stargazers","contributors_url":"https://api.github.com/repos/openmicroscopy/bioformats/contributors","subscribers_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscribers","subscription_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscription","commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmicroscopy/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/openmicroscopy/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmicroscopy/bioformats/merges","archive_url":"https://api.github.com/repos/openmicroscopy/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmicroscopy/bioformats/downloads","issues_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/openmicroscopy/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/openmicroscopy/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmicroscopy/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/openmicroscopy/bioformats/releases{/id}","created_at":"2011-10-04T08:06:14Z","updated_at":"2015-09-13T22:23:02Z","pushed_at":"2015-10-01T01:26:43Z","git_url":"git://github.com/openmicroscopy/bioformats.git","ssh_url":"git@github.com:openmicroscopy/bioformats.git","clone_url":"https://github.com/openmicroscopy/bioformats.git","svn_url":"https://github.com/openmicroscopy/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":290293,"stargazers_count":92,"watchers_count":92,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":108,"mirror_url":null,"open_issues_count":30,"forks":108,"open_issues":30,"watchers":92,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/1901"},"issue":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/1901"},"comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/1901/comments"},"review_comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901/comments"},"review_comment":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/1901/commits"},"statuses":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/e9d40c0b4d93916fada7cd80d4d799f7660f2efd"}}}}