Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation and general code clean-up #13

Merged
merged 24 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f9ccc87
Update setup.py file to include entry points
CharlesPageot Jul 5, 2024
5b4c179
Added documentation
CharlesPageot Jul 5, 2024
1de698f
Update README.md
CharlesPageot Jul 5, 2024
ad94420
Merge pull request #11 from shimming-toolbox/main
CharlesPageot Jul 5, 2024
168be37
Update README.md
CharlesPageot Jul 5, 2024
c1ef317
Updated setup.py
CharlesPageot Jul 5, 2024
eebb7f5
Update README.md
CharlesPageot Jul 5, 2024
3472b1a
Update README.md
CharlesPageot Jul 8, 2024
611222f
Update README.md
CharlesPageot Jul 9, 2024
df7f379
Update README.md
CharlesPageot Jul 9, 2024
044c161
Added titles to figures and change to use [] operator for masking
CharlesPageot Jul 9, 2024
e2fc3df
Small change to avoid hardcode
CharlesPageot Jul 9, 2024
786cd86
Merge branch 'develop' of https://github.com/CharlesPageot/fft_simula…
CharlesPageot Jul 9, 2024
c7a3d0b
Update README.md
CharlesPageot Jul 10, 2024
96a552b
Change from click.argument to click.option
CharlesPageot Jul 10, 2024
e0f8fe8
Merge branch 'develop' of https://github.com/CharlesPageot/fft_simula…
CharlesPageot Jul 10, 2024
dc2604a
Change the main() procedures to something more descriptive
CharlesPageot Jul 11, 2024
fc17441
Update README.md
CharlesPageot Jul 12, 2024
f1f0e83
Update README.md
CharlesPageot Jul 12, 2024
9b22e76
Update README.md
CharlesPageot Jul 12, 2024
a0a5e5c
Updated README.md
CharlesPageot Jul 12, 2024
cb2cf79
Created a parent class for plotting
CharlesPageot Jul 12, 2024
c0ad4c8
Updated analytical_cases.py
CharlesPageot Jul 12, 2024
b7e722a
Update README.md
CharlesPageot Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,59 +81,69 @@ These final equations are the ones used in the function **compute_bz**, which ca

## Installation

First, clone the repository
- Clone the repository

```
git clone https://github.com/shimming-toolbox/susceptibility-to-fieldmap-fft.git
cd susceptibility-to-fieldmap-fft
```

Navigate to the project directory
- Create a virtual environnement

```
cd susceptibility-to-fieldmap-fft
conda create --name <name of your environement> python=3.9
conda activate <name of your environment>
```

Install the requirements
- Install the package

```
pip install -r requirements.txt
pip install .
```

You will need to ```conda activate <name of your environment>``` each time you want to use the package.

## Usage
To execute the scripts, you need to naviagte into the fft_simulation folder.
Once the package is installed, the commands can be run directly from the terminal. Here is the description of the two commands available.

### Analytical cases
### compute_fieldmap

The _analytical_case.py_ script allows for comparaison between simulated and analytical results for a spherical and cylindrical phantom.
The `compute_fieldmap` command allows computation of a $B_0$ fieldmap based on a susceptibility distribution given as an input.

**Arguments**
- -t, type : 'spherical' or 'cylindrical'
- -b, buffer (optional, default=2): Buffer value for zero-padding around the phantom
**Inputs**
- input_file : path to the susceptibility distribution (NIfTI file)
- output_file : path for the fieldmap (NIfTI file)

**Return**
Plots to visialize the results
**Output**
The calculated fieldmap at the specified path.

Example:
```
python analytical_cases.py -t "spherical"
compute_fieldmap "inpath/susceptibility_distribution.nii.gz" "outpath/fieldmap.nii.gz"
```

### analytical_cases

### fft_simulation

The _fft_simulation.py_ script allow computation of a $B_0$ fieldmap based on a susceptibility distribution given as an input.
The _analytical_cases_ command allows for comparaison between simulated and analytical results for a spherical and cylindrical phantom.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The _analytical_cases_ command allows for comparaison between simulated and analytical results for a spherical and cylindrical phantom.
The `analytical_cases` command allows for comparaison between simulated and analytical results for a spherical and cylindrical phantom.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not very clear to me what the function actually does. Can you give an example of figure output? Also, what should be my input here? it seems that -t and -b are not image inputs, so I'm puzzled as to what I'm supposed to input...?

Copy link
Collaborator Author

@CharlesPageot CharlesPageot Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, i'll add an example of figures output. the inputs -t and -b are defined in the inputs as the geometry type and the buffer value respectively.


**Arguments**
- -input_file : path to the susceptibility distribution (NIfTI file)
- -output_file : path for the fieldmap (NIfTI file)
**Inputs**
- -t, geometry type : 'spherical' or 'cylindrical'
- -b, buffer (optional, default=2): Buffer value for zero-padding around the phantom

**Return**
The calculated fieldmap at the specified path.
**Outputs**
Plots to visualize the results

Example:
```
python fft_simulation.py "\your\sus_dist\path.nii" "\yout\fieldmap\path.nii"
analytical_cases -t "spherical"
```
The figures generated would be

![Figure_1](https://github.com/user-attachments/assets/a2f49a83-dc8f-4d94-a5ba-075e7b8675aa)


![Figure_2](https://github.com/user-attachments/assets/c4c2d34c-7153-43d8-ad21-8af6f49427de)


## References

Expand Down
Loading
Loading