Module Import alias alias Import alias identifier ImportFrom alias Import alias identifier ImportFrom alias Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Str ImportFrom alias Import alias identifier Import alias identifier ClassDef bases body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore CompareGt SubscriptLoad NameLoad ExtSlice Slice Slice Slice NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice If CompareIn Str NameLoad body Assign NameStore NameLoad Print Str If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index UnaryOpInvert NameLoad Print TupleLoad Str AttributeLoad NameLoad attr Print Str If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad Print TupleLoad Str BinOpSub Call NameLoad NameLoad Print TupleLoad Str AttributeLoad NameLoad attr Assign NameStore BinOpDiv SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index UnaryOpInvert AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad attr Num If CompareEq AttributeLoad NameLoad attr Num body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad keyword Str keyword Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad keyword Str keyword Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad keyword Str keyword Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str For NameStore Call NameLoad Num body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword ListLoad Str Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword ListLoad Str Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str keyword ListLoad Str Str Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str orelse Assign NameStore NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str orelse Assign NameStore NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad
N/A N/A sys commands N/A numpy np time time N/A nibabel nib dipy.denoise.nlmeans nlmeans N/A N/A status path_sct N/A N/A commands getstatusoutput echo $SCT_DIR N/A N/A N/A N/A sys path append N/A path_sct /scripts msct_parser Parser N/A sct_utils sct N/A matplotlib.pyplot plt Param N/A N/A __init__ N/A N/A self N/A N/A N/A N/A self debug 0 N/A N/A self verbose 1 N/A N/A self remove_temp_files 1 N/A N/A self parameter Rician N/A N/A self file_to_denoise N/A N/A self output_file_name N/A N/A main N/A N/A file_to_denoise param output_file_name N/A N/A N/A N/A path file ext N/A N/A sct extract_fname file_to_denoise N/A img N/A N/A nib load file_to_denoise N/A hdr_0 N/A N/A img get_header N/A data N/A N/A img get_data N/A aff N/A N/A img get_affine N/A mask N/A N/A data N/A N/A N/A N/A noise_threshold N/A data N/A data N/A N/A N/A N/A N/A N/A -std arguments N/A N/A sigma std_noise N/A Applying Non-local mean filter... N/A N/A N/A param parameter Rician N/A N/A den N/A nlmeans data sigma sigma mask None rician True N/A N/A den N/A nlmeans data sigma sigma mask None rician False N/A N/A sigma N/A N/A np std N/A data N/A N/A mask N/A N/A vol size N/A data shape N/A Applying Non-local mean filter... N/A N/A N/A param parameter Rician N/A N/A den N/A nlmeans data sigma sigma mask mask rician True N/A N/A den N/A nlmeans data sigma sigma mask mask rician False N/A t N/A time N/A N/A total time N/A N/A time t N/A N/A vol size N/A den shape N/A axial_middle N/A N/A N/A data shape N/A 2 2 N/A before N/A N/A data N/A N/A N/A N/A axial_middle T N/A after N/A N/A den N/A N/A N/A N/A axial_middle T N/A diff_3d N/A N/A np absolute N/A N/A N/A den astype f8 N/A N/A data astype f8 N/A difference N/A N/A np absolute N/A N/A N/A after astype f8 N/A N/A before astype f8 N/A N/A -std arguments N/A N/A N/A difference N/A N/A N/A N/A mask N/A N/A N/A N/A axial_middle T 0 N/A N/A N/A param verbose 2 N/A N/A N/A fig ax N/A N/A plt subplots 1 3 N/A N/A N/A N/A ax N/A 0 imshow before cmap gray origin lower N/A N/A N/A N/A ax N/A 0 set_title before N/A N/A N/A N/A ax N/A 1 imshow after cmap gray origin lower N/A N/A N/A N/A ax N/A 1 set_title after N/A N/A N/A N/A ax N/A 2 imshow difference cmap gray origin lower N/A N/A N/A N/A ax N/A 2 set_title difference N/A i N/A range 3 N/A N/A N/A N/A N/A ax N/A i set_axis_off N/A N/A N/A plt show N/A N/A N/A plt savefig denoised_S0.png bbox_inches tight N/A img_denoise N/A N/A nib Nifti1Image den None hdr_0 N/A img_diff N/A N/A nib Nifti1Image diff_3d None hdr_0 N/A N/A output_file_name None N/A N/A output_file_name output_file_name N/A N/A output_file_name N/A N/A file _denoised ext N/A N/A N/A nib save img_denoise output_file_name N/A N/A N/A nib save img_diff N/A N/A file _difference ext N/A N/A N/A __name__ __main__ N/A N/A parser N/A Parser __file__ N/A N/A N/A N/A parser usage set_description Utility function to denoise images. N/A N/A N/A parser add_option name -i type_value file description Input NIFTI image to be denoised. mandatory True N/A N/A N/A parser add_option name -p type_value multiple_choice description Type of supposed noise: Rician or Gaussian. Default is Rician. mandatory False example N/A Rician Gaussian default_value Rician N/A N/A N/A parser add_option name -d type_value int description Threshold value for what to be considered as noise. The standard deviation of the noise is calculated for values below this limit. mandatory False default_value 80 N/A N/A N/A parser add_option name -std type_value float description Standard deviation of the noise. If not precised, it is calculated using a background of point of values below the threshold value (parameter d). mandatory False default_value 80 N/A N/A N/A parser add_option name -o type_value file_output description Name of the output NIFTI image. mandatory False N/A N/A N/A parser add_option name -r type_value multiple_choice description Remove temporary files. Specify 0 to get access to temporary files. mandatory False example N/A 0 1 default_value 1 N/A N/A N/A parser add_option name -v type_value multiple_choice description Verbose. 0: nothing. 1: basic. 2: extended. mandatory False default_value 0 example N/A 0 1 2 N/A arguments N/A N/A parser parse N/A N/A sys argv N/A 1 N/A parameter N/A arguments N/A -p N/A remove_temp_files N/A int N/A arguments N/A -r N/A verbose N/A int N/A arguments N/A -v N/A noise_threshold N/A int N/A arguments N/A -d N/A std_noise N/A float N/A arguments N/A -std N/A N/A -i arguments N/A N/A file_to_denoise N/A arguments N/A -i N/A N/A file_to_denoise None N/A N/A -o arguments N/A N/A output_file_name N/A arguments N/A -o N/A N/A output_file_name None N/A param N/A Param N/A N/A param verbose verbose N/A N/A param remove_temp_files remove_temp_files N/A N/A param parameter parameter N/A N/A main file_to_denoise param output_file_name