Skip to content

Commit edfdaca

Browse files
authored
Merge branch 'master' into spm_version_switch
2 parents 0284f21 + 91b95c4 commit edfdaca

10 files changed

+44
-36
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
134134
&& bash -c "source activate neuro \
135135
&& pip install --no-cache-dir \
136136
https://github.com/nipy/nipype/tarball/master \
137-
https://github.com/INCF/pybids/tarball/master \
137+
https://github.com/INCF/pybids/tarball/0.6.5 \
138138
nilearn \
139139
datalad[full] \
140140
nipy \
@@ -246,7 +246,7 @@ RUN echo '{ \
246246
\n ], \
247247
\n "pip_install": [ \
248248
\n "https://github.com/nipy/nipype/tarball/master", \
249-
\n "https://github.com/INCF/pybids/tarball/master", \
249+
\n "https://github.com/INCF/pybids/tarball/0.6.5", \
250250
\n "nilearn", \
251251
\n "datalad[full]", \
252252
\n "nipy", \

Singularity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ sync && conda clean -tipsy && sync
122122
bash -c "source activate neuro
123123
pip install --no-cache-dir \
124124
https://github.com/nipy/nipype/tarball/master \
125-
https://github.com/INCF/pybids/tarball/master \
125+
https://github.com/INCF/pybids/tarball/0.6.5 \
126126
nilearn \
127127
datalad[full] \
128128
nipy \
@@ -238,7 +238,7 @@ echo '{
238238
\n ],
239239
\n "pip_install": [
240240
\n "https://github.com/nipy/nipype/tarball/master",
241-
\n "https://github.com/INCF/pybids/tarball/master",
241+
\n "https://github.com/INCF/pybids/tarball/0.6.5",
242242
\n "nilearn",
243243
\n "datalad[full]",
244244
\n "nipy",

generate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ generate_docker() {
1818
conda_install="python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions
1919
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
2020
pip_install="https://github.com/nipy/nipype/tarball/master
21-
https://github.com/INCF/pybids/tarball/master
21+
https://github.com/INCF/pybids/tarball/0.6.5
2222
nilearn datalad[full] nipy duecredit nbval" \
2323
create_env="neuro" \
2424
activate=True \
@@ -56,7 +56,7 @@ generate_singularity() {
5656
conda_install="python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions
5757
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
5858
pip_install="https://github.com/nipy/nipype/tarball/master
59-
https://github.com/INCF/pybids/tarball/master
59+
https://github.com/INCF/pybids/tarball/0.6.5
6060
nilearn datalad[full] nipy duecredit nbval" \
6161
create_env="neuro" \
6262
activate=True \

notebooks/advanced_create_interfaces.ipynb

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,17 @@
7676
"metadata": {},
7777
"outputs": [],
7878
"source": [
79-
"import nibabel as nb\n",
80-
"%matplotlib inline\n",
81-
"nb.load('/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz').orthoview();"
79+
"from nilearn.plotting import plot_anat\n",
80+
"%matplotlib inline"
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"metadata": {},
87+
"outputs": [],
88+
"source": [
89+
"plot_anat('/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz', dim=-1);"
8290
]
8391
},
8492
{
@@ -123,7 +131,7 @@
123131
"metadata": {},
124132
"outputs": [],
125133
"source": [
126-
"nb.load('/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w_bet.nii.gz').orthoview();"
134+
"plot_anat('/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w_bet.nii.gz', dim=-1);"
127135
]
128136
},
129137
{
@@ -162,7 +170,7 @@
162170
"metadata": {},
163171
"outputs": [],
164172
"source": [
165-
"nb.load(res.outputs.out_file).orthoview();"
173+
"plot_anat(res.outputs.out_file, dim=-1);"
166174
]
167175
},
168176
{
@@ -686,7 +694,7 @@
686694
"metadata": {},
687695
"outputs": [],
688696
"source": [
689-
"nb.load(result.outputs.out_file).orthoview()"
697+
"plot_anat(result.outputs.out_file, dim=-1);"
690698
]
691699
},
692700
{
@@ -765,7 +773,7 @@
765773
"metadata": {},
766774
"outputs": [],
767775
"source": [
768-
"nb.load(orig_image).orthoview()"
776+
"plot_anat(orig_image, dim=-1);"
769777
]
770778
},
771779
{
@@ -774,7 +782,7 @@
774782
"metadata": {},
775783
"outputs": [],
776784
"source": [
777-
"nb.load('translated.nii.gz').orthoview()"
785+
"plot_anat('translated.nii.gz', dim=-1);"
778786
]
779787
},
780788
{
@@ -857,7 +865,7 @@
857865
"outputs": [],
858866
"source": [
859867
"# Plot the result\n",
860-
"nb.load('translated_functioninterface.nii.gz').orthoview()"
868+
"plot_anat('translated_functioninterface.nii.gz', dim=-1);"
861869
]
862870
},
863871
{
@@ -1096,7 +1104,7 @@
10961104
"metadata": {},
10971105
"outputs": [],
10981106
"source": [
1099-
"nb.load(result.outputs.out_file).orthoview()"
1107+
"plot_anat(result.outputs.out_file, dim=-1);"
11001108
]
11011109
},
11021110
{

notebooks/basic_data_input_bids.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"metadata": {},
2626
"source": [
2727
"## The `layout` object and simple queries\n",
28-
"To begin working with pubids we need to initialize a layout object. We will need it to do all of our queries"
28+
"To begin working with pybids we need to initialize a layout object. We will need it to do all of our queries"
2929
]
3030
},
3131
{
@@ -34,7 +34,7 @@
3434
"metadata": {},
3535
"outputs": [],
3636
"source": [
37-
"from bids.grabbids import BIDSLayout\n",
37+
"from bids.layout import BIDSLayout\n",
3838
"layout = BIDSLayout(\"/data/ds000114/\")"
3939
]
4040
},
@@ -187,10 +187,10 @@
187187
},
188188
"outputs": [],
189189
"source": [
190-
"from bids.grabbids import BIDSLayout\n",
190+
"from bids.layout import BIDSLayout\n",
191191
"layout = BIDSLayout(\"/data/ds000114/\")\n",
192192
"\n",
193-
"[f.filename for f in layout.get(subject='02', task=\"linebisection\")]"
193+
"layout.get(subject='02', return_type='file', task=\"linebisection\")"
194194
]
195195
},
196196
{
@@ -209,7 +209,7 @@
209209
"source": [
210210
"def get_niftis(subject_id, data_dir):\n",
211211
" # Remember that all the necessary imports need to be INSIDE the function for the Function Interface to work!\n",
212-
" from bids.grabbids import BIDSLayout\n",
212+
" from bids.layout import BIDSLayout\n",
213213
" \n",
214214
" layout = BIDSLayout(data_dir)\n",
215215
" \n",
@@ -330,7 +330,7 @@
330330
"from nipype.interfaces.utility import IdentityInterface, Function\n",
331331
"\n",
332332
"def get_T1w(subject_id, data_dir):\n",
333-
" from bids.grabbids import BIDSLayout\n",
333+
" from bids.layout import BIDSLayout\n",
334334
" \n",
335335
" layout = BIDSLayout(data_dir)\n",
336336
" \n",
@@ -399,7 +399,7 @@
399399
"outputs": [],
400400
"source": [
401401
"def printMetadata(path, data_dir):\n",
402-
" from bids.grabbids import BIDSLayout\n",
402+
" from bids.layout import BIDSLayout\n",
403403
" layout = BIDSLayout(data_dir)\n",
404404
" print(\"\\n\\nanalyzing \" + path + \"\\nTR: \"+ str(layout.get_metadata(path)[\"RepetitionTime\"]) + \"\\n\\n\")\n",
405405
" \n",
@@ -454,7 +454,7 @@
454454
"def get_niftis(subject_id, data_dir):\n",
455455
" # Remember that all the necesary imports need to be INSIDE the function \n",
456456
" # for the Function Interface to work!\n",
457-
" from bids.grabbids import BIDSLayout\n",
457+
" from bids.layout import BIDSLayout\n",
458458
" \n",
459459
" layout = BIDSLayout(data_dir)\n",
460460
" \n",
@@ -481,7 +481,7 @@
481481
"source": [
482482
"# and now modify analyzeBOLD2\n",
483483
"def printMetadata_et(path, data_dir):\n",
484-
" from bids.grabbids import BIDSLayout\n",
484+
" from bids.layout import BIDSLayout\n",
485485
" layout = BIDSLayout(data_dir)\n",
486486
" print(\"\\n\\nanalyzing \" + path + \"\\nTR: \"+ \n",
487487
" str(layout.get_metadata(path)[\"RepetitionTime\"]) +\n",

notebooks/basic_data_output.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Data Output\n",
88
"\n",
9-
"Similarly important to data input is data output. Using a data output module allows you to restructure and rename computed output and to spatial differentiate relevant output files from the temporary computed intermediate files in the working directory. Nipype provides the following modules to handle data stream output:\n",
9+
"Similarly important to data input is data output. Using a data output module allows you to restructure and rename computed output and to spatially differentiate relevant output files from the temporary computed intermediate files in the working directory. Nipype provides the following modules to handle data stream output:\n",
1010
"\n",
1111
" DataSink\n",
1212
" JSONFileSink\n",
@@ -274,7 +274,7 @@
274274
"cell_type": "markdown",
275275
"metadata": {},
276276
"source": [
277-
"As we can see, there is way too much content that we might not really care about. To relocate and rename all the files that are relevant to you, you can use `DataSink`?"
277+
"As we can see, there is way too much content that we might not really care about. To relocate and rename all the files that are relevant to you, you can use `DataSink`."
278278
]
279279
},
280280
{
@@ -368,7 +368,7 @@
368368
"cell_type": "markdown",
369369
"metadata": {},
370370
"source": [
371-
"This is already much better. But what if you want to rename the output files to represent something a bit readable. For this `DataSink` has the `substitution` input field.\n",
371+
"This is already much better. But what if you want to rename the output files to represent something a bit more readable. For this `DataSink` has the `substitution` input field.\n",
372372
"\n",
373373
"For example, let's assume we want to get rid of the string `'task-fingerfootlips'` and `'bold_mcf'` and that we want to rename the mean file, as well as adapt the file ending of the motion parameter file:"
374374
]
@@ -413,15 +413,15 @@
413413
"cell_type": "markdown",
414414
"metadata": {},
415415
"source": [
416-
"Cool, much more clearly!"
416+
"Cool, much clearer filenames!"
417417
]
418418
},
419419
{
420420
"cell_type": "markdown",
421421
"metadata": {},
422422
"source": [
423423
"### Exercise 1\n",
424-
"Create a simple workflow for skullstriping with FSL, the first node should use `BET` interface and the second node will be a ``DataSink``. Test two method of connecting the nodes and check the content of the output directory."
424+
"Create a simple workflow for skullstriping with FSL, the first node should use `BET` interface and the second node will be a ``DataSink``. Test two methods of connecting the nodes and check the content of the output directory."
425425
]
426426
},
427427
{

notebooks/basic_workflow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@
428428
"cell_type": "markdown",
429429
"metadata": {},
430430
"source": [
431-
"Perfet!\n",
431+
"Perfect!\n",
432432
"\n",
433433
"Let's also have a closer look at the working directory:"
434434
]

notebooks/handson_analysis.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,9 +1329,9 @@
13291329
"metadata": {},
13301330
"outputs": [],
13311331
"source": [
1332-
"import nibabel as nb\n",
1333-
"mask = nb.load('/output/datasink_handson/GM_mask.nii')\n",
1334-
"mask.orthoview()"
1332+
"from nilearn.plotting import plot_anat\n",
1333+
"%matplotlib inline\n",
1334+
"plot_anat('/output/datasink_handson/GM_mask.nii', dim=-1)"
13351335
]
13361336
},
13371337
{

notebooks/introduction_dataset.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"\n",
107107
"Subject from the ds000114 dataset did five behavioral tasks. In our dataset two of them are included. \n",
108108
"\n",
109-
"The **motor task** consisted of ***finger tapping***, ***foot twitching*** and ***lip poaching*** interleaved with fixation at a cross.\n",
109+
"The **motor task** consisted of ***finger tapping***, ***foot twitching*** and ***lip pouching*** interleaved with fixation at a cross.\n",
110110
"\n",
111111
"The **landmark task** was designed to mimic the ***line bisection task*** used in neurological practice to diagnose spatial hemineglect. Two conditions were contrasted, specifically judging if a horizontal line had been bisected exactly in the middle, versus judging if a horizontal line was bisected at all. More about the dataset and studies you can find [here](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3641991/).\n",
112112
"\n",

notebooks/introduction_showcase.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"cell_type": "markdown",
180180
"metadata": {},
181181
"source": [
182-
"To show off Nipype's parallelization power, let's run the workflow in parallel, on 5 processors and let's stop the execution time:"
182+
"To show off Nipype's parallelization power, let's run the workflow in parallel, on 5 processors and let's show the execution time:"
183183
]
184184
},
185185
{

0 commit comments

Comments
 (0)