def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str,
                        default='/nfs/masi/xuk9/SPORE/data/data_flat')
    parser.add_argument('--in-mask-folder', type=str,
                        default='/nfs/masi/xuk9/src/lungmask/SPORE/lung_mask_nii')
    parser.add_argument('--out-clip-png-folder', type=str,
                        default='/nfs/masi/xuk9/src/lungmask/SPORE/lung_mask_nii_clip_png')
    parser.add_argument('--file-list-txt', type=str,
                        default='/nfs/masi/xuk9/SPORE/data/vlsp_data_list.txt')
    parser.add_argument('--num-process', type=int, default=1)
    args = parser.parse_args()

    mkdir_p(args.in_mask_folder)
    mkdir_p(args.out_clip_png_folder)

    in_folder_obj = DataFolder(args.in_folder, args.file_list_txt)
    out_mask_folder_obj = DataFolder(args.in_mask_folder, args.file_list_txt)
    out_clip_png_folder_obj = DataFolder(args.out_clip_png_folder, args.file_list_txt)
    out_clip_png_folder_obj.change_suffix('.png')

    exe_obj = ParalPPVMask(
        in_folder_obj,
        out_mask_folder_obj,
        out_clip_png_folder_obj,
        args.num_process
    )

    exe_obj.run_parallel()
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str)
    parser.add_argument('--out-mask-folder', type=str)
    parser.add_argument('--out-label-folder', type=str)
    parser.add_argument('--out-clip-png-folder', type=str)
    parser.add_argument('--file-list-txt', type=str)
    parser.add_argument('--num-process', type=int, default=10)
    args = parser.parse_args()

    in_folder_obj = DataFolder(args.in_folder, args.file_list_txt)
    out_mask_folder_obj = DataFolder(args.out_mask_folder, args.file_list_txt)
    out_label_folder_obj = DataFolder(args.out_label_folder, args.file_list_txt)
    out_clip_png_folder_obj = DataFolder(args.out_clip_png_folder, args.file_list_txt)
    out_clip_png_folder_obj.change_suffix('.png')

    exe_obj = ParalPPVMask(
        in_folder_obj,
        out_mask_folder_obj,
        out_label_folder_obj,
        out_clip_png_folder_obj,
        args.num_process
    )

    exe_obj.run_parallel()
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str)
    # parser.add_argument(
    #     '--in-mask',
    #     type=str,
    #     default=None,
    #     help='If is none, the orignal input images will be used'
    # )
    parser.add_argument('--file-list', type=str)
    parser.add_argument('--out-png-folder', type=str)
    parser.add_argument('--offset-axial', type=int, default=0)
    parser.add_argument('--offset-sagittal', type=int, default=0)
    parser.add_argument('--offset-coronal', type=int, default=0)
    parser.add_argument('--vmin', type=float, default=-1000)
    parser.add_argument('--vmax', type=float, default=500)
    parser.add_argument('--unit-label',
                        type=str,
                        default=None,
                        help='If none, the color bar will be omitted.')
    parser.add_argument('--num-process', type=str, default=10)
    args = parser.parse_args()

    in_folder_obj = DataFolder(args.in_folder, args.file_list)
    out_folder_obj = DataFolder(args.out_png_folder, args.file_list)
    out_folder_obj.change_suffix('')

    mkdir_p(args.out_png_folder)

    plot_obj = ParalClipPlot(in_folder_obj, out_folder_obj, args.offset_axial,
                             args.offset_sagittal, args.offset_coronal,
                             args.vmin, args.vmax, args.unit_label,
                             args.num_process)

    plot_obj.run_parallel()
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-ori-folder', type=str)
    parser.add_argument('--in-affine-folder')
    parser.add_argument('--in-warped-folder', type=str)
    parser.add_argument('--ref-img', type=str)
    parser.add_argument('--file-list-txt', type=str)
    parser.add_argument('--out-png-folder', type=str)
    parser.add_argument('--step-axial', type=int, default=50)
    parser.add_argument('--step-sagittal', type=int, default=75)
    parser.add_argument('--step-coronal', type=int, default=30)
    parser.add_argument('--num-process', type=int, default=10)
    args = parser.parse_args()

    in_ori_folder_obj = DataFolder(args.in_ori_folder, args.file_list_txt)
    in_affine_folder_obj = DataFolder(args.in_affine_folder,
                                      args.file_list_txt)
    in_warped_folder_obj = DataFolder(args.in_warped_folder,
                                      args.file_list_txt)
    out_png_folder_obj = DataFolder(args.out_png_folder, args.file_list_txt)
    out_png_folder_obj.change_suffix('.png')
    ref_img = ScanWrapper(args.ref_img)

    exe_obj = Overlay3Views(in_ori_folder_obj, in_affine_folder_obj,
                            in_warped_folder_obj, out_png_folder_obj, ref_img,
                            args.step_axial, args.step_sagittal,
                            args.step_coronal, args.num_process)
    exe_obj.run_parallel()
示例#5
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str)
    parser.add_argument('--out-folder', type=str)
    parser.add_argument('--file-list-txt', type=str)
    parser.add_argument('--num-clip', type=int)
    parser.add_argument('--vmin', type=float)
    parser.add_argument('--vmax', type=float)
    parser.add_argument('--num-process', type=int, default=10)
    args = parser.parse_args()

    in_folder_obj = DataFolder(args.in_folder, args.file_list_txt)
    out_folder_obj = DataFolder(args.out_folder, args.file_list_txt)
    out_folder_obj.change_suffix('.png')

    exe_obj = ParalClipMontagePlotNII(in_folder_obj, out_folder_obj,
                                      args.num_clip, args.vmin, args.vmax,
                                      args.num_process)

    exe_obj.run_parallel()
示例#6
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str)
    parser.add_argument('--in-omat-folder', type=str)
    parser.add_argument('--out-folder', type=str)
    parser.add_argument('--out-corrected-folder')
    parser.add_argument('--file-list-txt', type=str)
    parser.add_argument('--num-process', type=int, default=10)
    args = parser.parse_args()

    in_folder_obj = DataFolder(args.in_folder, args.file_list_txt)
    in_omat_obj = DataFolder(args.in_omat_folder, args.file_list_txt)
    in_omat_obj.change_suffix('.txt')
    out_corrected_folder_obj = DataFolder(args.out_corrected_folder,
                                          args.file_list_txt)

    exe_obj = AverageValidRegion(in_folder_obj, in_omat_obj,
                                 out_corrected_folder_obj, args.num_process)

    exe_obj.run_get_average()
    exe_obj.run_get_variance()
    exe_obj.output_result_folder(args.out_folder, np.nan)
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--in-folder', type=str, help='Folder of NIFTI files')
    parser.add_argument('--out-folder', type=str, help='Output folder')
    parser.add_argument('--file-list-txt', type=str, help='List of filename in plain txt (ls ${in_folder} > file_list)')
    parser.add_argument('--num-clip', type=int, help='Number of clip on each direction')
    parser.add_argument('--vmin', type=float, default=-1000)
    parser.add_argument('--vmax', type=float, default=600)
    parser.add_argument('--num-process', type=int, default=10, help='Number of cores')
    args = parser.parse_args()

    in_folder_obj = DataFolder(args.in_folder, args.file_list_txt)
    out_folder_obj = DataFolder(args.out_folder, args.file_list_txt)
    out_folder_obj.change_suffix('.png')

    exe_obj = ParalClipMontagePlotNII(
        in_folder_obj,
        out_folder_obj,
        args.num_clip,
        args.vmin, args.vmax,
        args.num_process
    )

    exe_obj.run_parallel()