Skip to main content

SAINT

Project description

This is SAINT(Spatially Aware Interpolation Network for Medical Slice Synthesis)
  1. .nii->.pt

    from py_SAINT.STAGE1 import nii2pickle
    
    nii2pickle.nii2pt(ori_dir_path,output_file_path)
    
    parameters description
    ori_dir_path file path containing .nii
    output_file_path file path of the generated .pt
    #eg:
    
    nii2pickle.nii2pt("/home1/xx/xx_data/273data-yscl/1T2/1/002_OCor_T2_FRFSE/","/home1/xx/SAINT/Data/Stage1_Input/TEST/HR/")
    
  2. Interpolate with sag and cor view respectively

    from py_SAINT.STAGE1 import interpolation
    
    interpolation.get_Stage1_result (scale ='4',save =/path/ ,dir_data ='/path/',n_colors =3 ,n_GPUs =1,rgb_range =4000, view ='sag',gpu='0')
    
    interpolation.get_Stage1_result (scale ='4',save =/path/ ,dir_data ='/path/',n_colors =3 ,n_GPUs =1,rgb_range =4000, view ='cor',gpu='0')
    
    parameters description
    scale super resolution scale (eg:2,3,4,6)
    save file path of save
    dir_data dataset directory (Note that the dir_data path should point to a folder that contains subfolders named 'TEST', each of which needs to have a 'HR' and 'LR' subfolder, 'HR' is high resolution file , 'LR' is low resolution file. Data should go accordingly in this structure.
    n_colors number of channels to use
    n_GPUs number of GPUs
    rgb_range maximum value of RGB
    view view of interpolation (Note the --view option performs inference on the volume from either the sagittal or coronal axis. Note that the whether it's actually sagittal or coronal depends on the orientation of the data.)
    #eg:
    
    interpolation.get_Stage1_result (scale ='4',save ="/home1/xx/SAINT/Data/Stage1_output_sag_cor/" ,dir_data ='/home1/xx/SAINT/Data/Stage1_Input/',n_colors =3 ,n_GPUs =1,rgb_range =4000, view ='cor',gpu='0')
    
    interpolation.get_Stage1_result (scale ='4',save ="/home1/xx/SAINT/Data/Stage1_output_sag_cor/" ,dir_data ='/home1/xx/SAINT/Data/Stage1_Input/',n_colors =3 ,n_GPUs =1,rgb_range =4000, view ='sag',gpu='0')
    
  3. Before going to the RFN stage, sagittal and coronal-wise SR'ed volume needs to be recombine into a single volume for inference. In simple terms just concatenate them in the first dimension, coronal SR goes in channel 0 and sagittal SR goes in channel 1

    from py_SAINT.STAGE1.process import cor_sag_comb_test
    
    cor_sag_comb_test.comb_cor_sag(files_dir='/path/',input_sag_cor_dir='/path/',out_dir='/path/', scale=4)
    
    parameters description
    files_dir dataset directory
    input_sag_cor_dir path to the folder containing sag and cor
    out_dir generated combine path
    scale super resolution scale
    #eg:
    
    cor_sag_comb_test.comb_cor_sag(files_dir='/home1/mksun/SAINT/Data/Stage1_Input/TEST/HR/',input_sag_cor_dir='/home1/mksun/SAINT/Data/Stage1_output_sag_cor/results/raw/',out_dir='/home1/mksun/SAINT/Data/combine_cor_sag_out/TEST/', scale=4)
    
  4. Residual-Fusion

    from py_SAINT.STAGE2 import fuse
    
    fuse.get_Stage2_result(save ='/path/',dir_data ='/path/' ,n_GPUs =1 ,rgb_range =4000,gpu='0')
    
    parameters description
    save file path of save
    dir_data step3_out_dir
    n_GPUs number of GPUs
    rgb_range maximum value of RGB
    #eg:
    
    fuse.get_Stage2_result(save ='/home1/mksun/SAINT/Data/out_fuse/',dir_data ='/home1/mksun/SAINT/Data/combine_cor_sag_out/' ,n_GPUs =1 ,rgb_range =4000,gpu='0')
    
  5. .pt->.nii(option)

    from py_SAINT.STAGE1 import pt2nii
    
    pt2nii.pt2nii(ori_nii_dir_path, pt_dir_path,nii_dir_path)
    
    parameters description
    nii_dir_path nii_output_dir
    #eg:
    
    pt2nii.pt2nii(ori_nii_dir_path='/home1/mksun/xh_data/273data-yscl/1T2/1/002_OCor_T2_FRFSE/',pt_dir_path='/home1/mksun/SAINT/Data/out_fuse/results/raw/',nii_dir_path='/home1/mksun/SAINT/Data/final_nii/')
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_SAINT-1.7.0.tar.gz (13.2 MB view details)

Uploaded Source

Built Distribution

py_SAINT-1.7.0-py3-none-any.whl (13.3 MB view details)

Uploaded Python 3

File details

Details for the file py_SAINT-1.7.0.tar.gz.

File metadata

  • Download URL: py_SAINT-1.7.0.tar.gz
  • Upload date:
  • Size: 13.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for py_SAINT-1.7.0.tar.gz
Algorithm Hash digest
SHA256 63537eca490672c4f0fc05814290fcadbce0ca11603c13ef30f304e3416acc74
MD5 14c0b22cb26dec94b867dc9378db3987
BLAKE2b-256 797702b2114c4127af6ad211c8358dee4d6160c1cb0be48a4a4635ab93afe6e2

See more details on using hashes here.

File details

Details for the file py_SAINT-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: py_SAINT-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for py_SAINT-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b8cd133230ef18851db7fb14a66339fcd8ae780680e1b5fdcd376f7dace681c
MD5 8e8b4395ec57e106ea1d7878f9a56cd0
BLAKE2b-256 0a5a1023c4b090da1c14b072294b899f064204d5e56881951606a2a8c2f16655

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page