Giter Site home page Giter Site logo

sa-inr's Introduction

This repository contains the official implementation for SA-INR introduced in the following paper:

Spatial Attention-based Implicit Neural Representation for Arbitrary Reduction of MRI Slice Spacing

The project page with video is at https://jamesqfreeman.github.io/SA-INR/.

Environment

  • Python 3.9.2
  • Pytorch 1.10.0+cu113
  • nibabel, SimpleITK, pandas, scikit-image

Quick Start

  1. We provide a pre-trained model checkpoint/model.pth for reducing slice-spacing of knee MRI.

  2. Use the following command for reducing slice-spacing of a single test case.

python single_test.py --add_res --gpu [GPU] --save_dir [set a dir to save your images] --model_path [model_path] --nii_path [set the path to your test case] --slice_spacing [set your desired slice spacing] 

We also provide a knee MRI test/knee.nii.gz for testing.

Reproducing Experiments

Data Preparation

  • Split your data into training set and test set.

  • Write the paths of data to [your_dataset_name].json as in the following example.

{'train': [case1.nii.gz, case2.nii.gz...], 'test': [case3.nii.gz, case4.nii.gz...]}
  • Edit train_SA_INR.yaml , change data: clinical_knee.json to data: [your_dataset_name].json

Training

python train.py --add_res --gpu [GPU] --save_path [set a dir to save your checkpoints] --config [train_SA_INR.yaml]

In default, the local-aware spatial attention (LASA) is applied to each query coordinate. One can use --add_branch to learn a gating mask for conditionally applying LASA.

Testing

python test.py --add_res --gpu [GPU] --save_dir [set a dir to save your images] --model_path [model_path]  --slice_spacing [set your desired slice spacing]

In the same way, one can use --add_branch for conditionally applying LASA.

Authors:

Xin Wang[1], Sheng Wang[1], Honglin Xiong[2], Kai Xuan[1], Zixu Zhuang[1], Mengjun Liu[1], Zhenrong Shen[1], Xiangyu Zhao[1], Lichi Zhang[1], Qian Wang[2]

Institution:

[1] School of Biomedical Engineering, Shanghai Jiao Tong University, Shanghai, China

[2] School of Biomedical Engineering, ShanghaiTech University, Shanghai, China

sa-inr's People

Contributors

xinwang-99 avatar mahausmani avatar qazalbash avatar

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.