{"action":"closed","number":371,"pull_request":{"url":"https://api.github.com/repos/Slicer/Slicer/pulls/371","id":47097666,"html_url":"https://github.com/Slicer/Slicer/pull/371","diff_url":"https://github.com/Slicer/Slicer/pull/371.diff","patch_url":"https://github.com/Slicer/Slicer/pull/371.patch","issue_url":"https://api.github.com/repos/Slicer/Slicer/issues/371","number":371,"state":"closed","locked":false,"title":"Fix vtk mrml double array storage node reader writer","user":{"login":"jcfr","id":219043,"avatar_url":"https://avatars.githubusercontent.com/u/219043?v=3","gravatar_id":"","url":"https://api.github.com/users/jcfr","html_url":"https://github.com/jcfr","followers_url":"https://api.github.com/users/jcfr/followers","following_url":"https://api.github.com/users/jcfr/following{/other_user}","gists_url":"https://api.github.com/users/jcfr/gists{/gist_id}","starred_url":"https://api.github.com/users/jcfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcfr/subscriptions","organizations_url":"https://api.github.com/users/jcfr/orgs","repos_url":"https://api.github.com/users/jcfr/repos","events_url":"https://api.github.com/users/jcfr/events{/privacy}","received_events_url":"https://api.github.com/users/jcfr/received_events","type":"User","site_admin":false},"body":"The reader in `vtkMRMLDoubleArrayStorage` was always setting the\r\nfirst line of values in the `.mcsv` file as labels. If the stored\r\n`vtkMRMLDoubleArray` had not labels set, then the retrieved double\r\narray labels would be set to the first line of numerical values,\r\nassociated with the first data point. This resulted in a missing\r\ndata point as well as shifted indices for all remaining points,\r\nand incorrect labels.\r\n\r\nThe correction this commit offers is to write the line '# nolabels'\r\nin the file if labels exist. If the reader finds this line, it will\r\nset the first line of values as the first data point, instead of\r\nsetting it as label values.\r\n\r\nExamples :\r\n\r\nHere are four examples with (u,v,w) as labels, (12.1,425.577,-454)\r\nfor the first data point, and (8.79633e+09,0,-1) for the second one:\r\n\r\n(1) New writer: vtkMRMLDoubleArrayNode with labels\r\n\r\n```\r\n   # measurement file filename.mcsv\r\n   u,v,w\r\n   12.1,425.577,-454\r\n   8.79633e+09,0,-1\r\n```\r\n\r\n(2) New writer: vtkMRMLDoubleArrayNode with no labels set\r\n\r\n```\r\n   # measurement file filename.mcsv\r\n   # nolabels\r\n   12.1,425.577,-454\r\n   8.79633e+09,0,-1\r\n```\r\n\r\n(3) Old writer: vtkMRMLDoubleArrayNode with labels\r\n\r\n```\r\n   # measurement file filename.mcsv\r\n   # columns = x,y,yerr\r\n   u,v,w\r\n   12.1,425.577,-454\r\n   8.79633e+09,0,-1\r\n```\r\n\r\n(4) Old writer: vtkMRMLDoubleArrayNode with no labels set\r\n\r\n```\r\n   # measurement file filename.mcsv\r\n   # columns = x,y,yerr\r\n   12.1,425.577,-454\r\n   8.79633e+09,0,-1\r\n```\r\n\r\nObservations :\r\n\r\nThe line '# columns = x,y,yerr' was hardcoded [1] in the former\r\nwriter and had no meaning related to the actual double array\r\nnode labels. The inspiration problably came from .mcsv or .acsv\r\nwriters/readers [2][3] but had no effect here.\r\n\r\n[1] https://github.com/Slicer/Slicer/blob/6e63b4bf5dbc65a9973160de7397dfc47882e038/Libs/MRML/Core/vtkMRMLDoubleArrayStorageNode.cxx#L244\r\n[2] https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsFiducialStorageNode.cxx#L159-L185\r\n[3] https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationFiducialsStorageNode.cxx#L245-L268","created_at":"2015-10-08T00:00:32Z","updated_at":"2015-10-29T07:14:27Z","closed_at":"2015-10-29T07:14:27Z","merged_at":null,"merge_commit_sha":"ed81ad8f43bf65417e4cf3c26237a9097917fe1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Slicer/Slicer/pulls/371/commits","review_comments_url":"https://api.github.com/repos/Slicer/Slicer/pulls/371/comments","review_comment_url":"https://api.github.com/repos/Slicer/Slicer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Slicer/Slicer/issues/371/comments","statuses_url":"https://api.github.com/repos/Slicer/Slicer/statuses/b966f7261119234f9039d5ed4ce516e700b47c43","head":{"label":"jcfr:fix-vtkMRMLDoubleArrayStorageNode-reader-writer","ref":"fix-vtkMRMLDoubleArrayStorageNode-reader-writer","sha":"b966f7261119234f9039d5ed4ce516e700b47c43","user":{"login":"jcfr","id":219043,"avatar_url":"https://avatars.githubusercontent.com/u/219043?v=3","gravatar_id":"","url":"https://api.github.com/users/jcfr","html_url":"https://github.com/jcfr","followers_url":"https://api.github.com/users/jcfr/followers","following_url":"https://api.github.com/users/jcfr/following{/other_user}","gists_url":"https://api.github.com/users/jcfr/gists{/gist_id}","starred_url":"https://api.github.com/users/jcfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcfr/subscriptions","organizations_url":"https://api.github.com/users/jcfr/orgs","repos_url":"https://api.github.com/users/jcfr/repos","events_url":"https://api.github.com/users/jcfr/events{/privacy}","received_events_url":"https://api.github.com/users/jcfr/received_events","type":"User","site_admin":false},"repo":{"id":2027793,"name":"Slicer","full_name":"jcfr/Slicer","owner":{"login":"jcfr","id":219043,"avatar_url":"https://avatars.githubusercontent.com/u/219043?v=3","gravatar_id":"","url":"https://api.github.com/users/jcfr","html_url":"https://github.com/jcfr","followers_url":"https://api.github.com/users/jcfr/followers","following_url":"https://api.github.com/users/jcfr/following{/other_user}","gists_url":"https://api.github.com/users/jcfr/gists{/gist_id}","starred_url":"https://api.github.com/users/jcfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcfr/subscriptions","organizations_url":"https://api.github.com/users/jcfr/orgs","repos_url":"https://api.github.com/users/jcfr/repos","events_url":"https://api.github.com/users/jcfr/events{/privacy}","received_events_url":"https://api.github.com/users/jcfr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcfr/Slicer","description":"Multi-platform, free open source software for visualization and image computing.","fork":true,"url":"https://api.github.com/repos/jcfr/Slicer","forks_url":"https://api.github.com/repos/jcfr/Slicer/forks","keys_url":"https://api.github.com/repos/jcfr/Slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcfr/Slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcfr/Slicer/teams","hooks_url":"https://api.github.com/repos/jcfr/Slicer/hooks","issue_events_url":"https://api.github.com/repos/jcfr/Slicer/issues/events{/number}","events_url":"https://api.github.com/repos/jcfr/Slicer/events","assignees_url":"https://api.github.com/repos/jcfr/Slicer/assignees{/user}","branches_url":"https://api.github.com/repos/jcfr/Slicer/branches{/branch}","tags_url":"https://api.github.com/repos/jcfr/Slicer/tags","blobs_url":"https://api.github.com/repos/jcfr/Slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcfr/Slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcfr/Slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcfr/Slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcfr/Slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/jcfr/Slicer/languages","stargazers_url":"https://api.github.com/repos/jcfr/Slicer/stargazers","contributors_url":"https://api.github.com/repos/jcfr/Slicer/contributors","subscribers_url":"https://api.github.com/repos/jcfr/Slicer/subscribers","subscription_url":"https://api.github.com/repos/jcfr/Slicer/subscription","commits_url":"https://api.github.com/repos/jcfr/Slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcfr/Slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcfr/Slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcfr/Slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcfr/Slicer/contents/{+path}","compare_url":"https://api.github.com/repos/jcfr/Slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcfr/Slicer/merges","archive_url":"https://api.github.com/repos/jcfr/Slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcfr/Slicer/downloads","issues_url":"https://api.github.com/repos/jcfr/Slicer/issues{/number}","pulls_url":"https://api.github.com/repos/jcfr/Slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/jcfr/Slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/jcfr/Slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcfr/Slicer/labels{/name}","releases_url":"https://api.github.com/repos/jcfr/Slicer/releases{/id}","created_at":"2011-07-10T23:41:26Z","updated_at":"2015-05-01T18:41:59Z","pushed_at":"2015-10-29T01:58:50Z","git_url":"git://github.com/jcfr/Slicer.git","ssh_url":"git@github.com:jcfr/Slicer.git","clone_url":"https://github.com/jcfr/Slicer.git","svn_url":"https://github.com/jcfr/Slicer","homepage":"www.slicer.org","size":485684,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Slicer:master","ref":"master","sha":"fc38d161efbe74707825a366929a872a7e6e5eb1","user":{"login":"Slicer","id":324362,"avatar_url":"https://avatars.githubusercontent.com/u/324362?v=3","gravatar_id":"","url":"https://api.github.com/users/Slicer","html_url":"https://github.com/Slicer","followers_url":"https://api.github.com/users/Slicer/followers","following_url":"https://api.github.com/users/Slicer/following{/other_user}","gists_url":"https://api.github.com/users/Slicer/gists{/gist_id}","starred_url":"https://api.github.com/users/Slicer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slicer/subscriptions","organizations_url":"https://api.github.com/users/Slicer/orgs","repos_url":"https://api.github.com/users/Slicer/repos","events_url":"https://api.github.com/users/Slicer/events{/privacy}","received_events_url":"https://api.github.com/users/Slicer/received_events","type":"Organization","site_admin":false},"repo":{"id":2006302,"name":"Slicer","full_name":"Slicer/Slicer","owner":{"login":"Slicer","id":324362,"avatar_url":"https://avatars.githubusercontent.com/u/324362?v=3","gravatar_id":"","url":"https://api.github.com/users/Slicer","html_url":"https://github.com/Slicer","followers_url":"https://api.github.com/users/Slicer/followers","following_url":"https://api.github.com/users/Slicer/following{/other_user}","gists_url":"https://api.github.com/users/Slicer/gists{/gist_id}","starred_url":"https://api.github.com/users/Slicer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slicer/subscriptions","organizations_url":"https://api.github.com/users/Slicer/orgs","repos_url":"https://api.github.com/users/Slicer/repos","events_url":"https://api.github.com/users/Slicer/events{/privacy}","received_events_url":"https://api.github.com/users/Slicer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Slicer/Slicer","description":"Multi-platform, free open source software for visualization and image computing.","fork":false,"url":"https://api.github.com/repos/Slicer/Slicer","forks_url":"https://api.github.com/repos/Slicer/Slicer/forks","keys_url":"https://api.github.com/repos/Slicer/Slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slicer/Slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slicer/Slicer/teams","hooks_url":"https://api.github.com/repos/Slicer/Slicer/hooks","issue_events_url":"https://api.github.com/repos/Slicer/Slicer/issues/events{/number}","events_url":"https://api.github.com/repos/Slicer/Slicer/events","assignees_url":"https://api.github.com/repos/Slicer/Slicer/assignees{/user}","branches_url":"https://api.github.com/repos/Slicer/Slicer/branches{/branch}","tags_url":"https://api.github.com/repos/Slicer/Slicer/tags","blobs_url":"https://api.github.com/repos/Slicer/Slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slicer/Slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slicer/Slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slicer/Slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slicer/Slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/Slicer/Slicer/languages","stargazers_url":"https://api.github.com/repos/Slicer/Slicer/stargazers","contributors_url":"https://api.github.com/repos/Slicer/Slicer/contributors","subscribers_url":"https://api.github.com/repos/Slicer/Slicer/subscribers","subscription_url":"https://api.github.com/repos/Slicer/Slicer/subscription","commits_url":"https://api.github.com/repos/Slicer/Slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slicer/Slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slicer/Slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slicer/Slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Slicer/Slicer/contents/{+path}","compare_url":"https://api.github.com/repos/Slicer/Slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slicer/Slicer/merges","archive_url":"https://api.github.com/repos/Slicer/Slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slicer/Slicer/downloads","issues_url":"https://api.github.com/repos/Slicer/Slicer/issues{/number}","pulls_url":"https://api.github.com/repos/Slicer/Slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/Slicer/Slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/Slicer/Slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slicer/Slicer/labels{/name}","releases_url":"https://api.github.com/repos/Slicer/Slicer/releases{/id}","created_at":"2011-07-06T12:27:18Z","updated_at":"2015-10-28T18:15:19Z","pushed_at":"2015-10-29T07:14:04Z","git_url":"git://github.com/Slicer/Slicer.git","ssh_url":"git@github.com:Slicer/Slicer.git","clone_url":"https://github.com/Slicer/Slicer.git","svn_url":"https://github.com/Slicer/Slicer","homepage":"www.slicer.org","size":442015,"stargazers_count":171,"watchers_count":171,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":207,"mirror_url":null,"open_issues_count":8,"forks":207,"open_issues":8,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/371"},"html":{"href":"https://github.com/Slicer/Slicer/pull/371"},"issue":{"href":"https://api.github.com/repos/Slicer/Slicer/issues/371"},"comments":{"href":"https://api.github.com/repos/Slicer/Slicer/issues/371/comments"},"review_comments":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/371/comments"},"review_comment":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Slicer/Slicer/pulls/371/commits"},"statuses":{"href":"https://api.github.com/repos/Slicer/Slicer/statuses/b966f7261119234f9039d5ed4ce516e700b47c43"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":6,"review_comments":0,"commits":2,"additions":189,"deletions":27,"changed_files":4}}