Module Import alias Import alias Import alias Import alias Import alias Import alias identifier Import alias identifier Import alias identifier FunctionDef arguments args defaults body Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Str handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call NameLoad For TupleStore NameStore NameStore NameLoad body If CompareEq NameLoad Str body Expr Call NameLoad orelse If CompareIn NameLoad Str body Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign NameStore ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign SubscriptStore NameLoad ExtSlice Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Slice BinOpSub Num NameLoad BinOpAdd BinOpAdd Num NameLoad Num Num Assign NameStore ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str Import alias Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Str keyword NameLoad Assign NameStore Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call NameLoad Str NameLoad Assign NameStore Str Expr Call NameLoad BinOpAdd Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad With Call NameLoad Str Str NameStore body Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Str Str Expr Call NameLoad BinOpAdd Str Call NameLoad NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore Num Expr Call AttributeLoad NameLoad attr Str If CompareEq NameLoad Num body Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad NameLoad If NameLoad body Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num orelse Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body If NameLoad body Print NameLoad decorator_list FunctionDef arguments args defaults body Print BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad NameLoad attr Num decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A sys N/A commands N/A getopt N/A os N/A time N/A numpy np N/A nibabel nib N/A sct_utils sct main N/A N/A N/A N/A N/A size_data 61 N/A size_label 1 N/A dice_acceptable 0.86 N/A test_passed 0 N/A remove_temp_files 0 N/A verbose 1 N/A N/A N/A N/A opts args N/A N/A getopt getopt N/A N/A sys argv N/A 1 hv: N/A N/A N/A N/A getopt GetoptError N/A N/A N/A usage N/A N/A opt arg opts N/A N/A N/A opt -h N/A N/A N/A usage N/A N/A N/A opt -v N/A N/A verbose N/A int arg N/A path_tmp N/A tmp. N/A N/A time strftime %y%m%d%H%M%S N/A N/A N/A sct run N/A mkdir  path_tmp verbose N/A N/A N/A os chdir path_tmp N/A data_src N/A N/A np zeros N/A size_data size_data size_data dtype N/A np int16 N/A data_dest N/A N/A np zeros N/A size_data size_data size_data dtype N/A np int16 N/A N/A data_src N/A N/A N/A 20 size_label N/A N/A 20 size_label 1 N/A N/A 20 size_label N/A N/A 20 size_label 1 N/A N/A 10 size_label N/A N/A 10 size_label 1 1 N/A N/A data_src N/A N/A N/A 25 size_label N/A N/A 25 size_label 1 N/A N/A 25 size_label N/A N/A 25 size_label 1 N/A N/A 20 size_label N/A N/A 20 size_label 1 2 N/A N/A data_src N/A N/A N/A 30 size_label N/A N/A 30 size_label 1 N/A N/A 30 size_label N/A N/A 30 size_label 1 N/A N/A 30 size_label N/A N/A 30 size_label 1 3 N/A N/A data_src N/A N/A N/A 25 size_label N/A N/A 25 size_label 1 N/A N/A 25 size_label N/A N/A 25 size_label 1 N/A N/A 40 size_label N/A N/A 40 size_label 1 4 N/A N/A data_src N/A N/A N/A 20 size_label N/A N/A 20 size_label 1 N/A N/A 20 size_label N/A N/A 20 size_label 1 N/A N/A 50 size_label N/A N/A 50 size_label 1 5 N/A points_moving N/A N/A 20 20 10 N/A 25 25 20 N/A 30 30 30 N/A 25 25 40 N/A 20 20 50 N/A N/A data_dest N/A N/A N/A 28 size_label N/A N/A 28 size_label 1 N/A N/A 28 size_label N/A N/A 28 size_label 1 N/A N/A 10 size_label N/A N/A 10 size_label 1 1 N/A N/A data_dest N/A N/A N/A 29 size_label N/A N/A 29 size_label 1 N/A N/A 29 size_label N/A N/A 29 size_label 1 N/A N/A 20 size_label N/A N/A 20 size_label 1 2 N/A N/A data_dest N/A N/A N/A 30 size_label N/A N/A 30 size_label 1 N/A N/A 30 size_label N/A N/A 30 size_label 1 N/A N/A 30 size_label N/A N/A 30 size_label 1 3 N/A N/A data_dest N/A N/A N/A 29 size_label N/A N/A 29 size_label 1 N/A N/A 29 size_label N/A N/A 29 size_label 1 N/A N/A 40 size_label N/A N/A 40 size_label 1 4 N/A N/A data_dest N/A N/A N/A 28 size_label N/A N/A 28 size_label 1 N/A N/A 28 size_label N/A N/A 28 size_label 1 N/A N/A 50 size_label N/A N/A 50 size_label 1 5 N/A points_fixed N/A N/A 28 28 10 N/A 29 29 20 N/A 30 30 30 N/A 29 29 40 N/A 28 28 50 N/A img_src N/A N/A nib Nifti1Image data_src N/A N/A np eye 4 N/A N/A N/A nib save img_src data_src.nii.gz N/A img_dest N/A N/A nib Nifti1Image data_dest N/A N/A np eye 4 N/A N/A N/A nib save img_dest data_dest.nii.gz N/A msct_register_landmarks N/A N/A rotation_matrix translation_array moving_points_reg N/A N/A msct_register_landmarks getRigidTransformFromLandmarks points_fixed points_moving constraints xy show False N/A text_file N/A open curve2straight_rigid.txt w N/A N/A N/A text_file write #Insight Transform File V1.0
 N/A N/A N/A text_file write #Transform 0
 N/A N/A N/A text_file write Transform: AffineTransform_double_3_3
 N/A N/A N/A text_file write N/A Parameters: %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f
 N/A N/A rotation_matrix N/A N/A 0 0 N/A rotation_matrix N/A N/A 0 1 N/A rotation_matrix N/A N/A 0 2 N/A rotation_matrix N/A N/A 1 0 N/A rotation_matrix N/A N/A 1 1 N/A rotation_matrix N/A N/A 1 2 N/A rotation_matrix N/A N/A 2 0 N/A rotation_matrix N/A N/A 2 1 N/A rotation_matrix N/A N/A 2 2 N/A translation_array N/A N/A 0 0 N/A translation_array N/A N/A 0 1 N/A translation_array N/A N/A 0 2 N/A N/A N/A text_file write FixedParameters: 0 0 0
 N/A N/A N/A text_file close N/A N/A printv 
