Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
help_text_views = textwrap.dedent("""
Specifies the set of views to display - could be just 1 view, or 2 or all 3.
Example: --views 0 (typically sagittal) or --views 1 2 (axial and coronal)
Default: {} {} {} (show all the views in the selected segmentation)
\n""".format(cfg.default_views[0], cfg.default_views[1], cfg.default_views[2]))
help_text_num_slices = textwrap.dedent("""
Specifies the number of slices to display per each view.
This must be even to facilitate better division.
Default: {}.
\n""".format(cfg.default_num_slices))
help_text_num_rows = textwrap.dedent("""
Specifies the number of rows to display per each axis.
Default: {}.
\n""".format(cfg.default_num_rows))
help_text_prepare = textwrap.dedent("""
This flag enables batch-generation of 3d surface visualizations, prior to starting any review and rating operations.
This makes the switch from one subject to the next, even more seamless (saving few seconds :) ).
Default: False (required visualizations are generated only on demand, which can take 5-10 seconds for each subject).
\n""")
help_text_outlier_detection_method = textwrap.dedent("""
Method used to detect the outliers.
For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html
Default: {}.
\n""".format(cfg.default_outlier_detection_method))
help_text_views = textwrap.dedent("""
Specifies the set of views to display - could be just 1 view, or 2 or all 3.
Example: --views 0 (typically sagittal) or --views 1 2 (axial and coronal)
Default: {} {} {} (show all the views in the selected segmentation)
\n""".format(cfg.default_views[0], cfg.default_views[1], cfg.default_views[2]))
help_text_num_slices = textwrap.dedent("""
Specifies the number of slices to display per each view.
This must be even to facilitate better division.
Default: {}.
\n""".format(cfg.default_num_slices))
help_text_num_rows = textwrap.dedent("""
Specifies the number of rows to display per each axis.
Default: {}.
\n""".format(cfg.default_num_rows))
help_text_prepare = textwrap.dedent("""
This flag enables batch-generation of 3d surface visualizations, prior to starting any review and rating operations.
This makes the switch from one subject to the next, even more seamless (saving few seconds :) ).
Default: False (required visualizations are generated only on demand, which can take 5-10 seconds for each subject).
\n""")
help_text_outlier_detection_method = textwrap.dedent("""
Method used to detect the outliers.
For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html
Default: {}.
\n""".format(cfg.default_outlier_detection_method))
help=help_text_outlier_feat_types)
outliers.add_argument("-old", "--disable_outlier_detection", action="store_true", dest="disable_outlier_detection",
required=False, help=help_text_disable_outlier_detection)
layout = parser.add_argument_group('Layout options', ' ')
layout.add_argument("-w", "--views", action="store", dest="views",
default=default_views, required=False, nargs='+',
help=help_text_views)
layout.add_argument("-s", "--num_slices", action="store", dest="num_slices",
default=default_num_slices, required=False,
help=help_text_num_slices)
layout.add_argument("-r", "--num_rows", action="store", dest="num_rows",
default=default_num_rows, required=False,
help=help_text_num_rows)
wf_args = parser.add_argument_group('Workflow', 'Options related to workflow e.g. to pre-generate all the visualizations required')
wf_args.add_argument("-p", "--prepare_first", action="store_true", dest="prepare_first",
help=help_text_prepare)
return parser
help_text_views = textwrap.dedent("""
Specifies the set of views to display - could be just 1 view, or 2 or all 3.
Example: --views 0 (typically sagittal) or --views 1 2 (axial and coronal)
Default: {} {} {} (show all the views in the selected segmentation)
\n""".format(cfg.default_views[0], cfg.default_views[1], cfg.default_views[2]))
help_text_num_slices = textwrap.dedent("""
Specifies the number of slices to display per each view.
This must be even to facilitate better division.
Default: {}.
\n""".format(cfg.default_num_slices))
help_text_num_rows = textwrap.dedent("""
Specifies the number of rows to display per each axis.
Default: {}.
\n""".format(cfg.default_num_rows))
help_text_prepare = textwrap.dedent("""
This flag does the heavy preprocessing first, prior to starting any review and rating operations.
Heavy processing can include computation of registration quality metrics and outlier detection etc.
This makes the switch from one subject to the next, even more seamless (saving few seconds :) ).
Default: False.
\n""")
help_text_outlier_detection_method = textwrap.dedent("""
Method used to detect the outliers.
For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html
Default: {}.
\n""".format(cfg.default_outlier_detection_method))
dest="disable_outlier_detection",
required=False, help=help_text_disable_outlier_detection)
layout = parser.add_argument_group('Layout options',
'Slice layout arragement when zooming in on a time point,\n'
' or show to the std. dev plot.')
layout.add_argument("-w", "--views", action="store", dest="views",
default=cfg.default_views, required=False, nargs='+',
help=help_text_views)
layout.add_argument("-s", "--num_slices", action="store", dest="num_slices",
default=cfg.default_num_slices, required=False,
help=help_text_num_slices)
layout.add_argument("-r", "--num_rows", action="store", dest="num_rows",
default=cfg.default_num_rows, required=False,
help=help_text_num_rows)
_wf_descr = 'Options related to workflow e.g. to pre-compute resource-intensive features, ' \
'and pre-generate all the visualizations required before initiating the review.'
wf_args = parser.add_argument_group('Workflow', _wf_descr)
wf_args.add_argument("-p", "--prepare_first", action="store_true",
dest="prepare_first",
help=help_text_prepare)
return parser
outliers.add_argument("-old", "--disable_outlier_detection", action="store_true",
dest="disable_outlier_detection",
required=False, help=help_text_disable_outlier_detection)
layout = parser.add_argument_group('Layout options', ' ')
layout.add_argument("-w", "--views", action="store", dest="views",
default=cfg.default_views, required=False, nargs='+',
help=help_text_views)
layout.add_argument("-s", "--num_slices", action="store", dest="num_slices",
default=cfg.default_num_slices, required=False,
help=help_text_num_slices)
layout.add_argument("-r", "--num_rows", action="store", dest="num_rows",
default=cfg.default_num_rows, required=False,
help=help_text_num_rows)
wf_args = parser.add_argument_group('Workflow', 'Options related to workflow '
'e.g. to pre-compute resource-intensive features, '
'and pre-generate all the visualizations required')
wf_args.add_argument("-ns", "--no_surface_vis", action="store_true",
dest="no_surface_vis", help=help_text_no_surface_vis)
return parser
vis.add_argument("-dl", "--delay_in_animation", action="store",
dest="delay_in_animation",
default=cfg.delay_in_animation, required=False,
help=help_text_delay_in_animation)
layout = parser.add_argument_group('Layout options', ' ')
layout.add_argument("-w", "--views", action="store", dest="views",
default=cfg.default_views, required=False, nargs='+',
help=help_text_views)
layout.add_argument("-s", "--num_slices", action="store", dest="num_slices",
default=cfg.default_num_slices, required=False,
help=help_text_num_slices)
layout.add_argument("-r", "--num_rows", action="store", dest="num_rows",
default=cfg.default_num_rows, required=False,
help=help_text_num_rows)
wf_args = parser.add_argument_group('Workflow', 'Options related to workflow '
'e.g. to pre-compute '
'resource-intensive features, '
'and pre-generate all the '
'visualizations required')
wf_args.add_argument("-p", "--prepare_first", action="store_true",
dest="prepare_first",
help=help_text_prepare)
return parser
out_dir,
vis_type=cfg.default_vis_type,
label_set=cfg.default_label_set,
issue_list=cfg.default_rating_list,
mri_name=cfg.default_mri_name,
seg_name=cfg.default_seg_name,
alpha_set=cfg.default_alpha_set,
outlier_method=cfg.default_outlier_detection_method,
outlier_fraction=cfg.default_outlier_fraction,
outlier_feat_types=cfg.freesurfer_features_outlier_detection,
source_of_features=cfg.default_source_of_features_freesurfer,
disable_outlier_detection=False,
no_surface_vis=False,
views=cfg.default_views,
num_slices_per_view=cfg.default_num_slices,
num_rows_per_view=cfg.default_num_rows):
"""Constructor"""
super().__init__(id_list, in_dir, out_dir,
outlier_method, outlier_fraction,
outlier_feat_types, disable_outlier_detection)
self.issue_list = issue_list
# in_dir_type must be freesurfer; vis_type must be freesurfer
self.mri_name = mri_name
self.seg_name = seg_name
self.label_set = label_set
self.vis_type = vis_type
self.images_for_id = images_for_id
self.expt_id = 'rate_freesurfer_{}'.format(self.mri_name)
help_text_views = textwrap.dedent("""
Specifies the set of views to display - could be just 1 view, or 2 or all 3.
Example: --views 0 (typically sagittal) or --views 1 2 (axial and coronal)
Default: {} {} {} (show all the views in the selected segmentation)
\n""".format(default_views[0], default_views[1], default_views[2]))
help_text_num_slices = textwrap.dedent("""
Specifies the number of slices to display per each view.
This must be even to facilitate better division.
Default: {}.
\n""".format(default_num_slices))
help_text_num_rows = textwrap.dedent("""
Specifies the number of rows to display per each axis.
Default: {}.
\n""".format(default_num_rows))
help_text_contour_color = textwrap.dedent("""
Specifies the color to use for the contours overlaid on MRI (when vis_type requested prescribes contours).
Color can be specified in many ways as documented in https://matplotlib.org/users/colors.html
Default: {}.
\n""".format(cfg.default_contour_face_color))
help_text_outlier_detection_method = textwrap.dedent("""
Method used to detect the outliers.
For more info, read http://scikit-learn.org/stable/modules/outlier_detection.html
Default: {}.
\n""".format(cfg.default_outlier_detection_method))
help_text_outlier_fraction = textwrap.dedent("""