How to use the visualqc.utils.check_outlier_params 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 / vqc.py View on Github external
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,
                                                                                id_list)

    qcw = QCWorkflow(in_dir, id_list, images_for_id, out_dir,
                     user_args.prepare_first,
                     vis_type, label_set, alpha_set,
                     outlier_method, outlier_fraction, outlier_feat_types, no_outlier_detection,
                     views, num_slices, num_rows,
                     mri_name, seg_name, contour_color)

    return qcw
github raamana / visualqc / visualqc / alignment.py View on Github external
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,
                                 out_dir=out_dir,
                                 in_dir_type=in_dir_type,
                                 prepare_first=user_args.prepare_first,
                                 vis_type=vis_type,
                                 delay_in_animation=delay_in_animation,
                                 outlier_method=outlier_method,
github raamana / visualqc / visualqc / t1_mri.py View on Github external
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,
                          outlier_method, outlier_fraction,
                          outlier_feat_types, disable_outlier_detection,
                          user_args.prepare_first,
                          vis_type,
                          views, num_slices_per_view, num_rows_per_view)

    return wf
github raamana / visualqc / visualqc / freesurfer.py View on Github external
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)

    wf = FreesurferRatingWorkflow(id_list,
                                  images_for_id,
                                  in_dir,
                                  out_dir,
                                  vis_type=vis_type,
                                  label_set=label_set,
                                  issue_list=cfg.default_rating_list,
                                  mri_name=mri_name,
                                  seg_name=seg_name,
                                  alpha_set=alpha_set,
                                  outlier_method=outlier_method,
                                  outlier_fraction=outlier_fraction,
github raamana / visualqc / visualqc / diffusion.py View on Github external
# 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)

    out_dir = check_out_dir(user_args.out_dir, in_dir)
    apply_preproc = user_args.apply_preproc
    delay_in_animation = check_time(user_args.delay_in_animation, var_name='Delay')

    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 = DiffusionRatingWorkflow(in_dir, out_dir,
                                 id_list=id_list,
                                 images_for_id=images_for_id,
                                 issue_list=cfg.diffusion_mri_default_issue_list,
                                 name_pattern=name_pattern, in_dir_type=in_dir_type,
                                 apply_preproc=apply_preproc,
                                 delay_in_animation=delay_in_animation,
                                 outlier_method=outlier_method,
                                 outlier_fraction=outlier_fraction,
                                 outlier_feat_types=outlier_feat_types,
                                 disable_outlier_detection=disable_outlier_detection,
                                 prepare_first=user_args.prepare_first, vis_type=vis_type,