Apply rigid transformation to curved landmarks... verbose N/A N/A N/A sct run sct_apply_transfo -i data_src.nii.gz -o data_src_rigid.nii.gz -d data_dest.nii.gz -w curve2straight_rigid.txt -x nn verbose N/A N/A printv 
Estimate b-spline transformation: curve --> straight... verbose N/A N/A N/A sct run isct_ANTSUseLandmarkImagesToGetBSplineDisplacementField data_dest.nii.gz data_src_rigid.nii.gz warp_curve2straight_intermediate.nii.gz 5x5x5 3 2 0 verbose N/A N/A printv 
Concatenate rigid and non-linear transformations... verbose N/A cmd isct_ComposeMultiTransform 3 warp_curve2straight.nii.gz -R data_dest.nii.gz warp_curve2straight_intermediate.nii.gz curve2straight_rigid.txt N/A N/A printv N/A >>  cmd verbose N/A N/A N/A commands getstatusoutput cmd N/A N/A printv 
Apply transformation to input image... verbose N/A N/A N/A sct run sct_apply_transfo -i data_src.nii.gz -o data_src_warp.nii.gz -d data_dest.nii.gz -w warp_curve2straight.nii.gz -x nn verbose N/A N/A printv 
Compute DICE coefficient... verbose N/A N/A N/A sct run sct_dice_coefficient data_dest.nii.gz data_src_warp.nii.gz -o dice.txt verbose N/A N/A open dice.txt r file_dice N/A N/A dice N/A float N/A N/A N/A N/A file_dice read replace 3D Dice coefficient =  N/A N/A printv N/A Dice coeff =  N/A str dice verbose N/A N/A dice dice_acceptable N/A N/A test_passed 1 N/A N/A N/A os chdir .. N/A N/A remove_temp_files 1 N/A N/A N/A printv 
Delete temporary files... verbose N/A N/A N/A sct run N/A rm -rf  path_tmp verbose N/A test_passed N/A N/A N/A printv 
Test passed!
 verbose N/A N/A N/A sys exit 0 N/A N/A N/A printv 
Test failed!
 verbose N/A N/A N/A sys exit 1 N/A printv N/A N/A string verbose N/A N/A N/A verbose N/A N/A string N/A usage N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A os path basename __file__ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Part of the Spinal Cord Toolbox <https://sourceforge.net/projects/spinalcordtoolbox>

DESCRIPTION
  This function test the integrity of ANTs output, given that some versions of ANTs give a wrong BSpline   transform notably when using isct_ANTSUseLandmarkImagesToGetBSplineDisplacementField..

USAGE
   N/A N/A N/A os path basename __file__ 

OPTIONAL ARGUMENTS
  -h                         show this help
  -v {0, 1}                  verbose. Default=1

 N/A N/A N/A sys exit 2 N/A N/A N/A __name__ __main__ N/A N/A N/A main