diff --git a/docs/guides/install.md b/docs/guides/install.md index 0bb7829..cc8fb91 100644 --- a/docs/guides/install.md +++ b/docs/guides/install.md @@ -7,9 +7,15 @@ PyALFE can be configured to use either [Greedy](https://greedy.readthedocs.io/en Similarly, PyALFE can be configured to use [Convert3D](https://sourceforge.net/p/c3d/git/ci/master/tree/doc/c3d.md) or python native library [Nilearn](https://nilearn.github.io/stable/index.html) for image processing tasks. To use Greedy and Convert3d, these command line tools should be downloaded using the [download command](#download-models-and-tools). +### Option 1: Pypi installation +You can install pyalfe by running: +```bash +pip install pyalfe +``` -You can either instal pyalfe in [development mode](#development-mode-installation) or [build and install](#build-and-install). -### Option 1: Development mode installation +You can either install pyalfe from source after cloning the repo using [development mode](#development-mode-installation) or [build and install](#build-and-install). + +### Option 2: Development mode installation First update the setuptools ```bash @@ -19,6 +25,7 @@ pip install --upgrade setuptools Run the following command in the parent pyalfe directory: ```bash + pip install -e . ``` @@ -32,7 +39,7 @@ pip install --upgrade build Run the following commands in the parent pyalfe directory to build the whl file and install pyalfe ```bash python -m build -pip install dist/pyalfe-0.0.1-py3-none-any.whl +pip install dist/pyalfe-*-py3-none-any.whl ``` ### Download models diff --git a/docs/guides/tutorial.md b/docs/guides/tutorial.md index 49144d1..408f97a 100644 --- a/docs/guides/tutorial.md +++ b/docs/guides/tutorial.md @@ -22,7 +22,7 @@ mkdir -p pyalfe-output ## Installation -Create a python virtual environment and activate +Create a python virtual environment and activate it ```bash python3 -m venv venv source venv/bin/activate @@ -41,5 +41,5 @@ pyalfe download models ## Run ```bash -pyalfe run UPENNGBM0000511 --input-dir alfe/input --output-dir alfe/output +pyalfe run UPENNGBM0000511 --input-dir pyalfe-test-data --output-dir pyalfe-output ``` diff --git a/docs/guides/usage.md b/docs/guides/usage.md index 149242b..4a0c638 100644 --- a/docs/guides/usage.md +++ b/docs/guides/usage.md @@ -1,5 +1,8 @@ ## Usage +We recommend running the configure command first to create a configuration file for the pipeline. +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: ```bash @@ -7,32 +10,12 @@ pyalfe configure ``` which prompt the you to enter the following required configurations: -#### Classified directory +#### Input directory ```bash Enter input image directory: /path/to/my_mri_data ``` -The classified directory (`classified_dir`) is the input directory to PyALFE and should be organized by accessions (or session ids). Inside the directory for each accession there should be a directory for each available modality. -Here is an example that follow ALFE default structure: - -``` -my_mri_data -│ -│───anat -│ │───sub-123_T1w.nii.gz -│ │───sub-123_T2w.nii.gz -│ └───sub-123_FLAIR.nii.gz -│───dwi -│ │───sub-123_dwi.nii.gz -│ └───sub-123_md.nii.gz -│───swi -│ └───sub-123_swi.nii.gz -└───perf - └───sub-123_cbf.nii.gz - -``` -To use this directory the user should provide `path/to/my_mri_data` as the classified directory. This config value can be overwritten when calling `pyalfe run` via `-cd` or `--classified-dir` option. - -pyALFE also supports BIDS directories. Here is an example of input dir organized in BIDS format: +The input directory (`input_dir`) contains the images that will be processed by PyALFE and should be organized by accessions (or session ids). Inside the directory for each accession there should be a directory for each available modality. +Here is an example that follows ALFE default structure: ``` my_mri_data │ @@ -46,9 +29,10 @@ my_mri_data │ │ └── FLAIR.nii.gz │ │───ADC │ │ └── ADC.nii.gz -│ └───T2 -│ └── T2.nii.gz -│ +│ │───T2 +│ │ └── T2.nii.gz +│ └───CBF +│ └── CBF.nii.gz └───12356 . │ . │───T1 @@ -62,13 +46,51 @@ my_mri_data └───T2 └── T2.nii.gz ``` -#### Processed directory +To use this directory the user should provide `path/to/my_mri_data` as the input directory. This config value can be overwritten when calling `pyalfe run` via `-id` or `--input-dir` option. + +pyALFE also supports BIDS directories. Here is an example of input dir organized in BIDS format: + +``` +my_mri_data +│ +│───sub-01 +│ │───anat +│ │ │───sub-01_T1w.nii.gz +│ │ │───sub-01_ce-gadolinium_T1w.nii.gz +│ │ │───sub-01_T2w.nii.gz +│ │ └───sub-01_FLAIR.nii.gz +│ │───dwi +│ │ │───sub-01_dwi.nii.gz +│ │ └───sub-01_md.nii.gz +│ │───swi +│ │ └───sub-01_swi.nii.gz +│ └───perf +│ └───sub-01_cbf.nii.gz +│ +└───sub-02 +. │───anat +. │ │───sub-02_T1w.nii.gz +. │ │───sub-02_ce-gadolinium_T1w.nii.gz + │ │───sub-02_T2w.nii.gz + │ └───sub-02_FLAIR.nii.gz + │───dwi + │ │───sub-02_dwi.nii.gz + │ └───sub-02_md.nii.gz + │───swi + │ └───sub-02_swi.nii.gz + └───perf + └───sub-02_cbf.nii.gz + +``` + +#### Output directory ```bash -Enter input image directory: /path/to/processed_data_dir +Enter output image directory: /path/to/output_dir ``` -The processed image directory (`processed_dir`) is where ALFE writes all its output to. +The output image directory (`output_dir`) is where pyALFE writes all its output to. It can be any valid path in filesystem that user have write access to. -This config value can be overwritten when calling `pyalfe run` via `-pd` or `--processed-dir` option. +This config value can be overwritten when calling `pyalfe run` via `-od` or `--output-dir` option. + #### Modalities ```bash @@ -102,7 +124,7 @@ image processor to use (c3d, nilearn) [c3d]: ``` 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-and-tools). +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. This config value can be overwritten when calling `pyalfe run` via `-ip` or `--image_processing` option. @@ -111,10 +133,18 @@ This config value can be overwritten when calling `pyalfe run` via `-ip` or `--i 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-and-tools). To use ants, +In other to use greedy, you have to download it using the [download command](#download-models). 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 +```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. + ### Running the pipeline To run PyALFE for an accession diff --git a/docs/intro.md b/docs/intro.md index 9aa3d27..d1fa85b 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,7 +1,7 @@ # PyALFE -PyALFE is an open-source python Automated Lesion and Feature Extraction pipeline. -It consumes a clinical brain MRI study consisting of various pulse sequences +PyALFE is an open-source python pipeline for Automated Lesion and Feature Extraction. +It can process a clinical brain MRI study consisting of various sequences such as T1, T1 post contrast, FLAIR, T2, ADC, and CBF. It performs pre-processing, inter-seq registration, template registration, segmentation, and quantification to generate a set of numerical human-interpretable features