How to use the visualqc.utils.check_out_dir function in VisualQC

To help you get started, we’ve selected a few VisualQC examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raamana / visualqc / visualqc / defacing.py View on Github external
parser.exit(1)

    # parsing
    try:
        user_args = parser.parse_args()
    except:
        parser.exit(1)

    vis_type = 'defacing'

    user_dir, id_list, images_for_id, defaced_name, mri_name, render_name \
        = check_inputs_defacing(user_args.user_dir, user_args.defaced_name,
                                user_args.mri_name, user_args.render_name,
                                user_args.id_list)

    out_dir = check_out_dir(user_args.out_dir, user_dir)

    wf = RatingWorkflowDefacing(id_list, images_for_id, user_dir, out_dir,
                                defaced_name, mri_name, render_name,
                                cfg.defacing_default_issue_list, vis_type)

    return wf
github raamana / visualqc / visualqc / freesurfer.py View on Github external
# parsing
    try:
        user_args = parser.parse_args()
    except:
        parser.exit(1)

    vis_type, label_set, label_map = check_labels(user_args.vis_type, user_args.label_set)
    in_dir, source_of_features = check_input_dir(user_args.fs_dir, None, vis_type,
                                                 freesurfer_install_required=False)

    mri_name = user_args.mri_name
    seg_name = user_args.seg_name
    id_list, images_for_id = check_id_list(user_args.id_list, in_dir, vis_type, mri_name,
                                           seg_name)

    out_dir = check_out_dir(user_args.out_dir, in_dir)

    alpha_set = check_alpha_set(user_args.alpha_set)
    views = check_views(user_args.views)
    num_slices, num_rows = check_finite_int(user_args.num_slices, user_args.num_rows)

    contour_color = user_args.contour_color
    if not is_color_like(contour_color):
        raise ValueError('Specified color is not valid. Choose a valid spec from\n'
                         ' https://matplotlib.org/users/colors.html')

    outlier_method, outlier_fraction, outlier_feat_types, disable_outlier_detection = \
        check_outlier_params(user_args.outlier_method, user_args.outlier_fraction,
                             user_args.outlier_feat_types,
                             user_args.disable_outlier_detection,
                             id_list, vis_type, source_of_features)
