Package: py-SAINT
This is SAINT(Spatially Aware Interpolation Network for Medical Slice Synthesis).nii->.ptfrompy_SAINT.STAGE1importnii2picklenii2pickle.nii2pt(ori_dir_path,output_file_path)parametersdescriptionori_dir_pathfile path containing .niioutput_file_pathfile 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/")Interpolate with sag and cor view respectivelyfrompy_SAINT.STAGE1importinterpolationinterpolation.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')parametersdescriptionscalesuper resolution scale (eg:2,3,4,6)savefile path of savedir_datadataset 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_colorsnumber of channels to usen_GPUsnumber of GPUsrgb_rangemaximum value of RGBviewview 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')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 1frompy_SAINT.STAGE1.processimportcor_sag_comb_testcor_sag_comb_test.comb_cor_sag(files_dir='/path/',input_sag_cor_dir='/path/',out_dir='/path/',scale=4)parametersdescriptionfiles_dirdataset directoryinput_sag_cor_dirpath to the folder containing sag and corout_dirgenerated combine pathscalesuper 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)Residual-Fusionfrompy_SAINT.STAGE2importfusefuse.get_Stage2_result(save='/path/',dir_data='/path/',n_GPUs=1,rgb_range=4000,gpu='0')parametersdescriptionsavefile path of savedir_datastep3_out_dirn_GPUsnumber of GPUsrgb_rangemaximum 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').pt->.nii(option)frompy_SAINT.STAGE1importpt2niipt2nii.pt2nii(ori_nii_dir_path,pt_dir_path,nii_dir_path)parametersdescriptionnii_dir_pathnii_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/')