Skip to content

Commit e8d7cb2

Browse files
committed
ENH: changes order of solution and answer cell, plus some other small changes
1 parent 66f2672 commit e8d7cb2

9 files changed

+289
-379
lines changed

notebooks/basic_data_input.ipynb

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,22 @@
236236
},
237237
{
238238
"cell_type": "markdown",
239+
"metadata": {},
240+
"source": [
241+
"### Exercise 1\n",
242+
"Grab T1w images from both sessions - ``ses-test`` and ``ses-retest`` for ``sub-01``."
243+
]
244+
},
245+
{
246+
"cell_type": "code",
247+
"execution_count": null,
239248
"metadata": {
240249
"solution2": "hidden",
241250
"solution2_first": true
242251
},
252+
"outputs": [],
243253
"source": [
244-
"### Exercise 1\n",
245-
"Grab T1w images from both sessions - ``ses-test`` and ``ses-retest`` for ``sub-01``."
254+
"# write your solution here"
246255
]
247256
},
248257
{
@@ -291,15 +300,6 @@
291300
"ex1_res.outputs"
292301
]
293302
},
294-
{
295-
"cell_type": "code",
296-
"execution_count": null,
297-
"metadata": {},
298-
"outputs": [],
299-
"source": [
300-
"# write your solution here"
301-
]
302-
},
303303
{
304304
"cell_type": "markdown",
305305
"metadata": {},
@@ -383,7 +383,6 @@
383383
"outputs": [],
384384
"source": [
385385
"from nipype import SelectFiles, Node\n",
386-
"from os.path import abspath as opap\n",
387386
"\n",
388387
"# String template with {}-based strings\n",
389388
"templates = {'anat': 'sub-*/ses-{ses_name}/anat/sub-*_ses-{ses_name}_T1w.nii.gz'}\n",
@@ -416,13 +415,22 @@
416415
},
417416
{
418417
"cell_type": "markdown",
418+
"metadata": {},
419+
"source": [
420+
"### Exercise 2\n",
421+
"Use ``SelectFile`` to select again T1w images from both sessions - ``ses-test`` and ``ses-retest`` for ``sub-01``."
422+
]
423+
},
424+
{
425+
"cell_type": "code",
426+
"execution_count": null,
419427
"metadata": {
420428
"solution2": "hidden",
421429
"solution2_first": true
422430
},
431+
"outputs": [],
423432
"source": [
424-
"### Exercise 2\n",
425-
"Use ``SelectFile`` to select again T1w images from both sessions - ``ses-test`` and ``ses-retest`` for ``sub-01``."
433+
"# write your solution here"
426434
]
427435
},
428436
{
@@ -451,15 +459,6 @@
451459
"sf.run().outputs"
452460
]
453461
},
454-
{
455-
"cell_type": "code",
456-
"execution_count": null,
457-
"metadata": {},
458-
"outputs": [],
459-
"source": [
460-
"# write your solution here"
461-
]
462-
},
463462
{
464463
"cell_type": "markdown",
465464
"metadata": {},
@@ -482,7 +481,7 @@
482481
"metadata": {},
483482
"outputs": [],
484483
"source": [
485-
"!datalad get -r -J4 /data/ds000114/derivatives/freesurfer/sub-01/"
484+
"!datalad get -r -J4 /data/ds000114/derivatives/freesurfer/sub-01"
486485
]
487486
},
488487
{
@@ -560,7 +559,6 @@
560559
"outputs": [],
561560
"source": [
562561
"print('aparc_aseg: %s\\n' % result.outputs.aparc_aseg)\n",
563-
"print('brainmask: %s\\n' % result.outputs.brainmask)\n",
564562
"print('inflated: %s\\n' % result.outputs.inflated)"
565563
]
566564
},
@@ -608,7 +606,7 @@
608606
"metadata": {
609607
"anaconda-cloud": {},
610608
"kernelspec": {
611-
"display_name": "Python 3",
609+
"display_name": "Python [default]",
612610
"language": "python",
613611
"name": "python3"
614612
},

notebooks/basic_data_input_bids.ipynb

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@
161161
},
162162
{
163163
"cell_type": "markdown",
164-
"metadata": {
165-
"solution2": "hidden",
166-
"solution2_first": true
167-
},
164+
"metadata": {},
168165
"source": [
169166
"### Exercise 1:\n",
170167
"List all files for the \"linebisection\" task for subject 02."
@@ -174,23 +171,26 @@
174171
"cell_type": "code",
175172
"execution_count": null,
176173
"metadata": {
177-
"solution2": "hidden"
174+
"solution2": "hidden",
175+
"solution2_first": true
178176
},
179177
"outputs": [],
180178
"source": [
181-
"from bids.grabbids import BIDSLayout\n",
182-
"layout = BIDSLayout(\"/data/ds000114/\")\n",
183-
"\n",
184-
"[f.filename for f in layout.get(subject='02', task=\"linebisection\")]"
179+
"#write your solution here"
185180
]
186181
},
187182
{
188183
"cell_type": "code",
189184
"execution_count": null,
190-
"metadata": {},
185+
"metadata": {
186+
"solution2": "hidden"
187+
},
191188
"outputs": [],
192189
"source": [
193-
"#write your solution here"
190+
"from bids.grabbids import BIDSLayout\n",
191+
"layout = BIDSLayout(\"/data/ds000114/\")\n",
192+
"\n",
193+
"[f.filename for f in layout.get(subject='02', task=\"linebisection\")]"
194194
]
195195
},
196196
{
@@ -300,13 +300,22 @@
300300
},
301301
{
302302
"cell_type": "markdown",
303+
"metadata": {},
304+
"source": [
305+
"### Exercise 2:\n",
306+
"Modify the `BIDSDataGrabber` and the workflow to collect T1ws images for subject `10`."
307+
]
308+
},
309+
{
310+
"cell_type": "code",
311+
"execution_count": null,
303312
"metadata": {
304313
"solution2": "hidden",
305314
"solution2_first": true
306315
},
316+
"outputs": [],
307317
"source": [
308-
"### Exercise 2:\n",
309-
"Modify the `BIDSDataGrabber` and the workflow to collect T1ws images for subject `10`."
318+
"# write your solution here"
310319
]
311320
},
312321
{
@@ -340,15 +349,6 @@
340349
"ex2_res.outputs"
341350
]
342351
},
343-
{
344-
"cell_type": "code",
345-
"execution_count": null,
346-
"metadata": {},
347-
"outputs": [],
348-
"source": [
349-
"# write your solution here"
350-
]
351-
},
352352
{
353353
"cell_type": "markdown",
354354
"metadata": {},
@@ -421,13 +421,22 @@
421421
},
422422
{
423423
"cell_type": "markdown",
424+
"metadata": {},
425+
"source": [
426+
"### Exercise 3:\n",
427+
"Modify the `printMetadata` function to also print `EchoTime` "
428+
]
429+
},
430+
{
431+
"cell_type": "code",
432+
"execution_count": null,
424433
"metadata": {
425434
"solution2": "hidden",
426435
"solution2_first": true
427436
},
437+
"outputs": [],
428438
"source": [
429-
"### Exercise 3:\n",
430-
"Modify the `printMetadata` function to also print `EchoTime` "
439+
"# write your solution here"
431440
]
432441
},
433442
{
@@ -489,20 +498,11 @@
489498
"ex3_wf.connect(ex3_BIDSDataGrabber, \"bolds\", ex3_analyzeBOLD2, \"path\")\n",
490499
"ex3_wf.run()"
491500
]
492-
},
493-
{
494-
"cell_type": "code",
495-
"execution_count": null,
496-
"metadata": {},
497-
"outputs": [],
498-
"source": [
499-
"# write your solution here"
500-
]
501501
}
502502
],
503503
"metadata": {
504504
"kernelspec": {
505-
"display_name": "Python 3",
505+
"display_name": "Python [default]",
506506
"language": "python",
507507
"name": "python3"
508508
},

notebooks/basic_data_output.ipynb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,22 @@
280280
},
281281
{
282282
"cell_type": "markdown",
283+
"metadata": {},
284+
"source": [
285+
"### Exercise 1\n",
286+
"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."
287+
]
288+
},
289+
{
290+
"cell_type": "code",
291+
"execution_count": null,
283292
"metadata": {
284293
"solution2": "hidden",
285294
"solution2_first": true
286295
},
296+
"outputs": [],
287297
"source": [
288-
"### Exercise 1\n",
289-
"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."
298+
"# write your solution here"
290299
]
291300
},
292301
{
@@ -375,21 +384,12 @@
375384
"# and check the content of the output directory (you should see a new `bet` subdirectory with both files)\n",
376385
"! tree /output/working_dir/ex1_output"
377386
]
378-
},
379-
{
380-
"cell_type": "code",
381-
"execution_count": null,
382-
"metadata": {},
383-
"outputs": [],
384-
"source": [
385-
"# write your solution here"
386-
]
387387
}
388388
],
389389
"metadata": {
390390
"anaconda-cloud": {},
391391
"kernelspec": {
392-
"display_name": "Python 3",
392+
"display_name": "Python [default]",
393393
"language": "python",
394394
"name": "python3"
395395
},

0 commit comments

Comments
 (0)