Molecular-MRI-Generator
所属分类:人工智能/神经网络/深度学习
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2023-10-25 16:55:15
上 传 者:
sh-1993
说明: 分子MRI发生器,,
(Molecular MRI Generator,,)
文件列表:
LICENSE (1067, 2023-11-24)
enviroment.yml (5227, 2023-11-24)
example_scenarios/ (0, 2023-11-24)
example_scenarios/application_optimized_network/ (0, 2023-11-24)
example_scenarios/application_optimized_network/test_scenario/ (0, 2023-11-24)
example_scenarios/application_optimized_network/test_scenario/B0_4.7_tp_0.08_Trec_3.1_n_pulses_18.mat (4359, 2023-11-24)
example_scenarios/application_optimized_network/weights/ (0, 2023-11-24)
example_scenarios/application_optimized_network/weights/application_weights.hdf5 (347680, 2023-11-24)
example_scenarios/dynamic_network/ (0, 2023-11-24)
example_scenarios/dynamic_network/test_scenario/ (0, 2023-11-24)
example_scenarios/dynamic_network/test_scenario/dict_tp_3_Trec_1_B0_7_angle_60.mat (791, 2023-11-24)
example_scenarios/dynamic_network/test_scenario/dict_tp_3_Trec_1_B0_7_angle_60.txt (119, 2023-11-24)
example_scenarios/dynamic_network/weights/ (0, 2023-11-24)
example_scenarios/dynamic_network/weights/dynamic_weights.hdf5 (295456, 2023-11-24)
figures/ (0, 2023-11-24)
figures/architecture.png (496682, 2023-11-24)
predict_application_optimized.py (10405, 2023-11-24)
predict_dynamic.py (13445, 2023-11-24)
requirements.txt (874, 2023-11-24)
train_application_optimized_network.py (9672, 2023-11-24)
train_dynamic_network.py (17346, 2023-11-24)
## Overview
Molecular-MRI-generator is an open-source deep learning framework developed to accelerate
molecular MRI simulations and signal dictionary generation compared to traditional numerical Bloch-McConnell solvers.
The code generates the predicted MRI signals that correspond to a set of tissue and scanner parameters.
Two architectures are available:
-
Dynamic network - trained to accomodate 9 different acquisition protocol, so that each prediction calculates
the next signal element in the trajectory given the previous element. The acquisition protocols may generate any desired signal length.
-
Application optimized network - designed for a case where a research group is interested in
investigation a specific acquisition protocol with a predefined signal length. This network typically results in an even faster inference.
Additional details are available at: https://www.nature.com/articles/s41598-023-45548-8
## Getting Started
### Setting up the environment
1. Clone the repository
```bash
git clone https://github.com/DinorNagar/Molecular-MRI-Generator.git
```
2. The following Python packages are required:
numpy, scipy, tensorflow, keras, matplotlib
They can either be installed manually, or via the following pip/Conda files:
* pip enviroment:
```bash
pip install -r requirements.txt
```
* conda enviroment:
```bash
conda env create -f enviroment.yml
```
## Prediction Example
For setting an example, we added the pretrained weights for both of the networks, in addition to an example dictionary for every dictionary.
Run the following commands to try it out:
```bash
# An example for the Dynamic network
python predict_dynamic.py
#An example for the Application optimized network
python predict_application_optimized.py
```
For each example, the results will appear in `stats` folder which is located on the path `example_scenarios\*` where `*` indicates one of the two network directory.
After running the corresponding example script, the following files will be created:
* __trajectories.png__ - One predicted scenario trajectory and the corresponding ground truth.
* __statistical_graph.png__ - Graph of the predicted elements of the signal compared to the ground truth elements.
* __predicted_dict.mat__ - The new predicted dictionary created by the model for the specific scenario.
* __stats.txt__ - Text file which saves the calculated statistical coefficient results.
## Optional: Training The Model
For the case of testing new acquisition protocols, we attached the code for the training phase.
### 1. Organizing the data
For efficient arrangement, make sure that the folder tree which contains both the scripts and the datasets,
looks like the following tree:
```
dataset-dynamic
|- example-protocol-1
|- example-protocol-2
...
dataset-application-optimized
|- example-protocol-1
|- example-protocol-2
...
train-script-1
train-script-2
...
```
Before setting up the framework,we first need to create the "ground truth" reference simulated data for training or evaluating the model. We used
the Bloch-McConnell simulator that can be found
here. This simulator
was implemented in MATLAB and the data is stored in dictionaries saved as .mat files. To arrange the dataset
efficiently, for every simulated acquisition protocol we saved multiple dictionaries that describes multiple scenarios
of different values of input tissue and scanner parameters. Each dictionary was named by the values of the scanner parameter.
Furthermore, for every dictionary we created a text file with the same name that contains the values of the parameter B1.
An example to such dataset for a specific protocol is described below:
```
L-arginine
|- dict_tp_1_Trec_1_B0_3_angle_60.mat
|- dict_tp_1_Trec_1_B0_3_angle_60.txt
|- dict_tp_1_Trec_1_B0_11.7_angle_90.mat
|- dict_tp_1_Trec_1_B0_11.7_angle_90.txt
...
```
For protocols that have also changing values for the parameter offset_ppm, we also included a text file in the same
manner with an addition of 'ppm' to the name of the file.
An example to such case is described below:
```
MT
|- dict_tp_1_Trec_1_B0_3_angle_60.mat
|- dict_tp_1_Trec_1_B0_3_angle_60.txt
|- dict_tp_1_Trec_1_B0_3_angle_60ppm.txt
|- dict_tp_8_Trec_8_B0_11.7_angle_90.mat
|- dict_tp_8_Trec_8_B0_11.7_angle_90.txt
|- dict_tp_8_Trec_8_B0_11.7_angle_90ppm.txt
...
```
### 2. Running the training on the new dataset
After arranging the data, run the following code according to the desired case:
### Dynamic Network
For the dynamic network, run the following script:
```bash
python train_dynamic_network.py
```
### Application Optimized Network
For the application optimized network, run the following script:
```bash
python train_application_optimized_network.py
```
## Contributing
We believe in openly sharing information between research group and contribute data.
Whether you have a question or a bug to fix, please let us know. See our group websited at: https://mri-ai.github.io/
## References
If you use this code for research or software development please reference the following publication:
``` # TO CHANGE
Nagar, D., Vladimirov, N., Farrar, C.T., Perlman O. Dynamic and rapid deep synthesis of chemical exchange saturation transfer and semisolid magnetization transfer MRI signals. Sci Rep 13, 18291 (2023). https://doi.org/10.1038/s41598-023-45548-8
```
近期下载者:
相关文件:
收藏者: