Commit 30e8c661 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: little tweaks

parent 48aaf997
......@@ -58,10 +58,11 @@
import os.path as op
import nibabel as nib
import numpy as np
import warnings
warnings.filterwarnings("ignore")
np.set_printoptions(suppress=True, precision=4)
```
%% Cell type:markdown id: tags:
And a little function that we can use to generate a simple orthographic plot:
......@@ -348,11 +349,11 @@
and neuroimaging data. Most of these are higher-level wrappers around the
corresponding `nibabel` types:
* The
[`fsl.data.bitmap.Bitmap`](https://users.fmrib.ox.ac.uk/~paulmc/fsleyes/fslpy/latest/fsl.data.bitmap.html)
class can be used to load a bitmap image (e.g. `jpg, `png`, etc) and
class can be used to load a bitmap image (e.g. `jpg`, `png`, etc) and
convert it to a NIfTI image.
* The
[`fsl.data.dicom.DicomImage`](https://users.fmrib.ox.ac.uk/~paulmc/fsleyes/fslpy/latest/fsl.data.dicom.html)
class uses `dcm2niix` to load NIfTI images contained within a DICOM
directory<sup>*</sup>.
......@@ -536,10 +537,11 @@
# To combine affines together, we
# have to list them in reverse -
# linear algebra is *weird*.
funcvox2mni = concat(fsl2mni, func2std, vox2fsl)
print(funcvox2mni)
```
%% Cell type:markdown id: tags:
> In the next section we will use the
......@@ -731,11 +733,11 @@
MNI152 space into structural space:
%% Cell type:code id: tags:
```
seedstruc = struc2std.transform([seedmni], 'world', 'voxel')[0]
seedstruc = struc2std.transform(seedmni, 'world', 'voxel')
seedfunc = transform(seedstruc, struc2func)
print('Seed location in MNI coordinates: ', seedmni)
print('Seed location in functional voxels:', seedfunc)
ortho(func.data, seedfunc, cursor=True)
......@@ -813,11 +815,11 @@
corresponding tool via the command-line:
%% Cell type:code id: tags:
```
from fsl.wrappers import bet, robustfov, LOAD
from fsl.wrappers import robustfov
robustfov('08_fslpy/bighead', 'bighead_cropped')
render('08_fslpy/bighead bighead_cropped -cm blue')
```
......@@ -851,10 +853,12 @@
positional arguments, and pass the additional options as keyword arguments:
%% Cell type:code id: tags:
```
from fsl.wrappers import bet
bet('bighead_cropped', 'bighead_cropped_brain', f=0.3, m=True, s=True)
render('bighead_cropped -b 40 '
'bighead_cropped_brain -cm hot '
'bighead_cropped_brain_skull -ot mask -mc 0.4 0.4 1 '
......@@ -912,10 +916,12 @@
files produced by the tool automatically loaded into memory for you:
%% Cell type:code id: tags:
```
from fsl.wrappers import LOAD
cropped = Image('bighead_cropped')
# The loaded result is called "output",
# because that is the name of the
# argument in the bet wrapper function.
......
......@@ -57,6 +57,7 @@ import nibabel as nib
import numpy as np
import warnings
warnings.filterwarnings("ignore")
np.set_printoptions(suppress=True, precision=4)
```
......@@ -321,7 +322,7 @@ corresponding `nibabel` types:
* The
[`fsl.data.bitmap.Bitmap`](https://users.fmrib.ox.ac.uk/~paulmc/fsleyes/fslpy/latest/fsl.data.bitmap.html)
class can be used to load a bitmap image (e.g. `jpg, `png`, etc) and
class can be used to load a bitmap image (e.g. `jpg`, `png`, etc) and
convert it to a NIfTI image.
* The
[`fsl.data.dicom.DicomImage`](https://users.fmrib.ox.ac.uk/~paulmc/fsleyes/fslpy/latest/fsl.data.dicom.html)
......@@ -496,6 +497,7 @@ from fsl.transform.affine import concat
# have to list them in reverse -
# linear algebra is *weird*.
funcvox2mni = concat(fsl2mni, func2std, vox2fsl)
print(funcvox2mni)
```
> In the next section we will use the
......@@ -668,7 +670,7 @@ MNI152 space into structural space:
```
seedstruc = struc2std.transform([seedmni], 'world', 'voxel')[0]
seedstruc = struc2std.transform(seedmni, 'world', 'voxel')
seedfunc = transform(seedstruc, struc2func)
print('Seed location in MNI coordinates: ', seedmni)
......@@ -744,7 +746,7 @@ corresponding tool via the command-line:
```
from fsl.wrappers import bet, robustfov, LOAD
from fsl.wrappers import robustfov
robustfov('08_fslpy/bighead', 'bighead_cropped')
......@@ -780,6 +782,8 @@ positional arguments, and pass the additional options as keyword arguments:
```
from fsl.wrappers import bet
bet('bighead_cropped', 'bighead_cropped_brain', f=0.3, m=True, s=True)
render('bighead_cropped -b 40 '
......@@ -837,6 +841,8 @@ files produced by the tool automatically loaded into memory for you:
```
from fsl.wrappers import LOAD
cropped = Image('bighead_cropped')
# The loaded result is called "output",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment