Skip to content
Snippets Groups Projects

RF: Widespread refactorings

Merged Paul McCarthy requested to merge rf/refactor into master
2 files
+ 30
30
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -564,7 +564,7 @@
"metadata": {},
"outputs": [],
"source": [
"featdir = op.join('08_fslpy', 'fmri.feat')\n",
"featdir = op.join('fslpy', 'fmri.feat')\n",
"\n",
"tstat1 = Image(op.join(featdir, 'stats', 'tstat1')).data\n",
"\n",
@@ -725,7 +725,7 @@
"metadata": {},
"outputs": [],
"source": [
"featdir = op.join(op.join('08_fslpy', 'fmri.feat'))\n",
"featdir = op.join(op.join('fslpy', 'fmri.feat'))\n",
"tstat1 = Image(op.join(featdir, 'stats', 'tstat1'))\n",
"std = Image(op.expandvars(op.join('$FSLDIR', 'data', 'standard', 'MNI152_T1_2mm')))"
]
@@ -831,7 +831,7 @@
"metadata": {},
"outputs": [],
"source": [
"featdir = op.join('08_fslpy', 'fmri.feat')\n",
"featdir = op.join('fslpy', 'fmri.feat')\n",
"func = Image(op.join(featdir, 'reg', 'example_func'))\n",
"struc = Image(op.join(featdir, 'reg', 'highres'))\n",
"std = Image(op.expandvars(op.join('$FSLDIR', 'data', 'standard', 'MNI152_T1_2mm')))"
@@ -1019,9 +1019,9 @@
"source": [
"from fsl.wrappers import robustfov\n",
"\n",
"robustfov('08_fslpy/bighead', 'bighead_cropped')\n",
"robustfov('fslpy/bighead', 'bighead_cropped')\n",
"\n",
"render('08_fslpy/bighead bighead_cropped -cm blue')"
"render('fslpy/bighead bighead_cropped -cm blue')"
]
},
{
@@ -1166,8 +1166,8 @@
"from fsl.wrappers import flirt\n",
"\n",
"std2mm = Image(op.expandvars(op.join('$FSLDIR', 'data', 'standard', 'MNI152_T1_2mm')))\n",
"tstat1 = Image(op.join('08_fslpy', 'fmri.feat', 'stats', 'tstat1'))\n",
"func2std = np.loadtxt(op.join('08_fslpy', 'fmri.feat', 'reg', 'example_func2standard.mat'))\n",
"tstat1 = Image(op.join('fslpy', 'fmri.feat', 'stats', 'tstat1'))\n",
"func2std = np.loadtxt(op.join('fslpy', 'fmri.feat', 'reg', 'example_func2standard.mat'))\n",
"\n",
"aligned = flirt(tstat1, std2mm, applyxfm=True, init=func2std, out=LOAD)\n",
"\n",
@@ -1576,8 +1576,8 @@
"# You can pass the command\n",
"# and its arguments as a single\n",
"# string, or as a sequence\n",
"print('Lines in this notebook:', run('wc -l 08_fslpy.md').strip())\n",
"print('Words in this notebook:', run(['wc', '-w', '08_fslpy.md']).strip())"
"print('Lines in this notebook:', run('wc -l fslpy.md').strip())\n",
"print('Words in this notebook:', run(['wc', '-w', 'fslpy.md']).strip())"
]
},
{
@@ -1775,7 +1775,7 @@
"metadata": {},
"outputs": [],
"source": [
"jobid = bet('08_fslpy/bighead', 'bighead_brain', submit=True)\n",
"jobid = bet('fslpy/bighead', 'bighead_brain', submit=True)\n",
"print('Job ID:', jobid)"
]
},
@@ -1798,11 +1798,11 @@
"outputs": [],
"source": [
"from fsl.utils.run import hold\n",
"jobid = bet('08_fslpy/bighead', 'bighead_brain', submit=True)\n",
"jobid = bet('fslpy/bighead', 'bighead_brain', submit=True)\n",
"print('Job ID:', jobid)\n",
"hold(jobid)\n",
"print('Done!')\n",
"render('08_fslpy/bighead bighead_brain -cm hot')"
"render('fslpy/bighead bighead_brain -cm hot')"
]
},
{
@@ -1822,7 +1822,7 @@
"outputs": [],
"source": [
"jobs = []\n",
"jobs.append(runfsl('robustfov -i 08_fslpy/bighead -r bighead_cropped', submit=True, queue='short.q'))\n",
"jobs.append(runfsl('robustfov -i fslpy/bighead -r bighead_cropped', submit=True, queue='short.q'))\n",
"jobs.append(runfsl('bet bighead_cropped bighead_brain', submit=True, queue='short.q', wait_for=jobs[-1]))\n",
"jobs.append(runfsl('fslroi bighead_brain bighead_slices 0 -1 111 3 0 -1', submit=True, queue='short.q', wait_for=jobs[-1]))\n",
"jobs.append(runfsl('fast -o bighead_fast bighead_slices', submit=True, queue='short.q', wait_for=jobs[-1]))\n",
@@ -1901,8 +1901,8 @@
"outputs": [],
"source": [
"with open('commands.log', 'wt') as cmdlog:\n",
" run('./mycmd 0', log={'cmd' : cmdlog})\n",
" run('wc -l 08_fslpy.md', log={'cmd' : cmdlog})\n",
" run('./mycmd 0', log={'cmd' : cmdlog})\n",
" run('wc -l fslpy.md', log={'cmd' : cmdlog})\n",
"\n",
"print('\\nCommand log:')\n",
"!cat commands.log"
Loading