Skip to content

Commit

Permalink
Merge pull request #53 from reghbali/reghbali_remove_dep_inj
Browse files Browse the repository at this point in the history
Reghbali remove dep inj
  • Loading branch information
reghbali authored Sep 11, 2024
2 parents 901e26d + ab4d926 commit 0804be7
Show file tree
Hide file tree
Showing 19 changed files with 906 additions and 337 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ data directory structure (press enter for default) (alfe, bids) [alfe]:
The directory structure that pyALFE expects in the input directory and will follow when creating the output. See [Inupt directory](#input-directory) for information on ALFE and BIDS.
This config value can be overwritten when calling `payalfe run` via `-dds` or `--data-dir-structure` option.

#### Tissue Segmentation
```bash
tissue segmentation method (press enter for default) (prior, synthseg) [prior]:
```

The tissue segmentation method that will be used by pyALFE. The default is based on the method described in this [paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8346689/), a UNet
that receives a template-based **prior** map tissue alongside the image . pyALFE
also supports [SynthSeg](https://www.sciencedirect.com/science/article/pii/S1361841523000506) via [FreeSurfer](https://surfer.nmr.mgh.harvard.edu/fswiki/SynthSeg). To use SynthSeg, you have to have FreeSurfer >= v7
installed.

### Running the pipeline
To run PyALFE for an accession

Expand Down
7 changes: 4 additions & 3 deletions docs/api/main.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pyalfe.main
===========

.. click:: pyalfe.main:main
:prog: pyalfe
:nested: full
.. automodule:: pyalfe.main
:members:
:undoc-members:
:show-inheritance:
45 changes: 41 additions & 4 deletions docs/guides/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Tutorial

In this tutorial, you will download sample data, install pyalfe, and run it on this data.
This tutorial requires `git`, `python>=3.9`, [greedy](https://sourceforge.net/projects/greedy-reg/files/),
and [c3d](https://sourceforge.net/projects/c3d/).
In this tutorial, you will download sample data, install pyalfe, configure it, and run it on this data.
This tutorial requires `git`, `python>=3.9`, [greedy](https://sourceforge.net/projects/greedy-reg/files/).


## Data download and directory setup
Expand All @@ -15,7 +14,7 @@ This will create a directory named `pyalfe-test-data` and downloads the tutorial
data inside it. The data is the MRI scan of a glioblastoma patient and is
taken from the [UPenn-GBM dataset](https://www.nature.com/articles/s41597-022-01560-7).

2. Create an output directory where you have write access
2. Create the output directory
```bash
mkdir -p pyalfe-output
```
Expand All @@ -38,8 +37,46 @@ Download models
pyalfe download models
```

Configure pyalfe by running
```bash
pyalfe configrue
```
and simply pressing enter for all the prompts for default values.

## Run
```bash
pyalfe run UPENNGBM0000511 --input-dir pyalfe-test-data --output-dir pyalfe-output
```

## Pipeline output
You can now inspect the pipeline output by changing directory to

```bash
cd pyalfe-output/UPENNGBM0000511
```
and exploring the `FLAIR`, `T1`, `T1Post`, `T2`, `ADC` subdirectories.

For instance, the individual FLAIR lesion measures can be found at:
```bash
FLAIR/quantification/UPENNGBM0000511_SummaryLesionMeasures.csv
```

FLAIR lesion segmentation can be found at:
```bash
FLAIR/abnormalmap/UPENNGBM0000511_FLAIR_abnormal_seg.nii.gz
```

Summary T1Post (enhancing) lesion measures can be found at:
```bash
T1Post/quantification/UPENNGBM0000511_IndividualLesionMeasures.csv
```

Brain volumetric measures can be found at:
```bash
T1/quantification/UPENNGBM0000511_volumeMeasures.csv
```

The tissue segmentation can be found at:
```bash
T1/UPENNGBM0000511_T1_tissue_seg.nii.gz
```
29 changes: 20 additions & 9 deletions docs/guides/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We recommend running the configure command first to create a configuration file
However, you can skip to [Running the pipeline](#running-the-pipeline) section if you prefer to provide all the required configuration through command line
options.
### Configuration
To configrue the PyALFE pipeline you should run:
To configure the PyALFE pipeline, you should run:
```bash
pyalfe configure
```
Expand Down Expand Up @@ -120,31 +120,42 @@ This config value can be overwritten when calling `pyalfe run` via `-dt` or `--d

#### Image processor
```bash
image processor to use (c3d, nilearn) [c3d]:
image processor to use (nilearn, c3d) [nilearn]:
```
Currently, pyalfe can be configures to use either Convert3D (a.k.a. c3d) or Nilearn for image processing tasks.
The default is Convert3d aka c3d. In other to use c3d,
you have to download it using the [download command](#download-models).
To use Nilearn, you do not need to run any extra command since it is already installed when you install pyalfe.
Currently, pyalfe can be configured to use either Nilearn, Convert3D (a.k.a. c3d) for image processing tasks.
The default is Nilearn which is a python native library and is installed during installation of pyalfe.
To use c3d, you have to download and install it (https://sourceforge.net/projects/c3d/) on your machine.

This config value can be overwritten when calling `pyalfe run` via `-ip` or `--image_processing` option.

#### Image Registration
```bash
image registration to use (greedy, ants) [greedy]:
```
Currently, pyalfe can be configures to use either greedy or ants for image registration tasks. The default is greedy.
In other to use greedy, you have to download it using the [download command](#download-models). To use ants,
Currently, pyalfe can be configured to use either greedy or ants for image registration tasks. The default is greedy.
In other to use greedy, you have to download and install greedy (https://sourceforge.net/projects/greedy-reg/). To use ants,
install pyalfe with ants support ``pip install pyalfe[ants]``.

This config value can be overwritten when calling `pyalfe run` via `-ir` or `--image-registration` option.

#### Dierctory Data Structure
#### Directory Data Structure
```bash
data directory structure (press enter for default) (alfe, bids) [alfe]:
```

The directory structure that pyALFE expects in the input directory and will follow when creating the output. See [Inupt directory](#input-directory) for information on ALFE and BIDS.
This config value can be overwritten when calling `payalfe run` via `-dds` or `--data-dir-structure` option.

#### Tissue Segmentation
```bash
tissue segmentation method (press enter for default) (prior, synthseg) [prior]:
```

The tissue segmentation method that will be used by pyALFE. The default is based on the method described in this [paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8346689/), a UNet
that receives a template-based **prior** map tissue alongside the image . pyALFE
also supports [SynthSeg](https://www.sciencedirect.com/science/article/pii/S1361841523000506) via [FreeSurfer](https://surfer.nmr.mgh.harvard.edu/fswiki/SynthSeg). To use SynthSeg, you have to have FreeSurfer >= v7
installed.

### Running the pipeline
To run PyALFE for an accession

Expand Down
1 change: 1 addition & 0 deletions pyalfe/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dominant_tissue=white_matter
image_processor=c3d
image_registration=greedy
data_dir_structure = alfe
tissue_segmentation = prior
Loading

0 comments on commit 0804be7

Please sign in to comment.