|
1 |
| -# MR_XCAT_qMRI |
| 1 | +# 4D IVIM Phantom Generator |
| 2 | + |
| 3 | +A command-line tool for generating a 4D IVIM (Intravoxel Incoherent Motion) phantom as a NIfTI file. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```sh |
| 8 | +python sim_vim_sig.py [-h] [-b BVALUE [BVALUE ...] | -f FILE] [-n NOISE] [-m] [-i] |
| 9 | +``` |
| 10 | + |
| 11 | +## Arguments |
| 12 | + |
| 13 | +- `-b`, `--bvalue` : B values (list of numbers) |
| 14 | +- `-f`, `--bvalues-file` : JSON file containing the B values (default: b_values.json) |
| 15 | +- `-n`, `--noise` : Noise level (default: 0.0005) |
| 16 | +- `-m`, `--motion` : Enable motion flag (default: False) |
| 17 | +- `-i`, `--interleaved` : Enable interleaved flag (default: False) |
| 18 | + |
| 19 | +**Note:** Either provide `--bvalue` or `--bvalues-file`, not both. |
| 20 | + |
| 21 | +If neither `--bvalues-file` nor `--bvalue` is provided, the script will use the default `b_values.json` file. |
| 22 | + |
| 23 | +## Customizing B Values |
| 24 | + |
| 25 | +You can customize the B values by editing the `b_values.json` file. Here's an example of the default format: |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "original": [0.0, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 150.0, 250.0, 350.0, 400.0, 550.0, 700.0, 850.0, 1000.0], |
| 30 | + "one": [0.0, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 150.0, 250.0, 350.0, 400.0, 550.0, 700.0, 850.0, 1000.0, 1100.0, 1200.0], |
| 31 | + "two": [0.0, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 150.0, 250.0, 350.0, 400.0, 500.0, 700.0, 800.0, 1000.0, 1100.0, 1200.0], |
| 32 | + "three": [0.0, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 150.0, 250.0, 350.0, 450.0, 550.0, 675.0, 800.0], |
| 33 | + "four": [0.0, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 50.0, 75.0, 100.0, 150.0, 250.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0] |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +You can add or remove values as needed for your simulation. Here are the effects of customizing the B values for each of the generic profiles (`generic.json`, `generic_one.json`, `generic_two.json`, `generic_three.json`, `generic_four.json`): |
| 38 | + |
| 39 | +The default `generic_<custom_name>.json` file can be found in the following location: |
| 40 | + |
| 41 | +``` |
| 42 | +TF2.4_IVIM-MRI_CodeCollection/tests/IVIMmodels/unit_tests |
| 43 | +``` |
| 44 | + |
| 45 | +## Running the Script |
| 46 | + |
| 47 | +To run the script, you can add the following line to your shell configuration file (e.g., `.bashrc` or `.zshrc`) to include the necessary directory in your `PYTHONPATH`: |
| 48 | + |
| 49 | +```sh |
| 50 | +export PYTHONPATH=$PYTHONPATH:~/TF2.4_IVIM-MRI_CodeCollection |
| 51 | +``` |
| 52 | + |
| 53 | +Replace `~/TF2.4_IVIM-MRI_CodeCollection` with the actual path to the directory containing the script. |
| 54 | + |
| 55 | +## Example |
| 56 | + |
| 57 | +```sh |
| 58 | +python sim_ivim_sig.py -n 0.0001 -m |
| 59 | +``` |
| 60 | + |
| 61 | +This command will generate a 4D IVIM phantom using B values from the default `b_values.json` file, with a noise level of 0.0001 and motion enabled. |
0 commit comments