{"action":"created","comment":{"url":"https://api.github.com/repos/nipy/dipy/pulls/comments/25370875","id":25370875,"diff_hunk":"@@ -0,0 +1,319 @@\n+\"\"\"\n+================================================\n+Using Various Tissue Classifier for Tractography\n+================================================\n+The tissue classifier determines if the tracking stops or continues at each\n+tracking position. If the tracking stops, it can either be because it reaches\n+an ending region (e.g. low FA, gray matter or corticospinal fluid regions),\n+because it exit the image boundary or because the direction getter has no\n+direction to follow. Each tissue classifier determines if the stoping is 'valid'\n+or 'invalid'. A streamline is 'valid' when the tissue classifier determines the\n+streamline stops in a position classified as 'ENDPOINT' or 'OUTSIDEIMAGE'. A\n+streamline is 'invalid' when it stops in a position classified as 'TRACKPOINT'\n+or 'INVALIDPOINT'. These conditions are described below. The 'LocalTracking'\n+generator can be set to output all generated streamlines or only the 'valid'\n+ones.\n+\n+This example is an extension of the\n+:ref:``example_deterministic_fiber_tracking`` example. We begin by loading the\n+data, fitting a constant solid angle (CSA) reconstruction\n+model and creating the maximum determnistic direction getter.\n+\"\"\"\n+\n+import numpy as np\n+\n+from dipy.data import read_stanford_labels, default_sphere\n+from dipy.direction import DeterministicMaximumDirectionGetter\n+from dipy.io.trackvis import save_trk\n+from dipy.reconst.shm import CsaOdfModel\n+from dipy.tracking.local import LocalTracking\n+from dipy.tracking import utils\n+from dipy.viz import fvtk\n+from dipy.viz.colormap import line_colors\n+\n+ren = fvtk.ren()\n+\n+hardi_img, gtab, labels_img = read_stanford_labels()\n+data = hardi_img.get_data()\n+labels = labels_img.get_data()\n+affine = hardi_img.get_affine()\n+\n+seed_mask = labels == 2\n+white_matter = (labels == 1) | (labels == 2)\n+seeds = utils.seeds_from_mask(seed_mask, density=2, affine=affine)\n+\n+csa_model = CsaOdfModel(gtab, 4)\n+csa_fit = csa_model.fit(data, mask=white_matter)\n+\n+dg = DeterministicMaximumDirectionGetter.from_shcoeff(csa_fit.shm_coeff,\n+                                                      max_angle=30.,\n+                                                      sphere=default_sphere)\n+\n+\"\"\"\n+Threshold Tissue Classifier\n+---------------------------\n+A scalar map can be used to build a tissue classifier by thresholding it to a\n+fixed value. Here, we show an example using the fractional anisotropy (FA) map\n+of the DTI model. The threshold tissue classifier uses a trilinear\n+interpolation method at the tracking position.","path":"doc/examples/tracking_tissue_classifier.py","position":58,"original_position":58,"commit_id":"50e6b116d9b8d1cca8335bfdef9e2a0819202555","original_commit_id":"50e6b116d9b8d1cca8335bfdef9e2a0819202555","user":{"login":"Garyfallidis","id":134276,"avatar_url":"https://avatars.githubusercontent.com/u/134276?v=3","gravatar_id":"","url":"https://api.github.com/users/Garyfallidis","html_url":"https://github.com/Garyfallidis","followers_url":"https://api.github.com/users/Garyfallidis/followers","following_url":"https://api.github.com/users/Garyfallidis/following{/other_user}","gists_url":"https://api.github.com/users/Garyfallidis/gists{/gist_id}","starred_url":"https://api.github.com/users/Garyfallidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garyfallidis/subscriptions","organizations_url":"https://api.github.com/users/Garyfallidis/orgs","repos_url":"https://api.github.com/users/Garyfallidis/repos","events_url":"https://api.github.com/users/Garyfallidis/events{/privacy}","received_events_url":"https://api.github.com/users/Garyfallidis/received_events","type":"User","site_admin":false},"body":"Sentence not clear!","created_at":"2015-02-25T19:34:45Z","updated_at":"2015-02-25T19:34:45Z","html_url":"https://github.com/nipy/dipy/pull/565#discussion_r25370875","pull_request_url":"https://api.github.com/repos/nipy/dipy/pulls/565","_links":{"self":{"href":"https://api.github.com/repos/nipy/dipy/pulls/comments/25370875"},"html":{"href":"https://github.com/nipy/dipy/pull/565#discussion_r25370875"},"pull_request":{"href":"https://api.github.com/repos/nipy/dipy/pulls/565"}}},"pull_request":{"url":"https://api.github.com/repos/nipy/dipy/pulls/565","id":27795354,"html_url":"https://github.com/nipy/dipy/pull/565","diff_url":"https://github.com/nipy/dipy/pull/565.diff","patch_url":"https://github.com/nipy/dipy/pull/565.patch","issue_url":"https://api.github.com/repos/nipy/dipy/issues/565","number":565,"state":"open","locked":false,"title":"Adding New Tissue Classifiers","user":{"login":"gabknight","id":702455,"avatar_url":"https://avatars.githubusercontent.com/u/702455?v=3","gravatar_id":"","url":"https://api.github.com/users/gabknight","html_url":"https://github.com/gabknight","followers_url":"https://api.github.com/users/gabknight/followers","following_url":"https://api.github.com/users/gabknight/following{/other_user}","gists_url":"https://api.github.com/users/gabknight/gists{/gist_id}","starred_url":"https://api.github.com/users/gabknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabknight/subscriptions","organizations_url":"https://api.github.com/users/gabknight/orgs","repos_url":"https://api.github.com/users/gabknight/repos","events_url":"https://api.github.com/users/gabknight/events{/privacy}","received_events_url":"https://api.github.com/users/gabknight/received_events","type":"User","site_admin":false},"body":"Ok, this is ready to be reviewed.\r\n\r\nThe main changes are:\r\n- Fetch/Read fonctions for stanford pve map.\r\n- new tissue classifiers: BinaryTissueClassifier, ActTissueClassifier\r\n- a new parameter to localtracking.LocalTracking: return_all=True\r\n  - if True (default), return all generated streamlines.\r\n  - if False, return only streamlines having both streamline extremities stopped with a 'ENDPOINT' or 'OUTSIDEIMAGE' tissue classifier state, i.e. with ACT, streamlines connecting the gm or exiting through the brain stem.\r\n\r\nBest,\r\nGab\r\n\r\n","created_at":"2015-01-21T21:14:00Z","updated_at":"2015-02-25T19:34:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca3f5fd28b63a812dbe792a060e2aa39904b76c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nipy/dipy/pulls/565/commits","review_comments_url":"https://api.github.com/repos/nipy/dipy/pulls/565/comments","review_comment_url":"https://api.github.com/repos/nipy/dipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nipy/dipy/issues/565/comments","statuses_url":"https://api.github.com/repos/nipy/dipy/statuses/50e6b116d9b8d1cca8335bfdef9e2a0819202555","head":{"label":"gabknight:add_anatomical_stopping_criteria","ref":"add_anatomical_stopping_criteria","sha":"50e6b116d9b8d1cca8335bfdef9e2a0819202555","user":{"login":"gabknight","id":702455,"avatar_url":"https://avatars.githubusercontent.com/u/702455?v=3","gravatar_id":"","url":"https://api.github.com/users/gabknight","html_url":"https://github.com/gabknight","followers_url":"https://api.github.com/users/gabknight/followers","following_url":"https://api.github.com/users/gabknight/following{/other_user}","gists_url":"https://api.github.com/users/gabknight/gists{/gist_id}","starred_url":"https://api.github.com/users/gabknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabknight/subscriptions","organizations_url":"https://api.github.com/users/gabknight/orgs","repos_url":"https://api.github.com/users/gabknight/repos","events_url":"https://api.github.com/users/gabknight/events{/privacy}","received_events_url":"https://api.github.com/users/gabknight/received_events","type":"User","site_admin":false},"repo":{"id":7783019,"name":"dipy","full_name":"gabknight/dipy","owner":{"login":"gabknight","id":702455,"avatar_url":"https://avatars.githubusercontent.com/u/702455?v=3","gravatar_id":"","url":"https://api.github.com/users/gabknight","html_url":"https://github.com/gabknight","followers_url":"https://api.github.com/users/gabknight/followers","following_url":"https://api.github.com/users/gabknight/following{/other_user}","gists_url":"https://api.github.com/users/gabknight/gists{/gist_id}","starred_url":"https://api.github.com/users/gabknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabknight/subscriptions","organizations_url":"https://api.github.com/users/gabknight/orgs","repos_url":"https://api.github.com/users/gabknight/repos","events_url":"https://api.github.com/users/gabknight/events{/privacy}","received_events_url":"https://api.github.com/users/gabknight/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabknight/dipy","description":"Diffusion MR Imaging in Python","fork":true,"url":"https://api.github.com/repos/gabknight/dipy","forks_url":"https://api.github.com/repos/gabknight/dipy/forks","keys_url":"https://api.github.com/repos/gabknight/dipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabknight/dipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabknight/dipy/teams","hooks_url":"https://api.github.com/repos/gabknight/dipy/hooks","issue_events_url":"https://api.github.com/repos/gabknight/dipy/issues/events{/number}","events_url":"https://api.github.com/repos/gabknight/dipy/events","assignees_url":"https://api.github.com/repos/gabknight/dipy/assignees{/user}","branches_url":"https://api.github.com/repos/gabknight/dipy/branches{/branch}","tags_url":"https://api.github.com/repos/gabknight/dipy/tags","blobs_url":"https://api.github.com/repos/gabknight/dipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabknight/dipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabknight/dipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabknight/dipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabknight/dipy/statuses/{sha}","languages_url":"https://api.github.com/repos/gabknight/dipy/languages","stargazers_url":"https://api.github.com/repos/gabknight/dipy/stargazers","contributors_url":"https://api.github.com/repos/gabknight/dipy/contributors","subscribers_url":"https://api.github.com/repos/gabknight/dipy/subscribers","subscription_url":"https://api.github.com/repos/gabknight/dipy/subscription","commits_url":"https://api.github.com/repos/gabknight/dipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabknight/dipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabknight/dipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabknight/dipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabknight/dipy/contents/{+path}","compare_url":"https://api.github.com/repos/gabknight/dipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabknight/dipy/merges","archive_url":"https://api.github.com/repos/gabknight/dipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabknight/dipy/downloads","issues_url":"https://api.github.com/repos/gabknight/dipy/issues{/number}","pulls_url":"https://api.github.com/repos/gabknight/dipy/pulls{/number}","milestones_url":"https://api.github.com/repos/gabknight/dipy/milestones{/number}","notifications_url":"https://api.github.com/repos/gabknight/dipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabknight/dipy/labels{/name}","releases_url":"https://api.github.com/repos/gabknight/dipy/releases{/id}","created_at":"2013-01-23T20:23:26Z","updated_at":"2015-02-23T20:19:58Z","pushed_at":"2015-02-23T20:19:56Z","git_url":"git://github.com/gabknight/dipy.git","ssh_url":"git@github.com:gabknight/dipy.git","clone_url":"https://github.com/gabknight/dipy.git","svn_url":"https://github.com/gabknight/dipy","homepage":"http://dipy.org","size":15501,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"nipy:master","ref":"master","sha":"769a12f012c7076493efb190222165b898cc771b","user":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"repo":{"id":505209,"name":"dipy","full_name":"nipy/dipy","owner":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nipy/dipy","description":"Diffusion MR Imaging in Python","fork":false,"url":"https://api.github.com/repos/nipy/dipy","forks_url":"https://api.github.com/repos/nipy/dipy/forks","keys_url":"https://api.github.com/repos/nipy/dipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nipy/dipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nipy/dipy/teams","hooks_url":"https://api.github.com/repos/nipy/dipy/hooks","issue_events_url":"https://api.github.com/repos/nipy/dipy/issues/events{/number}","events_url":"https://api.github.com/repos/nipy/dipy/events","assignees_url":"https://api.github.com/repos/nipy/dipy/assignees{/user}","branches_url":"https://api.github.com/repos/nipy/dipy/branches{/branch}","tags_url":"https://api.github.com/repos/nipy/dipy/tags","blobs_url":"https://api.github.com/repos/nipy/dipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nipy/dipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nipy/dipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/nipy/dipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nipy/dipy/statuses/{sha}","languages_url":"https://api.github.com/repos/nipy/dipy/languages","stargazers_url":"https://api.github.com/repos/nipy/dipy/stargazers","contributors_url":"https://api.github.com/repos/nipy/dipy/contributors","subscribers_url":"https://api.github.com/repos/nipy/dipy/subscribers","subscription_url":"https://api.github.com/repos/nipy/dipy/subscription","commits_url":"https://api.github.com/repos/nipy/dipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/nipy/dipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/nipy/dipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/nipy/dipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/nipy/dipy/contents/{+path}","compare_url":"https://api.github.com/repos/nipy/dipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nipy/dipy/merges","archive_url":"https://api.github.com/repos/nipy/dipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nipy/dipy/downloads","issues_url":"https://api.github.com/repos/nipy/dipy/issues{/number}","pulls_url":"https://api.github.com/repos/nipy/dipy/pulls{/number}","milestones_url":"https://api.github.com/repos/nipy/dipy/milestones{/number}","notifications_url":"https://api.github.com/repos/nipy/dipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nipy/dipy/labels{/name}","releases_url":"https://api.github.com/repos/nipy/dipy/releases{/id}","created_at":"2010-02-06T11:43:08Z","updated_at":"2015-02-25T00:25:40Z","pushed_at":"2015-02-25T00:25:40Z","git_url":"git://github.com/nipy/dipy.git","ssh_url":"git@github.com:nipy/dipy.git","clone_url":"https://github.com/nipy/dipy.git","svn_url":"https://github.com/nipy/dipy","homepage":"http://dipy.org","size":19533,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"open_issues_count":60,"forks":73,"open_issues":60,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nipy/dipy/pulls/565"},"html":{"href":"https://github.com/nipy/dipy/pull/565"},"issue":{"href":"https://api.github.com/repos/nipy/dipy/issues/565"},"comments":{"href":"https://api.github.com/repos/nipy/dipy/issues/565/comments"},"review_comments":{"href":"https://api.github.com/repos/nipy/dipy/pulls/565/comments"},"review_comment":{"href":"https://api.github.com/repos/nipy/dipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nipy/dipy/pulls/565/commits"},"statuses":{"href":"https://api.github.com/repos/nipy/dipy/statuses/50e6b116d9b8d1cca8335bfdef9e2a0819202555"}}}}