Giter Club home page Giter Club logo

sc-gan's Introduction

SC-GAN

The project repository for SC-GAN: 3D self-attention conditional GAN with spectral normalization for multi-modal neuroimaging synthesis

Data

The data directory should be organized as the following structure:

data
│
└───train
|   |
│   └─── subject 1
|   |         modality_1.nii.gz
|   |         modality_2.nii.gz
|   |         ...
|   |         target.nii.gz
│   └─── subject 2
|   |         modality_1.nii.gz
|   |         modality_2.nii.gz
|   |         ...
|   |         target.nii.gz
│   ...
|
└───val
|   |
│   └─── subject A
|   |         modality_1.nii.gz
|   |         modality_2.nii.gz
|   |         ...
|   |         target.nii.gz
│   └─── subject B
|   |         modality_1.nii.gz
|   |         modality_2.nii.gz
|   |         ...
|   |         target.nii.gz
│   ...
|   
└───test
    |
    └─── subject a
    |         modality_1.nii.gz
    |         modality_2.nii.gz
    |         ...
    └─── subject b
    |         modality_1.nii.gz
    |         modality_2.nii.gz
    |         ...
    ...

To evaluate SC-GAN, we used ADNI data. To access ADNI data, please visit: https://ida.loni.usc.edu/

Requirements

python 3 is required and python 3.6.9 was used in the study.

Requirements can be found at requirement.txt.

Please use pip install requirement.txt to install the requirements

Running the code

SC-GAN was assessed for positron emission tomography (PET), Fractional anisotropy (FA) and mean diffusivity (MD) synthesis from tasks using T1w and FLAIR magnetic resonance images (MRI).

Training:

Training script is at ./training

Use the following command to run the training script:

python training.py --trainig_size= --gpu= --epoches= --img_size= --data_dir= --modalities= --logdir=

configurations meaning default
--training_size the number of training data to use None
--gpu gpu ID for training None
--epoches the number of training epoches 120
--img_size input image size(same for three dimensions) 256
--data_dir data directory None
--modalities modalities to use in the training. Last one is the name of target modality, the rests are names of input modalities(eg: modality1_modality2_..._target) flair_t1w_av45
--logdir directory to save tensorboard log None

Add more parameters configuration to do hyperparameter tuning:

parameters meaning default values
--lr learning rate 0.001
--g_reg generator regularizer 0.001
--d_reg discriminator regularizer 0.001
--reg if using regularization True
--l1_weight l1 weight 200
--B_weight B-rmse weight 200

Testing:

Testing script is at ./testing

Use the following command to run the testing script:

python testing.py --test_size= --gpu= --img_size= --data_dir= --modalities= --logdir= --output=

configurations meaning default
--test_size the number of test data to use None
--gpu gpu ID for testing None
--img_size input image size(same for three dimensions) 256
--data_dir data directory None
--modalities modalities to use in the testing. Last one is the name of target modality, the rests are names of input modalities(eg: modality1_modality2_..._target) flair_t1w_av45
--log_dir directory to read tensorboard log None
--output synthesis results directory None

License

If you use this code for your research, please be familiar with the LICENSE and cite our paper.

Developer

Haoyu Lan
INI Microstructural imaging Group (IMG)
USC Stevens Neuroimaging and Informatics Institute
Keck School of Medicine, University of Southern California

Citation

Lan H, Toga AW, Sepehrband F. Three- dimensional self- attention conditional GAN with spectral normalization for multimodal neuroimaging synthesis. Magn Reson Med. 2021;00:1– 16. https://doi.org/10.1002/mrm.28819
[bioRxiv copy]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.