github raamana / visualqc / visualqc / t1_mri.py View on Github external
parser.exit(1)

    # parsing
    try:
        user_args = parser.parse_args()
    except:
        parser.exit(1)

    vis_type = 'collage_t1_mri'
    type_of_features = 't1_mri'
    in_dir, in_dir_type = check_input_dir_T1w(user_args.fs_dir, user_args.user_dir, user_args.bids_dir)

    mri_name = user_args.mri_name
    id_list = check_id_list_T1w(in_dir, in_dir_type, user_args.id_list, mri_name, vis_type)

    out_dir = check_out_dir(user_args.out_dir, in_dir)
    views = check_views(user_args.views)

    num_slices_per_view, num_rows_per_view = check_finite_int(user_args.num_slices,
                                                              user_args.num_rows)

    outlier_method, outlier_fraction, \
    outlier_feat_types, disable_outlier_detection = check_outlier_params(
        user_args.outlier_method,
        user_args.outlier_fraction,
        user_args.outlier_feat_types,
        user_args.disable_outlier_detection,
        id_list, vis_type, type_of_features)

    wf = RatingWorkflowT1(id_list, in_dir, out_dir,
                          cfg.t1_mri_default_issue_list,
                          mri_name, in_dir_type,
github raamana / visualqc / visualqc / vqc.py View on Github external
try:
        user_args = parser.parse_args()
    except:
        parser.exit(1)

    # TODO methods to restore from previous runs, without having re-enter all parameters

    vis_type, label_set = check_labels(user_args.vis_type, user_args.labels)

    in_dir = check_input_dir(user_args.fs_dir, user_args.user_dir, vis_type)

    mri_name = user_args.mri_name
    seg_name = user_args.seg_name
    id_list, images_for_id = check_id_list(user_args.id_list, in_dir, vis_type, mri_name, seg_name)

    out_dir = check_out_dir(user_args.out_dir, in_dir)

    alpha_set = check_alpha_set(user_args.alpha_set)

    views = check_views(user_args.views)

    num_slices, num_rows = check_finite_int(user_args.num_slices, user_args.num_rows)

    contour_color = user_args.contour_color
    if not is_color_like(contour_color):
        raise ValueError(
            'Specified color is not valid. Choose a valid spec from\n https://matplotlib.org/users/colors.html')

    outlier_method, outlier_fraction, outlier_feat_types, no_outlier_detection = check_outlier_params(user_args.outlier_method,
                                                                                user_args.outlier_fraction,
                                                                                user_args.outlier_feat_types,
                                                                                user_args.disable_outlier_detection,
github raamana / visualqc / visualqc / quantitative.py View on Github external
user_args = parser.parse_args()
    except:
        parser.exit(1)

    vis_type = cfg.alignment_default_vis_type
    type_of_features = 'alignment'
    in_dir, in_dir_type = check_input_dir_quantitative_MR(user_args.in_dir)

    image_names = user_args.image_names
    id_list, images_for_id = check_id_list_quantitative(user_args.id_list, in_dir,
                                                        image_names,
                                                        in_dir_type=in_dir_type)

    delay_in_animation = check_time(user_args.delay_in_animation, var_name='Delay')

    out_dir = check_out_dir(user_args.out_dir, in_dir)
    views = check_views(user_args.views)
    num_slices_per_view, num_rows_per_view = check_finite_int(user_args.num_slices,
                                                              user_args.num_rows)

    wf = QuantitativeMrRatingWorkflow(id_list,
                                      in_dir,
                                      image_names,
                                      out_dir=out_dir,
                                      in_dir_type=in_dir_type,
                                      prepare_first=user_args.prepare_first,
                                      delay_in_animation=delay_in_animation,
                                      views=views,
                                      num_slices_per_view=num_slices_per_view,
                                      num_rows_per_view=num_rows_per_view)

    return wf
github raamana / visualqc / visualqc / alignment.py View on Github external
user_args = parser.parse_args()
    except:
        parser.exit(1)

    vis_type = cfg.alignment_default_vis_type
    type_of_features = 'alignment'
    in_dir, in_dir_type = check_input_dir_alignment(user_args.in_dir)

    image1 = user_args.image1
    image2 = user_args.image2
    id_list, images_for_id = check_id_list(user_args.id_list, in_dir, vis_type,
                                           image1, image2, in_dir_type=in_dir_type)

    delay_in_animation = check_time(user_args.delay_in_animation, var_name='Delay')

    out_dir = check_out_dir(user_args.out_dir, in_dir)
    views = check_views(user_args.views)
    num_slices_per_view, num_rows_per_view = check_finite_int(user_args.num_slices,
                                                              user_args.num_rows)

    outlier_method, outlier_fraction, \
    outlier_feat_types, disable_outlier_detection = check_outlier_params(
        user_args.outlier_method,
        user_args.outlier_fraction,
        user_args.outlier_feat_types,
        user_args.disable_outlier_detection,
        id_list, vis_type, type_of_features)

    wf = AlignmentRatingWorkflow(id_list,
                                 in_dir,
                                 image1,
                                 image2,
github raamana / visualqc / visualqc / functional_mri.py View on Github external
type_of_features = 'func_mri'

    if user_args.bids_dir is not None and user_args.user_dir is None:
        in_dir, in_dir_type = check_bids_dir(user_args.bids_dir)
        id_list = None
        name_pattern = None
        images_for_id = None
    elif user_args.bids_dir is None and user_args.user_dir is not None:
        name_pattern = user_args.name_pattern
        in_dir = realpath(user_args.user_dir)
        in_dir_type = 'generic'
        id_list, images_for_id = check_id_list_with_regex(user_args.id_list, in_dir, name_pattern)
    else:
        raise ValueError('Invalid args: specify only one of bids_dir or user_dir, not both.')

    out_dir = check_out_dir(user_args.out_dir, in_dir)
    no_preproc = user_args.no_preproc

    views = check_views(user_args.views)
    num_slices_per_view, num_rows_per_view = check_finite_int(user_args.num_slices,
                                                              user_args.num_rows)

    outlier_method, outlier_fraction, \
    outlier_feat_types, disable_outlier_detection = check_outlier_params(
        user_args.outlier_method, user_args.outlier_fraction,
        user_args.outlier_feat_types, user_args.disable_outlier_detection,
        id_list, vis_type, type_of_features)

    wf = FmriRatingWorkflow(in_dir, out_dir,
                            id_list=id_list,
                            images_for_id=images_for_id,
                            issue_list=cfg.func_mri_default_issue_list,