|
| 1 | +.. _prerequisites-contributing: |
1 | 2 |
|
2 | 3 | Prerequisites to contributing templates to TemplateFlow |
3 | | -############################################################ |
| 4 | +======================================================= |
4 | 5 |
|
5 | | -Who is this tutorial for? |
6 | | -================================= |
| 6 | +.. admonition :: Who is this tutorial for? |
7 | 7 |
|
8 | | -Have a template that you would like to see on TemplateFlow? Great! |
9 | | -Contributions are welcome. |
10 | | -This document goes through some of the prerequisites needed to submit a template. |
11 | | -Once you have these prerequisites achieved. |
| 8 | + Have a template that you would like to see on TemplateFlow? Great! |
| 9 | + Contributions are welcome. |
| 10 | + This document goes through some of the prerequisites needed to submit a template. |
| 11 | + Once you have these prerequisites achieved. |
12 | 12 |
|
13 | 13 | Are you allowed to share the template? |
14 | | -========================================== |
15 | | - |
| 14 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
16 | 15 | Templates have a licence which specifies the terms that they can be shared. |
17 | 16 | TemplateFlow can only include templates that allow for redistribution. |
18 | | -It is okay if the template requires attribution, but you need to make sure to add the attribution information. |
| 17 | +It is okay if the template requires attribution, but you need to make sure to |
| 18 | +add the attribution information into the ``template_description.json`` file. |
19 | 19 |
|
20 | 20 | What type of contribution are you making? |
21 | | -============================================ |
22 | | - |
| 21 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
23 | 22 | There are three different types of contributions you can make to TemplateFlow. |
24 | 23 |
|
25 | | -**A new template space**. |
26 | | -This contribution involves adding a new space that does not currently exist. |
27 | | -Let us say you have made a new pediatric space that you transform your images to; this would be a new template space. |
28 | | -All the different MNI templates are each considered their own template space. |
29 | | -Currently this requires writing permissions to the TemplateFlow repo. |
30 | | -For now, if you do not have access open up an issue in the templateflow repo to say which template spaces should be added. |
| 24 | +A new template space |
| 25 | + This contribution involves adding a new space that does not currently exist. |
| 26 | + Let us say you have made a new pediatric space that you transform your images to; this would be a new template space. |
| 27 | + All the different MNI templates are each considered their own template space. |
| 28 | + Currently this requires writing permissions to the TemplateFlow repo. |
| 29 | + For now, if you do not have access open up an issue in the templateflow repo |
| 30 | + to say which template spaces should be added. |
31 | 31 |
|
32 | | -**Nifti images within an existing template space**. |
33 | | -This contribution involves adding to a template space that currently exists. |
34 | | -An example of this would be adding a nifti file that is an atlas. |
35 | | -You need to know which template space your atlas is in (Note: there are multiple MNI spaces). |
| 32 | +NIfTI images within an existing template space |
| 33 | + This contribution involves adding to a template space that currently exists. |
| 34 | + An example of this would be adding a nifti file that is an atlas. |
| 35 | + You need to know which template space your atlas is in (Note: there are multiple MNI spaces). |
36 | 36 |
|
37 | | -**Meta information**. |
38 | | -This contribution involves additional information about existing templates. |
39 | | -These will generally be in .json or .tsv files. |
40 | | -There are also transform files which help translate between templates. |
| 37 | +Meta information |
| 38 | + This contribution involves additional information about existing templates. |
| 39 | + These will generally be in ``.json`` or ``.tsv`` files. |
| 40 | + There are also transform files which help translate between templates. |
41 | 41 |
|
42 | 42 | There are tutorials for each of these three different types of contributions. |
43 | 43 |
|
44 | 44 | Prerequisites for uploading nifti files |
45 | | -===================================================== |
46 | | - |
47 | | -Aside from typical requirements (python3, git, pip), some prerequisites need addressing before you can upload a template (i.e. any image file). |
| 45 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 46 | +Aside from typical requirements (Python, git, pip), some prerequisites need addressing |
| 47 | +before you can upload a template (i.e. any image file). |
48 | 48 |
|
49 | | -1. Getting access to the OSF repository. Create an issue stating you would like to access to the OSF repo. You need an account at: `osf.io <https://osf.io>`_ |
| 49 | +1. Getting access to the OSF repository. |
| 50 | + Create an issue stating you would like to access to the OSF repo. |
| 51 | + You need an account at: `osf.io <https://osf.io>`__. |
50 | 52 | 2. Download the OSF client: ``pip install osfclient``. |
51 | | -3. Install `DataLad <https://www.datalad.org>`_. See the `installation page <https://www.datalad.org/get_DataLad.html>`_ for more details. |
52 | | -4. You also need TemplateFlows DataLad/osf tools. To install these type in a terminal: ``pip install git+https://github.com/TemplateFlow/DataLad-osf``. |
| 53 | +3. Install `DataLad <https://www.datalad.org>`_. |
| 54 | + See the `installation page <https://www.datalad.org/get_DataLad.html>`_ for more details. |
| 55 | +4. You also need TemplateFlow's DataLad/OSF tools. |
| 56 | + To install these type in a terminal: ``pip install git+https://github.com/TemplateFlow/DataLad-osf``. |
53 | 57 |
|
54 | 58 | After installing these tools, you are ready to upload a template. |
55 | 59 |
|
56 | | -If you only plan to contribute metadata (e.g. json files and tsv files), then these three steps are not needed. |
| 60 | +If you only plan to contribute metadata (e.g. JSON files and TSV files), then these three steps are not needed. |
57 | 61 |
|
58 | 62 | Initializing the TemplateFlow OSF directory |
59 | | -================================================== |
60 | | - |
| 63 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
61 | 64 | Once you have the prerequisites set up, you can initialize the OSF directory onto your computer. |
62 | 65 |
|
63 | 66 | In a new directory type: |
64 | 67 |
|
65 | 68 | .. code-block:: bash |
66 | | - |
| 69 | +
|
67 | 70 | osf init |
68 | 71 |
|
69 | 72 | This will prompt you for your username and TemplateFlow project number. |
|
0 commit comments