{"action":"created","issue":{"url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/335","labels_url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/335/comments","events_url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/335/events","html_url":"https://github.com/NeuroVault/NeuroVault/pull/335","id":105708614,"number":335,"title":"Update/cognitive atlas contrast","user":{"login":"vsoch","id":814322,"avatar_url":"https://avatars.githubusercontent.com/u/814322?v=3","gravatar_id":"","url":"https://api.github.com/users/vsoch","html_url":"https://github.com/vsoch","followers_url":"https://api.github.com/users/vsoch/followers","following_url":"https://api.github.com/users/vsoch/following{/other_user}","gists_url":"https://api.github.com/users/vsoch/gists{/gist_id}","starred_url":"https://api.github.com/users/vsoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsoch/subscriptions","organizations_url":"https://api.github.com/users/vsoch/orgs","repos_url":"https://api.github.com/users/vsoch/repos","events_url":"https://api.github.com/users/vsoch/events{/privacy}","received_events_url":"https://api.github.com/users/vsoch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-10T00:23:01Z","updated_at":"2015-09-12T17:33:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NeuroVault/NeuroVault/pulls/335","html_url":"https://github.com/NeuroVault/NeuroVault/pull/335","diff_url":"https://github.com/NeuroVault/NeuroVault/pull/335.diff","patch_url":"https://github.com/NeuroVault/NeuroVault/pull/335.patch"},"body":"This PR will add contrast ids to be saved with the images. This workflow is as follows:\r\n\r\nOn edit image view, user sees option to select a task:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/814322/9777089/87e5bec2-5714-11e5-9114-8840cae07f5a.png)\r\n\r\nUser selects a task. Case 1: the task does not have contrasts defined in Cognitive Atlas:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/814322/9777106/abd39228-5714-11e5-9b12-a824ce1f27ae.png)\r\n\r\nNothing changes - the user can still write in a contrast definition.\r\n\r\nCase 2: user selects a task with contrasts in the cognitive atlas:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/814322/9777112/d49fb4e8-5714-11e5-80fa-e16c66f4f184.png)\r\n\r\nThe \"write in\" box disappears, and a new dropdown appears that is populated with the contrasts, each name is associated with the contrast ID and the new field \"cognitive_contrast_cogatlas\" in the database! If the user then browses and the contrast is not there, there is an \"Other\" option:\r\n\r\n![screenshot from 2015-09-09 17 05 57](https://cloud.githubusercontent.com/assets/814322/9777130/20239dbc-5715-11e5-9fd4-ca5a06a97612.png)\r\n\r\nSelecting \"Other\" reveals again the write in, and the write in is hidden if other is deselected:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/814322/9777141/40b94a4a-5715-11e5-9c49-85622e0ad96b.png)\r\n\r\n### Details\r\n\r\n- A new field, \"[cognitive_contrast_cogatlas](https://github.com/vsoch/NeuroVault/blob/update/cognitive-atlas-contrast/neurovault/apps/statmaps/models.py#L515)\" was added to the statistical maps to hold a CognitiveAtlasContrast. I chose to add a new field and maintain the write in \"contrast_definition\" so that the user would have the option to select a defined contrast or write in a custom one. This risks having redundant information, but:\r\n    - We can assume that if a cognitive_contrast_cogatlas is defined, it takes preference over the write in\r\n    - For our current images, I will manually go through and define these fields (to overwrite the write ins)\r\n    - the interface will only reveal the write in box for an image with task with contrasts defined in the cognitive atlas given that \"other\" is selected for the \"cognitive_contrast_cogatlas\" variable, so it will not be possible for a contrast with unique ID to exist with a write in.\r\n    - The API [now reveal both](https://github.com/vsoch/NeuroVault/blob/update/cognitive-atlas-contrast/neurovault/urls.py#L149) for this transition, so worst case scenario both pieces of information are available to the user. When NeuroVault is better integrated with a real time Cognitive Atlas API, we can completely remove the write in, and instead have the user add the new contrast. \r\n  - Given that we are now using contrasts, I think there should be some kind of cron job on the server to minimally update the contrasts/tasks each night.\r\n\r\nThis PR also includes the previous to edit the collection details, without showing the first image. I will address that in the other PR. "},"comment":{"url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/comments/139799253","html_url":"https://github.com/NeuroVault/NeuroVault/pull/335#issuecomment-139799253","issue_url":"https://api.github.com/repos/NeuroVault/NeuroVault/issues/335","id":139799253,"user":{"login":"vsoch","id":814322,"avatar_url":"https://avatars.githubusercontent.com/u/814322?v=3","gravatar_id":"","url":"https://api.github.com/users/vsoch","html_url":"https://github.com/vsoch","followers_url":"https://api.github.com/users/vsoch/followers","following_url":"https://api.github.com/users/vsoch/following{/other_user}","gists_url":"https://api.github.com/users/vsoch/gists{/gist_id}","starred_url":"https://api.github.com/users/vsoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsoch/subscriptions","organizations_url":"https://api.github.com/users/vsoch/orgs","repos_url":"https://api.github.com/users/vsoch/repos","events_url":"https://api.github.com/users/vsoch/events{/privacy}","received_events_url":"https://api.github.com/users/vsoch/received_events","type":"User","site_admin":false},"created_at":"2015-09-12T17:33:52Z","updated_at":"2015-09-12T17:33:52Z","body":"ok, the contrast selection has been added to the single image view, as well as the \"add image for neurosynth\" but I'm not sure where this page is to review it. Since we are using code over, I chose to move the functionality into another template, `_contrast_lookup.html` that can be included in both pages."}}