Skip to content

Commit

Permalink
DOC: Add more details of using Scripts in the library
Browse files Browse the repository at this point in the history
  • Loading branch information
acsenrafilho committed Oct 10, 2024
1 parent 9d24d5a commit 2a84562
Show file tree
Hide file tree
Showing 2 changed files with 259 additions and 232 deletions.
25 changes: 23 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The example above creates an `asldata.ASLData` object, called `data`, which will
!!! tip
There are many other image file formatts that is accepted in the `asltk` tool. We adopted the `SimpleITK` API, then one can check the image formatts in the [official documentation](https://simpleitk.readthedocs.io/en/master/IO.html)

# Example operation using `asltk`
## Example operation using `asltk`

The following examples can represents some situations on ASL data processing:

Expand All @@ -44,7 +44,7 @@ from asltk.asldata import ASLData
```


# Load and process an image
## Load and process an image

As as standard notation, the `asltk` library assumes that all the image data files are storaged and manipulated using `numpy` objects. Therefore, the following code snippets can represents the `load_image` and `save_image` pattern adopted in the tool:

Expand All @@ -58,6 +58,14 @@ type(img)
< numpy.ndarray >
```

!!! warning
The `asltk` uses the `SimpleITK` library to load and save images due to it's long list of image format options, e.g. NifTI, Nrrd, MHA, etc. However, in order to transpose to `numpy.array` data format for image processing, it is important to note that the image space rasteting format relies as follows:
```
SimpleITK -> (x,y,z,...,n_d)
Numpy -> (n_d, ..., z,y,x)
```
Where the `n_d` represents a higher order dimension in the data.

2. Saving and image

```python
Expand All @@ -72,3 +80,16 @@ Basically, one can use out tool for the general pipeline:
* Loading a data and metadata,
* Choosing the right ASL processing algorithm for the data loaded
* Saving the outcomes generated in the `asltk` tool.

## Using the library scripts

Another quick and easy way to learn how to use the ASL processing algorithms implemented in the `asltk` library is using our Python scripts.

All the scripts are located in the `asltk/scripts` folder, which is basically a simple way to run a determined kind of ASL processing.

At the moment, there are the following scripts avaliable:

1. `cbf.py`: Python script focused on calculating CBF/ATT maps using pCASL images. This script is based on the `CBFMapping` class.
2. `te_asl.py`: Python script focused on calculating T1 relaxation exchange time between Blood and Grey-Matter (T1blGM) map using pCASL multi-TE ASL images. This script is based on the `MultiTE_ASLMapping` class.

Additional scripts can be added in the `asltk` library, by the community contribution. If it is your interest, then go to the [developing scripts](contribute.md) section at the developer guidelines.
Loading

0 comments on commit 2a84562

Please sign in to comment.