Skip to content

Commit

Permalink
Remove leftover unnecessary R| formatting (#3561)
Browse files Browse the repository at this point in the history
* Remove "R|" from the help descriptions of CLI scripts
* Clean up SmartFormatter docstrings that reference "R|"
  • Loading branch information
joshuacwnewton committed Nov 3, 2021
1 parent 081078d commit 8985ba3
Show file tree
Hide file tree
Showing 23 changed files with 56 additions and 58 deletions.
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_analyze_lesion.py
Expand Up @@ -27,7 +27,7 @@

def get_parser():
parser = SCTArgumentParser(
description='R|Compute statistics on segmented lesions. The function assigns an ID value to each lesion (1, 2, '
description='Compute statistics on segmented lesions. The function assigns an ID value to each lesion (1, 2, '
'3, etc.) and then outputs morphometric measures for each lesion:\n'
'- volume [mm^3]\n'
'- length [mm]: length along the Superior-Inferior axis\n'
Expand Down
6 changes: 3 additions & 3 deletions spinalcordtoolbox/scripts/sct_compute_snr.py
Expand Up @@ -39,7 +39,7 @@ def get_parser():
mandatoryArguments.add_argument(
'-i',
required=True,
help="R|Image to compute the SNR on. (Example: b0s.nii.gz)\n"
help="Image to compute the SNR on. (Example: b0s.nii.gz)\n"
"- For '-method diff' and '-method mult', the image must be 4D, as SNR will be computed "
"along the 4th dimension.\n"
"- For '-method single', the image can either be 3D or 4D. If a 4D image is passed, a specific "
Expand All @@ -63,7 +63,7 @@ def get_parser():
default='')
optional.add_argument(
'-method',
help='R|Method to use to compute the SNR (default: diff):\n'
help='Method to use to compute the SNR (default: diff):\n'
" - diff: Substract two volumes (defined by -vol) and estimate noise variance within the ROI "
"(flag '-m' is required). Requires a 4D volume.\n"
" - mult: Estimate noise variance over time across volumes specified with '-vol'. Requires a 4D volume.\n"
Expand All @@ -78,7 +78,7 @@ def get_parser():
default='diff')
optional.add_argument(
'-vol',
help="R|Volumes to compute SNR from. Separate with ',' (Example: '-vol 0,1'), or select range "
help="Volumes to compute SNR from. Separate with ',' (Example: '-vol 0,1'), or select range "
"using ':' (Example: '-vol 2:50'). If this argument is not passed:\n"
" - For '-method mult', all volumes will be used.\n"
" - For '-method diff', the first two volumes will be used.\n"
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_create_mask.py
Expand Up @@ -71,7 +71,7 @@ def get_parser():
'-p',
default=param_default.process,
required=True,
help='R|Process to generate mask.\n'
help='Process to generate mask.\n'
' <coord,XxY>: Center mask at the X,Y coordinates. (e.g. "coord,20x15")\n'
' <point,FILE>: Center mask at the X,Y coordinates of the label defined in input volume FILE. (e.g. "point,label.nii.gz")\n'
' <center>: Center mask in the middle of the FOV (nx/2, ny/2).\n'
Expand Down
4 changes: 2 additions & 2 deletions spinalcordtoolbox/scripts/sct_deepseg_lesion.py
Expand Up @@ -37,7 +37,7 @@ def get_parser():
mandatory.add_argument(
"-c",
required=True,
help='R|Type of image contrast.\n'
help='Type of image contrast.\n'
' t2: T2w scan with isotropic or anisotropic resolution.\n'
' t2_ax: T2w scan with axial orientation and thick slices.\n'
' t2s: T2*w scan with axial orientation and thick slices.',
Expand All @@ -53,7 +53,7 @@ def get_parser():
)
optional.add_argument(
"-centerline",
help="R|Method used for extracting the centerline:\n"
help="Method used for extracting the centerline:\n"
" svm: Automatic detection using Support Vector Machine algorithm.\n"
" cnn: Automatic detection using Convolutional Neural Network.\n"
" viewer: Semi-automatic detection using manual selection of a few points with an interactive viewer "
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_deepseg_sc.py
Expand Up @@ -50,7 +50,7 @@ def get_parser():
help="show this help message and exit")
optional.add_argument(
"-centerline",
help="R|Method used for extracting the centerline:\n"
help="Method used for extracting the centerline:\n"
" svm: Automatic detection using Support Vector Machine algorithm.\n"
" cnn: Automatic detection using Convolutional Neural Network.\n"
" viewer: Semi-automatic detection using manual selection of a few points with an interactive viewer "
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_dmri_compute_dti.py
Expand Up @@ -49,7 +49,7 @@ def get_parser():
help="Show this help message and exit")
optional.add_argument(
'-method',
help='R|Type of method to calculate the diffusion tensor:\n'
help='Type of method to calculate the diffusion tensor:\n'
' standard: Standard equation [Basser, Biophys J 1994]\n'
' restore: Robust fitting with outlier detection [Chang, MRM 2005]',
default='standard',
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_dmri_moco.py
Expand Up @@ -101,7 +101,7 @@ def get_parser():
'-param',
metavar=Metavar.list,
type=list_type(',', str),
help=f"R|Advanced parameters. Assign value with \"=\", and separate arguments with \",\".\n"
help=f"Advanced parameters. Assign value with \"=\", and separate arguments with \",\".\n"
f" - poly [int]: Degree of polynomial function used for regularization along Z. For no regularization "
f"set to 0. Default={param_default.poly}.\n"
f" - smooth [mm]: Smoothing kernel. Default={param_default.smooth}.\n"
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_download_data.py
Expand Up @@ -123,7 +123,7 @@ def get_parser():
'-o',
metavar=Metavar.folder,
action=ActionCreateFolder,
help="R|Path to a directory to save the downloaded data.\n"
help="Path to a directory to save the downloaded data.\n"
"(Defaults to ./${dataset-name}. Directory will be created if it does not exist. Warning: existing "
"data in the directory will be erased unless -k is provided.)\n"
)
Expand Down
20 changes: 10 additions & 10 deletions spinalcordtoolbox/scripts/sct_extract_metric.py
Expand Up @@ -125,7 +125,7 @@ def get_parser():
'-method',
choices=['ml', 'map', 'wa', 'bin', 'median', 'max'],
default=param_default.method,
help="R|Method to extract metrics.\n"
help="Method to extract metrics.\n"
" - ml: maximum likelihood.\n"
" This method is recommended for large labels and low noise. Also, this method should only be used"
" with the PAM50 white/gray matter atlas, or with any custom atlas as long as the sum across all labels"
Expand Down Expand Up @@ -160,7 +160,7 @@ def get_parser():
'-o',
metavar=Metavar.file,
default=param_default.fname_output,
help="R|File name of the output result file collecting the metric estimation results. Include the '.csv' "
help="File name of the output result file collecting the metric estimation results. Include the '.csv' "
"file extension in the file name. Example: extract_metric.csv"
)
optional.add_argument(
Expand All @@ -175,15 +175,15 @@ def get_parser():
'-z',
metavar=Metavar.str,
default=param_default.slices_of_interest,
help="R|Slice range to estimate the metric from. First slice is 0. Example: 5:23\n"
help="Slice range to estimate the metric from. First slice is 0. Example: 5:23\n"
"You can also select specific slices using commas. Example: 0,2,3,5,12'"
)
optional.add_argument(
'-perslice',
type=int,
choices=(0, 1),
default=param_default.perslice,
help="R|Whether to output one metric per slice instead of a single output metric. 0 = no, 1 = yes.\n"
help="Whether to output one metric per slice instead of a single output metric. 0 = no, 1 = yes.\n"
"Please note that when methods ml or map are used, outputting a single metric per slice and then "
"averaging them all is not the same as outputting a single metric at once across all slices."
)
Expand All @@ -197,16 +197,16 @@ def get_parser():
'-vertfile',
metavar=Metavar.file,
default="./label/template/PAM50_levels.nii.gz",
help="R|Vertebral labeling file. Only use with flag -vert.\n"
"The input Image and the vertebral labelling file must in the same voxel coordinate system "
"and must match the dimensions between each other."
help="Vertebral labeling file. Only use with flag -vert.\n"
"The input Image and the vertebral labelling file must in the same voxel coordinate system "
"and must match the dimensions between each other."
)
optional.add_argument(
'-perlevel',
type=int,
metavar=Metavar.int,
default=0,
help="R|Whether to output one metric per vertebral level instead of a single output metric. 0 = no, 1 = yes.\n"
help="Whether to output one metric per vertebral level instead of a single output metric. 0 = no, 1 = yes.\n"
"Please note that this flag needs to be used with the -vert option."
)
optional.add_argument(
Expand All @@ -224,7 +224,7 @@ def get_parser():
'-param',
metavar=Metavar.str,
default='',
help="R|Advanced parameters for the 'map' method. Separate with comma. All items must be listed (separated "
help="Advanced parameters for the 'map' method. Separate with comma. All items must be listed (separated "
"with comma).\n"
" - #1: standard deviation of metrics across labels\n"
" - #2: standard deviation of the noise (assumed Gaussian)"
Expand All @@ -248,7 +248,7 @@ def get_parser():
'-norm-method',
choices=['sbs', 'whole'],
default='',
help="R|Method to use for normalization:\n"
help="Method to use for normalization:\n"
" - sbs: normalization slice-by-slice\n"
" - whole: normalization by the metric value in the whole label for all slices."
)
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_fmri_moco.py
Expand Up @@ -72,7 +72,7 @@ def get_parser():
'-param',
metavar=Metavar.list,
type=list_type(',', str),
help=f"R|Advanced parameters. Assign value with \"=\"; Separate arguments with \",\".\n"
help=f"Advanced parameters. Assign value with \"=\"; Separate arguments with \",\".\n"
f" - poly [int]: Degree of polynomial function used for regularization along Z. For no regularization "
f"set to 0. Default={param_default.poly}.\n"
f" - smooth [mm]: Smoothing kernel. Default={param_default.smooth}.\n"
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_get_centerline.py
Expand Up @@ -50,7 +50,7 @@ def get_parser():
"-method",
choices=['optic', 'viewer', 'fitseg'],
default='optic',
help="R|Method used for extracting the centerline.\n"
help="Method used for extracting the centerline.\n"
" - optic: automatic spinal cord detection method\n"
" - viewer: manual selection a few points followed by interpolation\n"
" - fitseg: fit a regularized centerline on an already-existing cord segmentation. It will "
Expand Down
4 changes: 2 additions & 2 deletions spinalcordtoolbox/scripts/sct_image.py
Expand Up @@ -37,10 +37,10 @@ def get_parser():
'-i',
nargs='+',
metavar=Metavar.file,
help='R|Input file(s). Example: "data.nii.gz"\n'
help='Input file(s). Example: "data.nii.gz"\n'
'Note: Only "-concat" or "-omc" support multiple input files. In those cases, separate filenames using '
'spaces. Example usage: "sct_image -i data1.nii.gz data2.nii.gz -concat"',
required = True)
required=True)
optional = parser.add_argument_group('OPTIONAL ARGUMENTS')
optional.add_argument(
'-h',
Expand Down
6 changes: 3 additions & 3 deletions spinalcordtoolbox/scripts/sct_label_utils.py
Expand Up @@ -90,7 +90,7 @@ def get_parser():
'-create-seg',
metavar=Metavar.list,
type=list_type(':', list_type(',', int)),
help="R|Create labels on a cord segmentation (or centerline) image defined by '-i'. Each label should be "
help="Create labels on a cord segmentation (or centerline) image defined by '-i'. Each label should be "
"specified using the form 'v1,v2' where 'v1' is value of the slice index along the inferior-superior "
"axis, and 'v2' is the value of the label. Separate each label with ':'. \n"
"Example: '-create-seg 5,1:14,2:23,3' adds three labels at the axial slices 5, 14, and 23 (starting from "
Expand All @@ -101,7 +101,7 @@ def get_parser():
'-create-seg-mid',
metavar=Metavar.int,
type=int,
help="R|Similar to '-create-seg'. This option takes a single label value, and will automatically select the "
help="Similar to '-create-seg'. This option takes a single label value, and will automatically select the "
"mid-point slice in the inferior-superior direction (so there is no need for a slice index).\n"
"This is useful for when you have centered the field of view of your data at a specific location. "
"For example, if you already know that the C2-C3 disc is centered in the I-S direction, then "
Expand Down Expand Up @@ -144,7 +144,7 @@ def get_parser():
'-vert-body',
metavar=Metavar.list,
type=list_type(',', int),
help="R|From vertebral labeling, create points that are centered at the mid-vertebral levels. Separate "
help="From vertebral labeling, create points that are centered at the mid-vertebral levels. Separate "
"desired levels with ','. Example: 3,8\n"
"To get all levels, enter 0."
)
Expand Down
4 changes: 2 additions & 2 deletions spinalcordtoolbox/scripts/sct_label_vertebrae.py
Expand Up @@ -109,7 +109,7 @@ def get_parser():
'-initz',
metavar=Metavar.list,
type=list_type(',', int),
help="R|Initialize using slice number and disc value. Example: 68,4 (slice 68 corresponds to disc C3/C4). "
help="Initialize using slice number and disc value. Example: 68,4 (slice 68 corresponds to disc C3/C4). "
"Example: 125,3\n"
"WARNING: Slice number should correspond to superior-inferior direction (e.g. Z in RPI orientation, but "
"Y in LIP orientation)."
Expand Down Expand Up @@ -177,7 +177,7 @@ def get_parser():
'-param',
metavar=Metavar.list,
type=list_type(',', str),
help=f"R|Advanced parameters. Assign value with \"=\"; Separate arguments with \",\"\n"
help=f"Advanced parameters. Assign value with \"=\"; Separate arguments with \",\"\n"
f" - shift_AP [mm]: AP shift of centerline for disc search. Default={param_default.shift_AP}.\n"
f" - size_AP [mm]: AP window size for disc search. Default={param_default.size_AP}.\n"
f" - size_RL [mm]: RL window size for disc search. Default={param_default.size_RL}.\n"
Expand Down
8 changes: 4 additions & 4 deletions spinalcordtoolbox/scripts/sct_maths.py
Expand Up @@ -109,7 +109,7 @@ def get_parser():
"-adap",
metavar=Metavar.list,
type=list_type(',', int),
help="R|Threshold image using Adaptive algorithm (from skimage). Provide 2 values separated by ',' that "
help="Threshold image using Adaptive algorithm (from skimage). Provide 2 values separated by ',' that "
"correspond to the parameters below. For example, '-adap 7,0' corresponds to a block size of 7 and an "
"offset of 0.\n"
" - Block size: Odd size of pixel neighborhood which is used to calculate the threshold value. \n"
Expand All @@ -120,7 +120,7 @@ def get_parser():
"-otsu-median",
metavar=Metavar.list,
type=list_type(',', int),
help="R|Threshold image using Median Otsu algorithm (from dipy). Provide 2 values separated by ',' that "
help="Threshold image using Median Otsu algorithm (from dipy). Provide 2 values separated by ',' that "
"correspond to the parameters below. For example, '-otsu-median 3,5' corresponds to a filter size of 3 "
"repeated over 5 iterations.\n"
" - Size: Radius (in voxels) of the applied median filter.\n"
Expand Down Expand Up @@ -164,7 +164,7 @@ def get_parser():
required=False)
mathematical.add_argument(
'-shape',
help="R|Shape of the structuring element for the mathematical morphology operation. Default: ball.\n"
help="Shape of the structuring element for the mathematical morphology operation. Default: ball.\n"
"If a 2D shape {'disk', 'square'} is selected, -dim must be specified.",
required=False,
choices=('square', 'cube', 'disk', 'ball'),
Expand Down Expand Up @@ -196,7 +196,7 @@ def get_parser():
required=False)
filtering.add_argument(
'-denoise',
help='R|Non-local means adaptative denoising from P. Coupe et al. as implemented in dipy. Separate with ". Example: p=1,b=3\n'
help='Non-local means adaptative denoising from P. Coupe et al. as implemented in dipy. Separate with ". Example: p=1,b=3\n'
' p: (patch radius) similar patches in the non-local means are searched for locally, inside a cube of side 2*p+1 centered at each voxel of interest. Default: p=1\n'
' b: (block radius) the size of the block to be used (2*b+1) in the blockwise non-local means implementation. Default: b=5 '
' Note, block radius must be smaller than the smaller image dimension: default value is lowered for small images)\n'
Expand Down
4 changes: 2 additions & 2 deletions spinalcordtoolbox/scripts/sct_process_segmentation.py
Expand Up @@ -142,7 +142,7 @@ def get_parser():
'-vertfile',
metavar=Metavar.str,
default='./label/template/PAM50_levels.nii.gz',
help="R|Vertebral labeling file. Only use with flag -vert.\n"
help="Vertebral labeling file. Only use with flag -vert.\n"
"The input and the vertebral labelling file must in the same voxel coordinate system "
"and must match the dimensions between each other. "
)
Expand Down Expand Up @@ -213,7 +213,7 @@ def get_parser():
metavar=Metavar.list,
action=SeparateNormArgs,
nargs="+",
help="R|Normalize CSA values ('MEAN(area)').\n"
help="Normalize CSA values ('MEAN(area)').\n"
"Two models are available:\n"
" 1. sex, brain-volume, thalamus-volume.\n"
" 2. sex, brain-volume.\n"
Expand Down
4 changes: 2 additions & 2 deletions spinalcordtoolbox/scripts/sct_propseg.py
Expand Up @@ -278,7 +278,7 @@ def get_parser():
optional.add_argument(
'-init-centerline',
metavar=Metavar.file,
help="R|Filename of centerline to use for the propagation. Use format .txt or .nii; see file structure in "
help="Filename of centerline to use for the propagation. Use format .txt or .nii; see file structure in "
"documentation.\n"
"Replace filename by 'viewer' to use interactive viewer for providing centerline. Example: "
"-init-centerline viewer"
Expand All @@ -292,7 +292,7 @@ def get_parser():
optional.add_argument(
'-init-mask',
metavar=Metavar.file,
help="R|Mask containing three center of the spinal cord, used to initiate the propagation.\n"
help="Mask containing three center of the spinal cord, used to initiate the propagation.\n"
"Replace filename by 'viewer' to use interactive viewer for providing mask. Example: -init-mask viewer"
)
optional.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion spinalcordtoolbox/scripts/sct_register_multimodal.py
Expand Up @@ -157,7 +157,7 @@ def get_parser():
'-param',
metavar=Metavar.list,
type=list_type(':', str),
help=(f"R|Parameters for registration. Separate arguments with \",\". Separate steps with \":\".\n"
help=(f"Parameters for registration. Separate arguments with \",\". Separate steps with \":\".\n"
f"Example: step=1,type=seg,algo=slicereg,metric=MeanSquares:step=2,type=im,algo=syn,metric=MI,iter=5,"
f"shrink=2\n"
f" - step: <int> Step number (starts at 1, except for type=label).\n"
Expand Down

0 comments on commit 8985ba3

Please sign in to comment.