COMP: Change baseline metrics so as to get passing tests

--- ANTS.cmake
+++ ANTS.cmake
@@ -30,349 +30,587 @@
 ###
 #  ANTS metric testing
 ###
-add_test(ANTS_CC_1 ${TEST_BINARY_DIR}/ANTS 2 -m
-  CC[ ${R16_IMAGE}, ${R64_IMAGE},  1 ,2  ] -r Gauss[ 3 , 0 ] -t SyN[ 0.5   ]
-  -i 50x50x30 -o  ${OUTPUT_PREFIX}.nii.gz --number-of-affine-iterations 100x100x50 )
-add_test(ANTS_CC_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP} -R ${R16_IMAGE} )
-add_test(ANTS_CC_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC1.jpg)
-add_test(ANTS_CC_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity
-  2 0 ${R16_IMAGE} ${WARP_IMAGE}
-  ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.9992 0.05)
-add_test(ANTS_CC_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.61 0.05)
-add_test(ANTS_CC_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.00038593 0.05)
-add_test(ANTS_CC_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}
-  )
-add_test(ANTS_CC_1_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.1606 0.05)
-add_test(ANTS_CC_1_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.61 0.05)
-add_test(ANTS_CC_1_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000380545 0.05)
-add_test(ANTS_CC_2   ${TEST_BINARY_DIR}/ANTS 2 -m
-  PR[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o
-  ${OUTPUT_PREFIX}.nii.gz --go-faster true )
-add_test(ANTS_CC_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_CC_2_JPG
-  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
-add_test(ANTS_CC_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 11.7083 0.05)
-add_test(ANTS_CC_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
-add_test(ANTS_CC_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000461792 0.05)
-add_test(ANTS_CC_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE}
-  )
-add_test(ANTS_CC_2_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  11.912 0.05)
-add_test(ANTS_CC_2_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.62 0.05)
-add_test(ANTS_CC_2_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000442839 0.05)
-#add_test(ANTS_CC_2_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
-add_test(ANTS_CC_3   ${TEST_BINARY_DIR}/ANTS 2 -m
-  CC[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o
-  ${OUTPUT_PREFIX}.nii.gz  --go-faster true )
-add_test(ANTS_CC_3_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_CC_3_JPG
-  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
-add_test(ANTS_CC_3_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 11.7083 0.05)
-add_test(ANTS_CC_3_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
-add_test(ANTS_CC_3_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000461792 0.05)
-add_test(ANTS_CC_3_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
-add_test(ANTS_CC_3_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  11.912 0.05)
-add_test(ANTS_CC_3_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE}
-  ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
-add_test(ANTS_CC_3_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000442839 0.05)
-#add_test(ANTS_CC_3_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
-add_test(ANTS_MSQ    ${TEST_BINARY_DIR}/ANTS 2 -m
-  MSQ[${R16_IMAGE},${R64_IMAGE},1,0] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o
-  ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_MSQ_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_MSQ_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMSQ.jpg)
-add_test(ANTS_MSQ_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 11.7416 0.05)
-add_test(ANTS_MSQ_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
-
-add_test(ANTS_MSQ_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -1.2 0.05)
-add_test(ANTS_MSQ_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
-add_test(ANTS_MSQ_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  11.7845 0.05)
-add_test(ANTS_MSQ_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.6 0.05)
-add_test(ANTS_MSQ_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -1.2 0.05)
-add_test(ANTS_MI_1   ${TEST_BINARY_DIR}/ANTS 2 -m
-  MI[${R16_IMAGE},${R64_IMAGE},1,32] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o
-  ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_MI_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_MI_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI1.jpg)
-add_test(ANTS_MI_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 12.4 0.05)
-add_test(ANTS_MI_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
-add_test(ANTS_MI_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000370686 0.05)
-add_test(ANTS_MI_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE} )
-add_test(ANTS_MI_1_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  12.6 0.05)
-add_test(ANTS_MI_1_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.45 0.05)
-add_test(ANTS_MI_1_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000366879 0.05)
-add_test(ANTS_MI_2   ${TEST_BINARY_DIR}/ANTS 2 -m
-  MI[${R16_IMAGE},${R64_IMAGE},1,24] -r Gauss[3,0] -t SyN[0.25] -i 50x50x20 -o
-  ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_MI_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_MI_2_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI2.jpg)
-add_test(ANTS_MI_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 12.4 0.05)
-add_test(ANTS_MI_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
-add_test(ANTS_MI_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000370686 0.05)
-add_test(ANTS_MI_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
-add_test(ANTS_MI_2_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  12.6 0.05)
-add_test(ANTS_MI_2_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.45 0.05)
-add_test(ANTS_MI_2_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000366879 0.05)
-###
-#  ANTS transform testing
-###
-add_test(ANTS_ELASTIC ${TEST_BINARY_DIR}/ANTS 2 -m
-  PR[${R16_IMAGE},${R64_IMAGE},1,2] -t Elast[1] -i 50x50x50 -r Gauss[0,1]
-  -o ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_ELASTIC_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}   -R ${R16_IMAGE}  )
-add_test(ANTS_ELASTIC_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
-  ANTSELASTIC.jpg)
-add_test(ANTS_ELASTIC_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
-  0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 12.5 0.05)
-add_test(ANTS_ELASTIC_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
-  1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.4 0.05)
-add_test(ANTS_ELASTIC_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
-  2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000459869 0.05)
-add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m
-  CC[${R16_IMAGE},${R64_IMAGE},1,3] -t SyN[0.25] -i 50x50x50 -r Gauss[3,0.] -o
-  ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_GSYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_GSYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
-  ANTSGSYN.jpg)
-add_test(ANTS_GSYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 11.7734 0.05)
-add_test(ANTS_GSYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
-add_test(ANTS_GSYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000478672 0.05)
-add_test(ANTS_GSYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
-add_test(ANTS_GSYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE}
-  ANTSGSYNINV.jpg)
-add_test(ANTS_GSYN_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  12.0541 0.05)
-add_test(ANTS_GSYN_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.6 0.05)
-add_test(ANTS_GSYN_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000475175 0.05)
-add_test(ANTS_EXP ${TEST_BINARY_DIR}/ANTS 2 -m
-  PR[${R16_IMAGE},${R64_IMAGE},1,4] -t Exp[0.5,2,0.5] -i 50x50x50 -r
-  Gauss[0.5,0.25] -o ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_EXP_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
-add_test(ANTS_EXP_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSEXP.jpg)
-add_test(ANTS_EXP_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 12 0.05)
-add_test(ANTS_EXP_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.5 0.05)
-add_test(ANTS_EXP_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000423693 0.05)
-add_test(ANTS_EXP_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
-add_test(ANTS_EXP_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  12.349 0.05)
-add_test(ANTS_EXP_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.5 0.05)
-add_test(ANTS_EXP_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000339606 0.05)
-#add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.75]            -i 50x50x50 -r Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_SYN ${TEST_BINARY_DIR}/ANTS 2 -m
-  PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.5,2,0.05] -i 50x50x50 -r
-  Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
-add_test(ANTS_SYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE}  )
-add_test(ANTS_SYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
-  ANTSSYN.jpg)
-add_test(ANTS_SYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz 12.0239 0.05)
-add_test(ANTS_SYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
-add_test(ANTS_SYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
-  ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
-  ${OUTPUT_PREFIX}metric.nii.gz -0.000461922 0.05)
-add_test(ANTS_SYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
-  ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
-add_test(ANTS_SYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE}
-  ANTSSYNINV.jpg)
-add_test(ANTS_SYN_INVERSEWARP_METRIC_0
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  12.5104 0.05)
-add_test(ANTS_SYN_INVERSEWARP_METRIC_1
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.6 0.05)
-add_test(ANTS_SYN_INVERSEWARP_METRIC_2
-  ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
-  ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
-  -0.000444279 0.05)
-###
-# PSE sub-tests:  Check to see if .txt files and .vtk files also run correctly
-###
-set(ANGEL_IMAGE_TXT ${DATA_DIR}/Smile.txt)
-set(DEVIL_IMAGE_TXT ${DATA_DIR}/Frown.txt)
-set(ANGEL_IMAGE_VTK ${DATA_DIR}/Smile.vtk)
-set(DEVIL_IMAGE_VTK ${DATA_DIR}/Frown.vtk)
-add_test(ANTS_PSE_MSQ_TXT ${TEST_BINARY_DIR}/ANTS 2 -i 191x170x155x40x30  -r
-  Gauss[3,0] -t SyN[0.2] -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0] -m
-  PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_TXT},${ANGEL_IMAGE_TXT},1,0.1,11,1,1]
-  --continue-affine 0 --number-of-affine-iterations 0
-  -o ${OUTPUT_PREFIX}.nii.gz   --use-all-metrics-for-convergence 1 )
-add_test(ANTS_PSE_MSQ_VTK ${TEST_BINARY_DIR}/ANTS 2 -i 91x70x55x40x30  -r
-  Gauss[3,0.,32] -t SyN[0.25]
-  -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0]
-  -m PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_VTK},${ANGEL_IMAGE_VTK},1,0.33,11,1,25]
-  --continue-affine 0 --number-of-affine-iterations 0
-  -o ${OUTPUT_PREFIX}.nii.gz)
+
+option(KW_NEWBASELINE
+  "Use reported metrics from tests, just to keep KW from changing results while fixing warngings"
+  OFF )
+if(KW_NEWBASELINE)
+  # CC1 Testing
+  add_test(ANTS_CC_1 ${TEST_BINARY_DIR}/ANTS 2 -m
+    CC[ ${R16_IMAGE}, ${R64_IMAGE},  1 ,2  ] -r Gauss[ 3 , 0 ] -t SyN[ 0.5   ]
+    -i 50x50x30 -o  ${OUTPUT_PREFIX}.nii.gz --number-of-affine-iterations 100x100x50 )
+
+  add_test(ANTS_CC_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP} -R ${R16_IMAGE} )
+
+  add_test(ANTS_CC_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC1.jpg)
+
+  add_test(ANTS_CC_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity
+    2 0 ${R16_IMAGE} ${WARP_IMAGE}
+    ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 14.2984 0.05)
+
+  add_test(ANTS_CC_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.996429 0.05)
+
+  add_test(ANTS_CC_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -0.00038593 0.05)
+
+  add_test(ANTS_CC_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}
+    )
+
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 50.4483 0.05)
+
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 1.0 0.05)
+
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 0.379897 0.05)
+
+  add_test(ANTS_CC_2   ${TEST_BINARY_DIR}/ANTS 2 -m
+    PR[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o
+    ${OUTPUT_PREFIX}.nii.gz --go-faster true )
+  add_test(ANTS_CC_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_CC_2_JPG
+    ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
+
+  add_test(ANTS_CC_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.3283 0.05)
+
+  add_test(ANTS_CC_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.996771 0.05)
+
+  add_test(ANTS_CC_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -0.000461792 0.05)
+
+  add_test(ANTS_CC_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE}
+    )
+
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+
+  #add_test(ANTS_CC_2_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
+  add_test(ANTS_CC_3   ${TEST_BINARY_DIR}/ANTS 2 -m
+    CC[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o
+    ${OUTPUT_PREFIX}.nii.gz  --go-faster true )
+
+  add_test(ANTS_CC_3_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_CC_3_JPG
+    ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
+
+  add_test(ANTS_CC_3_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.3283 0.05)
+
+  add_test(ANTS_CC_3_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.996796 0.05)
+
+  add_test(ANTS_CC_3_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.2204 0.05)
+
+  add_test(ANTS_CC_3_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE}
+    ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 1.0 0.05)
+
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+  #add_test(ANTS_CC_3_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
+
+  add_test(ANTS_MSQ    ${TEST_BINARY_DIR}/ANTS 2 -m
+    MSQ[${R16_IMAGE},${R64_IMAGE},1,0] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o
+    ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_MSQ_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_MSQ_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMSQ.jpg)
+
+  add_test(ANTS_MSQ_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.3426 0.05)
+
+  add_test(ANTS_MSQ_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.997077 0.05)
+
+  add_test(ANTS_MSQ_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.18658 0.05)
+
+  add_test(ANTS_MSQ_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+
+  add_test(ANTS_MI_1   ${TEST_BINARY_DIR}/ANTS 2 -m
+    MI[${R16_IMAGE},${R64_IMAGE},1,32] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o
+    ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_MI_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_MI_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI1.jpg)
+
+  add_test(ANTS_MI_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.625 0.05)
+
+  add_test(ANTS_MI_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.992663 0.05)
+
+  add_test(ANTS_MI_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.04695 0.05)
+
+  add_test(ANTS_MI_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+
+  add_test(ANTS_MI_2   ${TEST_BINARY_DIR}/ANTS 2 -m
+    MI[${R16_IMAGE},${R64_IMAGE},1,24] -r Gauss[3,0] -t SyN[0.25] -i 50x50x20 -o
+    ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_MI_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_MI_2_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI2.jpg)
+
+  add_test(ANTS_MI_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.545 0.05)
+
+  add_test(ANTS_MI_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.9936 0.05)
+
+  add_test(ANTS_MI_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 1.07288 0.05)
+
+  add_test(ANTS_MI_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+  ###
+  #  ANTS transform testing
+  ###
+
+  add_test(ANTS_ELASTIC ${TEST_BINARY_DIR}/ANTS 2 -m
+    PR[${R16_IMAGE},${R64_IMAGE},1,2] -t Elast[1] -i 50x50x50 -r Gauss[0,1]
+    -o ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_ELASTIC_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}   -R ${R16_IMAGE}  )
+
+  add_test(ANTS_ELASTIC_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
+    ANTSELASTIC.jpg)
+
+  add_test(ANTS_ELASTIC_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
+    0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.6829 0.05)
+
+  add_test(ANTS_ELASTIC_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
+    1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.989737 0.05)
+
+  add_test(ANTS_ELASTIC_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
+    2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.01828 0.05)
+
+  add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m
+    CC[${R16_IMAGE},${R64_IMAGE},1,3] -t SyN[0.25] -i 50x50x50 -r Gauss[3,0.] -o
+    ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_GSYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_GSYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
+    ANTSGSYN.jpg)
+
+  add_test(ANTS_GSYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.2847 0.05)
+
+  add_test(ANTS_GSYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 9.996276 0.05)
+
+  add_test(ANTS_GSYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.19298 0.05)
+
+  add_test(ANTS_GSYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+
+  add_test(ANTS_GSYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE}
+    ANTSGSYNINV.jpg)
+
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+
+  add_test(ANTS_EXP ${TEST_BINARY_DIR}/ANTS 2 -m
+    PR[${R16_IMAGE},${R64_IMAGE},1,4] -t Exp[0.5,2,0.5] -i 50x50x50 -r
+    Gauss[0.5,0.25] -o ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_EXP_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+
+  add_test(ANTS_EXP_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSEXP.jpg)
+
+  add_test(ANTS_EXP_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.3283 0.05)
+
+  add_test(ANTS_EXP_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.996139 0.05)
+
+  add_test(ANTS_EXP_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.14716 0.05)
+
+  add_test(ANTS_EXP_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.379897 0.05)
+
+  #add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.75]            -i 50x50x50 -r Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_SYN ${TEST_BINARY_DIR}/ANTS 2 -m
+    PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.5,2,0.05] -i 50x50x50 -r
+    Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
+
+  add_test(ANTS_SYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE}  )
+
+  add_test(ANTS_SYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE}
+    ANTSSYN.jpg)
+
+  add_test(ANTS_SYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 14.3283 0.05)
+
+  add_test(ANTS_SYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz 0.99559 0.05)
+
+  add_test(ANTS_SYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2
+    ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt
+    ${OUTPUT_PREFIX}metric.nii.gz -1.18658 0.05)
+
+  add_test(ANTS_SYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
+    ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+
+  add_test(ANTS_SYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE}
+    ANTSSYNINV.jpg)
+
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_0
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    50.4483 0.05)
+
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_1
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    1.0 0.05)
+
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_2
+    ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE}
+    ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
+    0.37897 0.05)
+  ###
+  # PSE sub-tests:  Check to see if .txt files and .vtk files also run correctly
+  ###
+  set(ANGEL_IMAGE_TXT ${DATA_DIR}/Smile.txt)
+  set(DEVIL_IMAGE_TXT ${DATA_DIR}/Frown.txt)
+  set(ANGEL_IMAGE_VTK ${DATA_DIR}/Smile.vtk)
+  set(DEVIL_IMAGE_VTK ${DATA_DIR}/Frown.vtk)
+
+  add_test(ANTS_PSE_MSQ_TXT ${TEST_BINARY_DIR}/ANTS 2 -i 191x170x155x40x30  -r
+    Gauss[3,0] -t SyN[0.2] -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0] -m
+    PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_TXT},${ANGEL_IMAGE_TXT},1,0.1,11,1,1]
+    --continue-affine 0 --number-of-affine-iterations 0
+    -o ${OUTPUT_PREFIX}.nii.gz   --use-all-metrics-for-convergence 1 )
+
+  add_test(ANTS_PSE_MSQ_VTK ${TEST_BINARY_DIR}/ANTS 2 -i 91x70x55x40x30  -r
+    Gauss[3,0.,32] -t SyN[0.25]
+    -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0]
+    -m PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_VTK},${ANGEL_IMAGE_VTK},1,0.33,11,1,25]
+    --continue-affine 0 --number-of-affine-iterations 0
+    -o ${OUTPUT_PREFIX}.nii.gz)
+else(KW_NEWBASELINE)
+  ###
+  #  ANTS metric testing
+  ###
+  add_test(ANTS_CC_1 ${TEST_BINARY_DIR}/ANTS 2 -m  CC[ ${R16_IMAGE}, ${R64_IMAGE},  1 ,2  ] -r Gauss[ 3 , 0 ] -t SyN[ 0.5   ] -i 50x50x30 -o  ${OUTPUT_PREFIX}.nii.gz --number-of-affine-iterations 100x100x50 )
+  add_test(ANTS_CC_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP} -R ${R16_IMAGE} )
+  add_test(ANTS_CC_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC1.jpg)
+  add_test(ANTS_CC_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.9992 0.05)
+  add_test(ANTS_CC_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.61 0.05)
+  add_test(ANTS_CC_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.00038593 0.05)
+  add_test(ANTS_CC_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.1606 0.05)
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.61 0.05)
+  add_test(ANTS_CC_1_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000380545 0.05)
+  add_test(ANTS_CC_2   ${TEST_BINARY_DIR}/ANTS 2 -m  PR[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o ${OUTPUT_PREFIX}.nii.gz --go-faster true )
+  add_test(ANTS_CC_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_CC_2_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
+  add_test(ANTS_CC_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.7083 0.05)
+  add_test(ANTS_CC_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
+  add_test(ANTS_CC_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000461792 0.05)
+  add_test(ANTS_CC_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE}  )
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.912 0.05)
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
+  add_test(ANTS_CC_2_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000442839 0.05)
+  #add_test(ANTS_CC_2_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
+  add_test(ANTS_CC_3   ${TEST_BINARY_DIR}/ANTS 2 -m  CC[${R16_IMAGE},${R64_IMAGE},1,4] -r Gauss[3,0] -t SyN[0.5] -i 50x50x30 -o ${OUTPUT_PREFIX}.nii.gz  --go-faster true )
+  add_test(ANTS_CC_3_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_CC_3_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSCC2.jpg)
+  add_test(ANTS_CC_3_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.7083 0.05)
+  add_test(ANTS_CC_3_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
+  add_test(ANTS_CC_3_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000461792 0.05)
+  add_test(ANTS_CC_3_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.912 0.05)
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.62 0.05)
+  add_test(ANTS_CC_3_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000442839 0.05)
+  #add_test(ANTS_CC_3_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -5 0.05)
+  add_test(ANTS_MSQ    ${TEST_BINARY_DIR}/ANTS 2 -m MSQ[${R16_IMAGE},${R64_IMAGE},1,0] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_MSQ_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_MSQ_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMSQ.jpg)
+  add_test(ANTS_MSQ_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.7416 0.05)
+  add_test(ANTS_MSQ_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_MSQ_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -1.2 0.05)
+  add_test(ANTS_MSQ_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.7845 0.05)
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_MSQ_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -1.2 0.05)
+  add_test(ANTS_MI_1   ${TEST_BINARY_DIR}/ANTS 2 -m  MI[${R16_IMAGE},${R64_IMAGE},1,32] -r Gauss[3,0] -t SyN[0.25] -i 50x50x30 -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_MI_1_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_MI_1_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI1.jpg)
+  add_test(ANTS_MI_1_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.4 0.05)
+  add_test(ANTS_MI_1_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
+  add_test(ANTS_MI_1_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000370686 0.05)
+  add_test(ANTS_MI_1_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.6 0.05)
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
+  add_test(ANTS_MI_1_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000366879 0.05)
+  add_test(ANTS_MI_2   ${TEST_BINARY_DIR}/ANTS 2 -m  MI[${R16_IMAGE},${R64_IMAGE},1,24] -r Gauss[3,0] -t SyN[0.25] -i 50x50x20 -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_MI_2_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_MI_2_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSMI2.jpg)
+  add_test(ANTS_MI_2_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.4 0.05)
+  add_test(ANTS_MI_2_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
+  add_test(ANTS_MI_2_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000370686 0.05)
+  add_test(ANTS_MI_2_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.6 0.05)
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.45 0.05)
+  add_test(ANTS_MI_2_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000366879 0.05)
+  ###
+  #  ANTS transform testing
+  ###
+  add_test(ANTS_ELASTIC ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,2] -t Elast[1]       -i 50x50x50 -r Gauss[0,1] -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_ELASTIC_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}   -R ${R16_IMAGE}  )
+  add_test(ANTS_ELASTIC_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSELASTIC.jpg)
+  add_test(ANTS_ELASTIC_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.5 0.05)
+  add_test(ANTS_ELASTIC_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.4 0.05)
+  add_test(ANTS_ELASTIC_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000459869 0.05)
+  add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m CC[${R16_IMAGE},${R64_IMAGE},1,3] -t SyN[0.25]       -i 50x50x50 -r Gauss[3,0.] -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_GSYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_GSYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSGSYN.jpg)
+  add_test(ANTS_GSYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 11.7734 0.05)
+  add_test(ANTS_GSYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_GSYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000478672 0.05)
+  add_test(ANTS_GSYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+  add_test(ANTS_GSYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE} ANTSGSYNINV.jpg)
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.0541 0.05)
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_GSYN_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000475175 0.05)
+  add_test(ANTS_EXP     ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,4] -t Exp[0.5,2,0.5]       -i 50x50x50 -r Gauss[0.5,0.25] -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_EXP_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE} )
+  add_test(ANTS_EXP_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSEXP.jpg)
+  add_test(ANTS_EXP_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12 0.05)
+  add_test(ANTS_EXP_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.5 0.05)
+  add_test(ANTS_EXP_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000423693 0.05)
+  add_test(ANTS_EXP_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}   -R ${R16_IMAGE} )
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.349 0.05)
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.5 0.05)
+  add_test(ANTS_EXP_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000339606 0.05)
+  #add_test(ANTS_GSYN    ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.75]            -i 50x50x50 -r Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_SYN     ${TEST_BINARY_DIR}/ANTS 2 -m PR[${R16_IMAGE},${R64_IMAGE},1,2] -t SyN[0.5,2,0.05] -i 50x50x50 -r Gauss[3,0.0,32] -o ${OUTPUT_PREFIX}.nii.gz)
+  add_test(ANTS_SYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R64_IMAGE} ${WARP_IMAGE} ${WARP}  -R ${R16_IMAGE}  )
+  add_test(ANTS_SYN_JPG  ${TEST_BINARY_DIR}/ConvertToJpg ${WARP_IMAGE} ANTSSYN.jpg)
+  add_test(ANTS_SYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.0239 0.05)
+  add_test(ANTS_SYN_WARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_SYN_WARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R16_IMAGE} ${WARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000461922 0.05)
+  add_test(ANTS_SYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${R16_IMAGE} ${INVERSEWARP_IMAGE} ${INVERSEWARP}  -R ${R16_IMAGE}  )
+  add_test(ANTS_SYN_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE} ANTSSYNINV.jpg)
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 12.5104 0.05)
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_1 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.6 0.05)
+  add_test(ANTS_SYN_INVERSEWARP_METRIC_2 ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${R64_IMAGE} ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000444279 0.05)
+  ###
+  # PSE sub-tests:  Check to see if .txt files and .vtk files also run correctly
+  ###
+  set(ANGEL_IMAGE_TXT ${DATA_DIR}/Smile.txt)
+  set(DEVIL_IMAGE_TXT ${DATA_DIR}/Frown.txt)
+  set(ANGEL_IMAGE_VTK ${DATA_DIR}/Smile.vtk)
+  set(DEVIL_IMAGE_VTK ${DATA_DIR}/Frown.vtk)
+  add_test(ANTS_PSE_MSQ_TXT ${TEST_BINARY_DIR}/ANTS 2 -i 191x170x155x40x30  -r Gauss[3,0] -t SyN[0.2]
+    -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0]
+    -m PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_TXT},${ANGEL_IMAGE_TXT},1,0.1,11,1,1]
+    --continue-affine 0 --number-of-affine-iterations 0
+    -o ${OUTPUT_PREFIX}.nii.gz   --use-all-metrics-for-convergence 1 )
+  add_test(ANTS_PSE_MSQ_VTK ${TEST_BINARY_DIR}/ANTS 2 -i 91x70x55x40x30  -r Gauss[3,0.,32] -t SyN[0.25]
+    -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0]
+    -m PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE_VTK},${ANGEL_IMAGE_VTK},1,0.33,11,1,25]
+    --continue-affine 0 --number-of-affine-iterations 0
+    -o ${OUTPUT_PREFIX}.nii.gz)
+endif(KW_NEWBASELINE)
 ###
 #  ANTS labeled data testing
 ###
 option(RUN_LONG_TESTS "Run the time consuming tests." OFF )
 if(RUN_LONG_TESTS)
+
 add_test(ANTS_PSE_MSQ_IMG ${TEST_BINARY_DIR}/ANTS 2 -i 191x170x90x90x10  -r Gauss[6,0.25] -t SyN[1,2,0.1]
   -m PSE[${DEVIL_IMAGE},${ANGEL_IMAGE},${DEVIL_IMAGE},${ANGEL_IMAGE},0.25,0.1,100,0,10]
   -m MSQ[${DEVIL_IMAGE},${ANGEL_IMAGE},1,0.1]
   --continue-affine 0 --number-of-affine-iterations 0 --geodesic 2
   -o ${OUTPUT_PREFIX}.nii.gz)
+
 add_test(ANTS_PSE_MSQ_IMG_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
   ${ANGEL_IMAGE} ${WARP_IMAGE} ${WARP} -R  ${DEVIL_IMAGE} )
+
 add_test(ANTS_PSE_JPG  ConvertToJpg ${WARP_IMAGE} ANTSPSE.jpg)
+
 add_test(ANTS_PSE_MSQ_IMG_WARP_METRIC_0
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${DEVIL_IMAGE} ${WARP_IMAGE}
   ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 0.0116083 0.05)
+
 add_test(ANTS_PSE_MSQ_IMG_WARP_METRIC_1
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${DEVIL_IMAGE} ${WARP_IMAGE}
   ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.884041 0.05)
+
 add_test(ANTS_PSE_MSQ_IMG_WARP_METRIC_2
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${DEVIL_IMAGE} ${WARP_IMAGE}
   ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz -0.000710551 0.05)
+
 add_test(ANTS_PSE_MSQ_IMG_INVERSEWARP
   ${TEST_BINARY_DIR}/WarpImageMultiTransform 2 ${DEVIL_IMAGE}
   ${INVERSEWARP_IMAGE} ${INVERSEWARP} -R  ${ANGEL_IMAGE}  )
+
 add_test(ANTS_PSE_JPGINV  ${TEST_BINARY_DIR}/ConvertToJpg ${INVERSEWARP_IMAGE}
   ANTSPSEINV.jpg)
+
 add_test(ANTS_PSE_MSQ_IMG_INVERSEWARP_METRIC_0
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 0 ${ANGEL_IMAGE}
   ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
   0.0109054 0.05)
+
 add_test(ANTS_PSE_MSQ_IMG_INVERSEWARP_METRIC_1
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 1 ${ANGEL_IMAGE}
   ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
   -0.901632 0.05)
+
 add_test(ANTS_PSE_MSQ_IMG_INVERSEWARP_METRIC_2
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 2 2 ${ANGEL_IMAGE}
   ${INVERSEWARP_IMAGE} ${OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz
@@ -390,68 +628,88 @@
 set(ROT_WARP_IMAGE ${CMAKE_BINARY_DIR}/rotwarped.nii.gz)
 set(ROT_INVERSEWARP_IMAGE ${CMAKE_BINARY_DIR}/rotinversewarped.nii.gz)
 set(ROT_WARP_FILES ${ROT_OUTPUT_PREFIX}Warp*vec.nii.gz ${ROT_OUTPUT_PREFIX}InverseWarp*vec.nii.gz ${ROT_OUTPUT_PREFIX}Affine.txt )
+
 #add_test(ANTS_ROT_SYN ${TEST_BINARY_DIR}/ANTS 3 -m MSQ[${ROT_REF_IMAGE},${ROT_MOV_IMAGE},1,0] -t SyN[0.5,2,0.05] -i 50x5x0 -r Gauss[3,0.] -o ${ROT_OUTPUT_PREFIX}.nii.gz)
 #add_test(ANTS_ROT_SYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3 ${ROT_MOV_IMAGE} ${ROT_WARP_IMAGE} -R ${ROT_REF_IMAGE} ${ROT_WARP} )
 #add_test(ANTS_ROT_SYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_REF_IMAGE} ${ROT_WARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt ${ROT_OUTPUT_PREFIX}metric.nii.gz 35.4473 0.5)
 #add_test(ANTS_ROT_SYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3 ${ROT_REF_IMAGE} ${ROT_INVERSEWARP_IMAGE} -R ${ROT_MOV_IMAGE} ${ROT_INVERSEWARP})
 #add_test(ANTS_ROT_SYN_INVERSEWARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_MOV_IMAGE} ${ROT_INVERSEWARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt ${OUTPUT_PREFIX}metric.nii.gz 34.8184 0.5)
 #add_test(ANTS_ROT_SYN_CLEAN rm ${ROT_WARP_FILES})
+
 add_test(ANTS_ROT_GSYN ${TEST_BINARY_DIR}/ANTS 3 -m
   MSQ[${ROT_REF_IMAGE},${ROT_MOV_IMAGE},1,0] -t SyN[0.25] -i 50x5x0 -r
   Gauss[3,0.0,32] -o ${ROT_OUTPUT_PREFIX}.nii.gz)
+
 add_test(ANTS_ROT_GSYN_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_MOV_IMAGE} ${ROT_WARP_IMAGE} -R ${ROT_REF_IMAGE} ${ROT_WARP} )
+
 add_test(ANTS_ROT_GSYN_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity
   3 0 ${ROT_REF_IMAGE} ${ROT_WARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${ROT_OUTPUT_PREFIX}metric.nii.gz 35.4473 0.5)
+
 add_test(ANTS_ROT_GSYN_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_REF_IMAGE} ${ROT_INVERSEWARP_IMAGE} -R ${ROT_MOV_IMAGE}
   ${ROT_INVERSEWARP})
+
 add_test(ANTS_ROT_GSYN_INVERSEWARP_METRIC_0
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_MOV_IMAGE}
   ${ROT_INVERSEWARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${OUTPUT_PREFIX}metric.nii.gz  34.8184 0.5)
+
 #add_test(ANTS_ROT_GSYN_CLEAN rm ${ROT_WARP_FILES})
+
 add_test(ANTS_ROT_EXP ${TEST_BINARY_DIR}/ANTS 3 -m
   MSQ[${ROT_REF_IMAGE},${ROT_MOV_IMAGE},1,0] -t Exp[3,2] -i 50x5x1 -r
   Gauss[3,0.0,32] -o ${ROT_OUTPUT_PREFIX}.nii.gz)
+
 add_test(ANTS_ROT_EXP_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_MOV_IMAGE} ${ROT_WARP_IMAGE} -R ${ROT_REF_IMAGE} ${ROT_WARP} )
+
 add_test(ANTS_ROT_EXP_WARP_METRIC_0 ${TEST_BINARY_DIR}/MeasureImageSimilarity 3
   0 ${ROT_REF_IMAGE} ${ROT_WARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${ROT_OUTPUT_PREFIX}metric.nii.gz 35.4473 0.5)
+
 add_test(ANTS_ROT_EXP_WARP2 ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_MOV_IMAGE} ${ROT_WARP_IMAGE} -R ${ROT_REF_IMAGE} --ANTS-prefix
   ${ROT_OUTPUT_PREFIX} )
+
 add_test(ANTS_ROT_EXP_WARP2_METRIC_0_2
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_REF_IMAGE}
   ${ROT_WARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${ROT_OUTPUT_PREFIX}metric.nii.gz 35.4473 0.5)
+
 add_test(ANTS_ROT_EXP_INVERSEWARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_REF_IMAGE} ${ROT_INVERSEWARP_IMAGE} -R ${ROT_MOV_IMAGE} ${ROT_INVERSEWARP})
+
 add_test(ANTS_ROT_EXP_INVERSEWARP_METRIC_0
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_MOV_IMAGE}
   ${ROT_INVERSEWARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${OUTPUT_PREFIX}metric.nii.gz  34.8184 0.5)
+
 add_test(ANTS_ROT_EXP_INVERSEWARP2 ${TEST_BINARY_DIR}/WarpImageMultiTransform 3
   ${ROT_REF_IMAGE} ${ROT_INVERSEWARP_IMAGE} -R ${ROT_MOV_IMAGE}
   --ANTS-prefix-invert ${ROT_OUTPUT_PREFIX})
+
 add_test(ANTS_ROT_EXP_INVERSEWARP2_METRIC_0_2
   ${TEST_BINARY_DIR}/MeasureImageSimilarity 3 0 ${ROT_MOV_IMAGE}
   ${ROT_INVERSEWARP_IMAGE} ${ROT_OUTPUT_PREFIX}log.txt
   ${OUTPUT_PREFIX}metric.nii.gz  34.8184 0.5)
+
 #add_test(ANTS_ROT_EXP_CLEAN rm ${ROT_WARP_FILES})
 ###
 #  Test SyN with time
 ###
 set(CHALF_IMAGE ${DATA_DIR}/chalf.nii.gz)
 set(C_IMAGE ${DATA_DIR}/c.nii.gz)
+
 add_test(ANTS_SYN_WITH_TIME ${TEST_BINARY_DIR}/ANTS 2 -m
   MSQ[${CHALF_IMAGE},${C_IMAGE},1,0.] -t SyN[1,10,0.05] -i 150x100x2x2 -r
   Gauss[0.5,0.1] -o ${OUTPUT_PREFIX} --geodesic 1 --number-of-affine-iterations 0)
+
 add_test(ANTS_SYN_WITH_TIME_WARP ${TEST_BINARY_DIR}/WarpImageMultiTransform 2
   ${C_IMAGE} ${OUTPUT_PREFIX}.nii.gz ${OUTPUT_PREFIX}Warp.nii.gz  -R
   ${CHALF_IMAGE} )
+
 add_test(ANTS_SYN_WITH_TIME_METRIC ${TEST_BINARY_DIR}/MeasureImageSimilarity 2
   0 ${CHALF_IMAGE} ${OUTPUT_PREFIX}.nii.gz ${OUTPUT_PREFIX}log.txt
   ${OUTPUT_PREFIX}metric.nii.gz  0.0943736 0.1)
@@ -460,6 +718,7 @@
 ##
 set(R16_MASK ${DATA_DIR}/r16mask.nii.gz)
 set(R16_PRIORS ${DATA_DIR}/r16priors.nii.gz)
+
 #add_test(APOC_OTSU_INIT ${TEST_BINARY_DIR}/Apocrita 2 -i otsu[${R16_IMAGE},3] -x ${R16_MASK} -n 10 -m [0.3,1x1,0.2,0.1] -o ${OUTPUT_PREFIX}.nii.gz )
 #add_test(APOC_OTSU_INIT_RADIUS_2x2 ${TEST_BINARY_DIR}/Apocrita 2 -i otsu[${R16_IMAGE},3] -x ${R16_MASK} -n 10 -m [0.3,2,0.2,0.1] -o ${OUTPUT_PREFIX}.nii.gz )
 #add_test(APOC_KMEANS_INIT ${TEST_BINARY_DIR}/Apocrita 2 -i kmeans[${R16_IMAGE},3] -x ${R16_MASK} -n 10 -m [0.3,1x1,0.2,0.1] -o [${OUTPUT_PREFIX}.nii.gz,${OUTPUT_PREFIX}_posteriors%d.nii.gz])


Dashboard script configurable with ctest command line using CTEST_SCRIPT_ARG

SCRIPT_MODE and GIT_TAG can be passed while invoking ctest from command
line using the following syntax:

 ctest -S /path/to/dashboard.cmake,<SCRIPT_MODE>\;<GIT_TAG>

For example:

 ctest -S /path/to/dashboard.cmake,continuous\;next

--- CMake/VisomicsDashboardScript.TEMPLATE.cmake
+++ CMake/VisomicsDashboardScript.TEMPLATE.cmake
@@ -18,6 +18,19 @@
 #
 # For additional information, see https://www.kitware.com/Omics/index.php/Main_Page#Dashboard_setup
 #
+
+#-----------------------------------------------------------------------------
+# Attempt to extract configuration passed from command line
+#-----------------------------------------------------------------------------
+# Note: The syntax to pass option from the command line while invoking ctest is
+#       the following: ctest -S /path/to/script.cmake,<SCRIPT_MODE>\;<GIT_TAG>
+#       where <SCRIPT_MODE> is either "experimental", "continuous" or "nightly"
+#       and <GIT_TAG> is either 'master' or 'next'
+if(NOT CTEST_SCRIPT_ARG STREQUAL "")
+  set(CTEST_SCRIPT_ARG_AS_LIST ${CTEST_SCRIPT_ARG})
+  list(GET CTEST_SCRIPT_ARG_AS_LIST 0 SCRIPT_MODE)
+  list(GET CTEST_SCRIPT_ARG_AS_LIST 1 GIT_TAG)
+endif()

 #-----------------------------------------------------------------------------
 # Dashboard properties


简化FindCheck.cmake

简化FindCheck.cmake

--- cmake/FindCheck.cmake
+++ cmake/FindCheck.cmake
@@ -27,29 +27,6 @@
 	PKG_SEARCH_MODULE( CHECK ${_pkgconfig_REQUIRED} check )
 ENDIF ( CHECK_MIN_VERSION )

-# Look for CHECK include dir and libraries
-IF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
-
-	FIND_PATH( CHECK_INCLUDE_DIRS check.h )
-
-	FIND_LIBRARY( CHECK_LIBRARIES NAMES check )
-
-	IF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
-		SET( CHECK_FOUND 1 )
-		IF ( NOT Check_FIND_QUIETLY )
-			MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" )
-		ENDIF ( NOT Check_FIND_QUIETLY )
-	ELSE ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
-		IF ( Check_FIND_REQUIRED )
-			MESSAGE( FATAL_ERROR "Could NOT find CHECK" )
-		ELSE ( Check_FIND_REQUIRED )
-			IF ( NOT Check_FIND_QUIETLY )
-				MESSAGE( STATUS "Could NOT find CHECK" )
-			ENDIF ( NOT Check_FIND_QUIETLY )
-		ENDIF ( Check_FIND_REQUIRED )
-	ENDIF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
-ENDIF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
-
 # Hide advanced variables from CMake GUIs
 MARK_AS_ADVANCED( CHECK_INCLUDE_DIRS CHECK_LIBRARIES )


FindClang: check if llvm already found instead of trying to find

--- cmake/FindClang.cmake
+++ cmake/FindClang.cmake
@@ -1,4 +1,6 @@
-find_package(LLVM REQUIRED)
+if(NOT LLVM_FOUND)
+	message(FATAL_ERROR "Must find LLVM before Clang")
+endif()

 if(NOT Clang_FIND_COMPONENTS)
 	message(FATAL_ERROR "Must specify which Clang components to find")


fix a bug

fix a bug

--- cmake/Functions.cmake
+++ cmake/Functions.cmake
@@ -87,7 +87,7 @@
 if (GPERFTOOLS_LIBRARY AND CMAKE_BUILD_TYPE)
   string(COMPARE NOTEQUAL ${CMAKE_BUILD_TYPE} "DEBUG" IS_RELEASE)
   if (${IS_RELEASE})
-    set (MEMPOOL_LIBRARY GPERFTOOLS_LIBRARY)
+    set (MEMPOOL_LIBRARY ${GPERFTOOLS_LIBRARY})
 	MESSAGE(STATUS "seting the MEMPOOL_LIBRARY to ${GPERFTOOLS_LIBRARY}")
   endif (${IS_RELEASE})
 endif (GPERFTOOLS_LIBRARY AND CMAKE_BUILD_TYPE)
@@ -264,4 +264,4 @@
   endforeach()
   set(${SRCS} ${${SRCS}} PARENT_SCOPE)
   set(${HDRS} ${${HDRS}} PARENT_SCOPE)
-endfunction()+endfunction()


Add configured files to their own group

Add configured files to their own group

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -70,6 +70,8 @@
   add_custom_target(configure-${name} ${all}
     DEPENDS "${dest}"
     SOURCES "${source}")
+  source_group("Configured Files"
+    FILES "${source}")
   add_dependencies(configure
     configure-${name})
 endfunction ()


msan requires -fPIE and -pie

msan requires -fPIE and -pie

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -87,7 +87,8 @@
         # set memory sanitizer
         elseif(NANOCV_WITH_MSAN)
                 if(COMPILER_SUPPORTS_SANITIZE_MEMORY)
-                        set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
+                        set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fPIE")
+                        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
                 endif()

         # set thread sanitizer


[ROCm] fix missing dcu kernel in operator.cmake, test=develop (#39480)

--- cmake/operators.cmake
+++ cmake/operators.cmake
@@ -335,6 +335,17 @@
         endif()
     endforeach()

+    # pybind USE_OP_DEVICE_KERNEL for ROCm
+    list (APPEND hip_srcs ${hip_cc_srcs})
+    # message("hip_srcs ${hip_srcs}")
+    foreach(hip_src ${hip_srcs})
+        set(op_name "")
+        find_register(${hip_src} "REGISTER_OP_CUDA_KERNEL" op_name)
+        if(NOT ${op_name} EQUAL "")
+            file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${op_name}, CUDA);\n")
+            set(pybind_flag 1)
+        endif()
+    endforeach()

     # pybind USE_OP_DEVICE_KERNEL for CUDNN/MIOPEN
     list(APPEND cudnn_cu_srcs ${cudnn_cu_cc_srcs})


CMake: Prefer Python 3.7 then 3.6 (#6057)

We are not currently ready for Python 3.8,
so we prefer either the newest 3.7 or 3.6.

--- cmake/utilities.cmake
+++ cmake/utilities.cmake
@@ -101,9 +101,17 @@

 function(findPythonExecutablePath)
   find_package(Python2 COMPONENTS Interpreter REQUIRED)
-  find_package(Python3 COMPONENTS Interpreter REQUIRED)
-
   set(EX_TOOL_PYTHON2_EXECUTABLE_PATH "${Python2_EXECUTABLE}" PARENT_SCOPE)
+
+  find_package(Python3 3.7 EXACT COMPONENTS Interpreter)
+
+  if(NOT Python3_FOUND)
+    find_package(Python3 3.6 EXACT COMPONENTS Interpreter)
+    if(NOT Python3_FOUND)
+      message(FATAL_ERROR "Could not find a suitable Python 3 version. Please install a version >= 3.6 but < 3.8")
+    endif()
+  endif()
+
   set(EX_TOOL_PYTHON3_EXECUTABLE_PATH "${Python3_EXECUTABLE}" PARENT_SCOPE)
 endfunction()


Fix error with dashboard

Fix error with dashboard

--- superbuild/Projects/unix/meshkit.cmake
+++ superbuild/Projects/unix/meshkit.cmake
@@ -1,10 +1,15 @@
 if(BUILD_WITH_CUBIT)

 message("Cubit meshkit")
+find_package(Autotools REQUIRED)
 add_external_project(meshkit
     BUILD_COMMAND "make -j5 install"
     INSTALL_COMMAND ""
-    CMAKE_ARGS
+    CMAKE_ARGS
+      -DAUTOHEADER_EXECUTABLE:path=${AUTOHEADER_EXECUTABLE}
+      -DAUTOM4TE_EXECUTABLE:path=${AUTOM4TE_EXECUTABLE}
+      -DAUTORECONF_EXECUTABLE:path=${AUTORECONF_EXECUTABLE}
+      -DAUTOUPDATE_EXECUTABLE:path=${AUTOUPDATE_EXECUTABLE}
       -DBUILD_WITH_CUBIT:BOOL=ON
       -DCMAKE_INSTALL_PREFIX:path=<INSTALL_DIR>/meshkitCubit
       -DCMAKE_PREFIX_PATH:path=<INSTALL_DIR>/meshkitCubit


[exotica] No optimisations by default

[exotica] No optimisations by default

--- exotica/cmake/Exotica.cmake
+++ exotica/cmake/Exotica.cmake
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 2.8.3)

 message(STATUS "Compiling using c++ 11 (required by EXOTica)")
-add_compile_options(-std=c++11 -O2)
+add_compile_options(-std=c++11)

 # MoveIt Core Robot Model isnt aligned :'(
-add_definitions(-DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_DONT_VECTORIZE)
+#add_definitions(-DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_DONT_VECTORIZE)


Changed SVN update command

Changed SVN update command

--- cmake/externals/configuration_steps/EP_AddCustomTargets.cmake
+++ cmake/externals/configuration_steps/EP_AddCustomTargets.cmake
@@ -8,7 +8,7 @@

 if(NOT ${tag} STREQUAL "")
   set(GIT_COMMAND git fetch ${url} && git checkout ${tag})
-  set(SVN_COMMAND svn checkout -r ${tag} ${url})
+  set(SVN_COMMAND svn switch ${url} && svn update -r ${tag})
 endif()


Use the 1.3.0 release tag for Tomviz

Use the 1.3.0 release tag for Tomviz

I don't see a simple way to switch the superbuild to use this tag, but
when tagging the superbuild this should hopefully make it easier to
build this version of Tomviz if this flag is turned on from the outside.

--- versions.cmake
+++ versions.cmake
@@ -98,7 +98,7 @@
   # Download tomviz from GIT
   add_customizable_revision(tomviz
     GIT_REPOSITORY https://github.com/openchemistry/tomviz.git
-    GIT_TAG "master")
+    GIT_TAG "1.3.0")
 else()
   if (tomviz_FROM_SOURCE_DIR)
     add_customizable_revision(tomviz


[Config] Fixed the delivery directory of Python modules and libraries

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -497,7 +497,7 @@

     # Set the Python installation directory
     set (INSTALL_PY_LIB_DIR
-      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
       CACHE PATH "Installation directory for Python libraries")

     # Update the list of include directories for the project
@@ -1461,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -34,6 +34,8 @@
 # Features of found Corrade library are exposed in these variables:
 #  CORRADE_GCC47_COMPATIBILITY  - Defined if compiled with compatibility
 #   mode for GCC 4.7
+#  CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility
+#   mode for MSVC 2015
 #  CORRADE_BUILD_DEPRECATED     - Defined if compiled with deprecated APIs
 #   included
 #  CORRADE_BUILD_STATIC         - Defined if compiled as static libraries
@@ -191,6 +193,7 @@
 file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
 set(_corradeFlags
     GCC47_COMPATIBILITY
+    MSVC2015_COMPATIBILITY
     BUILD_DEPRECATED
     BUILD_STATIC
     TARGET_UNIX


Install to unversioned docdir

Install to unversioned docdir

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -165,7 +165,7 @@
     unset (DOC_NEWS_FILE)
   endif (NOT EXISTS ${DOC_NEWS_FILE})
   set (BASICDOC_FILES AUTHORS ${DOC_NEWS_FILE} README ${DOC_INSTALL_FILE})
-  set (BASICDOC_PATH "share/doc/${PACKAGE}-${PACKAGE_VERSION}")
+  set (BASICDOC_PATH "share/doc/${PACKAGE}")

 endmacro (set_project_options)

@@ -2233,7 +2233,7 @@

   ##
   # Installation of the HTML documentation
-  set (DOC_PATH share/doc/${PROJECT_NAME}-${CPACK_PACKAGE_VERSION})
+  set (DOC_PATH share/doc/${PROJECT_NAME})
   # HTML pages
   install (DIRECTORY ${htmldoc_DIR} DESTINATION ${DOC_PATH})
   # PDF reference manual


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -124,8 +124,13 @@
 #
 # Test name is also executable name. You can also specify libraries to link
 # with instead of using :command:`target_link_libraries()`.
-# ``Corrade::TestSuite`` library is linked automatically to each test. Note
+# ``Corrade::TestSuite`` target is linked automatically to each test. Note
 # that the :command:`enable_testing()` function must be called explicitly.
+#
+# Unless :variable:`CORRADE_TESTSUITE_TARGET_XCTEST` is set, test cases on iOS
+# targets are created as bundles with bundle identifier set to CMake project
+# name by default. Use the cache variable :variable:`CORRADE_TESTSUITE_BUNDLE_IDENTIFIER_PREFIX`
+# to change it to something else.
 #
 # .. command:: corrade_add_resource
 #


[Build] Fixed a merge issue in the CMake configuration file.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -224,13 +224,7 @@
   #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)

   # Initialise the source package generator with the variables above
-=======
-    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD}")
-  #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)
-
-  # Initialise the source package generator with the variables above
   include (InstallRequiredSystemLibraries)
->>>>>>> trunk
   include (CPack)

   # Add a 'dist' target, similar to what is given by GNU Autotools


cleanup: avoid CMake warning-message markup (#6265)

CMake `message(WARNING "message to display")` uses a simple markup
language, where newlines in non-indented text are presumed to
delineate paragraphs that should be wrapped and separated. Avoid
that by adding a little indentation, so the text renders as a
single block.

--- super/ExternalProjectHelper.cmake
+++ super/ExternalProjectHelper.cmake
@@ -20,10 +20,10 @@
 message(
     WARNING
         [==[
-Super builds are no longer recommended, and will be removed on 2022-05-01
-or shortly after.  If you want to automatically download and build the
-`google-cloud-cpp` dependencies we recommend that you use `vcpkg` as
-described in /doc/contributor/howto-guide-setup-cmake-environment.md
+  Super builds are no longer recommended, and will be removed on 2022-05-01
+  or shortly after.  If you want to automatically download and build the
+  `google-cloud-cpp` dependencies we recommend that you use `vcpkg` as
+  described in /doc/contributor/howto-guide-setup-cmake-environment.md
 ]==])

 set(GOOGLE_CLOUD_CPP_EXTERNAL_PREFIX


Remove references to Intel-only Xeon Phi stuff

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -61,9 +61,6 @@
 #
 #   MKL_USE_STATIC_LIBS      - Set to ON to force the use of static libraries.
 #                              Default is OFF.
-#   MKL_XEON_PHI_USAGE_MODEL - Set to "none", "native", "automatic" or
-#                              "compiler" to select how the MKL is to use any
-#                              Xeon Phi coprocessors found.  Default is "none".
 #   MKL_INTERFACE            - Set to "lp64" or "ilp64" (case-insensitive) to
 #                              select 32-bit or 64-bit integer interface.
 #                              Default is blank on 32-bit platforms (where no
@@ -109,9 +106,6 @@
 # Set defaults
 if (NOT DEFINED MKL_USE_STATIC_LIBS)
   set(MKL_USE_STATIC_LIBS OFF)
-endif()
-if (NOT DEFINED MKL_XEON_PHI_USAGE_MODEL)
-  set(MKL_XEON_PHI_USAGE_MODEL none)
 endif()
 if (NOT DEFINED MKL_THREADING)
   set(MKL_THREADING OpenMP)


Change some names to reflect FFTW3 stuff

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -9,9 +9,9 @@
     set(HINT_DIRS ${MKL_DIRECTORY} $ENV{MKL_PATH}/include)
   endif(EXISTS $ENV{MKL_PATH})
   find_path(MKL_INCLUDE_DIRS NAMES mkl_dfti.h HINTS ${HINT_DIRS} ${MKL_INCLUDE_DIRS})
-
+
   if(DEFINED ENV{MKL_LINK_LINE})
-    set(MKL_LIBRARIES "$ENV{MKL_LINK_LINE}")
+    set(MKL_LIBRARIES "$ENV{MKL_LINK_LINE}")
   elseif(NOT "$ENV{BLASDIR}" STREQUAL "" AND NOT "$ENV{BLASLIB}" STREQUAL "")
     set(MKL_LIBRARIES "-L$ENV{BLASDIR} -l$ENV{BLASLIB}")
   endif()
@@ -24,8 +24,8 @@
   # if all listed variables are TRUE
   find_package_handle_standard_args(MKL  DEFAULT_MSG MKL_LIBRARIES MKL_INCLUDE_DIRS)

-  mark_as_advanced(MKL_INCLUDE_DIRS MKL_LIBRARY)
-  set(MKL_HAS_SINGLE TRUE)
-  set(MKL_HAS_DOUBLE TRUE)
-  set(MKL_HAS_LONG_DOUBLE FALSE)
+  mark_as_advanced(MKL_INCLUDE_DIRS MKL_LIBRARIES)
+  set(MKL_SINGLE_FOUND TRUE)
+  set(MKL_DOUBLE_FOUND TRUE)
+  set(MKL_LONGDOUBLE_FOUND FALSE)
 endif(NOT MKL_FOUND)


适配新版本的lua构建脚本

适配新版本的lua构建脚本

--- src/log/log_configure.cmake
+++ src/log/log_configure.cmake
@@ -2,17 +2,37 @@
 # Lua模块
 if (LOG_WRAPPER_ENABLE_LUA_SUPPORT)
     if (LOG_WRAPPER_CHECK_LUA)
-        if (TARGET lua)
-            list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB lua)
+        if(BUILD_SHARED_LIBS OR ATFRAMEWORK_USE_DYNAMIC_LIBRARY)
+            if (TARGET lua::liblua-dynamic)
+                list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB lua::liblua-dynamic)
+            elseif (TARGET lua)
+                list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB lua)
+            else ()
+                find_package(Lua)
+                if (LUA_FOUND)
+                    list(APPEND PROJECT_ATFRAME_UTILS_PUBLIC_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
+                    list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB ${LUA_LIBRARIES})
+                    message(STATUS "Lua support enabled.(lua ${LUA_VERSION_STRING} detected)")
+                else()
+                    set(LOG_WRAPPER_ENABLE_LUA_SUPPORT OFF)
+                    message(STATUS "Lua not found and disabled.")
+                endif()
+            endif()
         else ()
-            find_package(Lua)
-            if (LUA_FOUND)
-                list(APPEND PROJECT_ATFRAME_UTILS_PUBLIC_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
-                list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB ${LUA_LIBRARIES})
-                message(STATUS "Lua support enabled.(lua ${LUA_VERSION_STRING} detected)")
-            else()
-                set(LOG_WRAPPER_ENABLE_LUA_SUPPORT OFF)
-                message(STATUS "Lua not found and disabled.")
+            if (TARGET lua::liblua-static)
+                list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB lua::liblua-static)
+            elseif (TARGET lua)
+                list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB lua)
+            else ()
+                find_package(Lua)
+                if (LUA_FOUND)
+                    list(APPEND PROJECT_ATFRAME_UTILS_PUBLIC_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
+                    list(APPEND PROJECT_ATFRAME_UTILS_EXTENTION_LINK_LIB ${LUA_LIBRARIES})
+                    message(STATUS "Lua support enabled.(lua ${LUA_VERSION_STRING} detected)")
+                else()
+                    set(LOG_WRAPPER_ENABLE_LUA_SUPPORT OFF)
+                    message(STATUS "Lua not found and disabled.")
+                endif()
             endif()
         endif()
     endif()


pybind11 CMake module refactor (#1002)

pybind11 CMake module refactor (#1002)

* Add version detection to pybind11 CMake module

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

* Prioritize location override

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

* Fix missing Python package case

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

* Clean up messaging; require PythonInterp when needed

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

* Move Python fallback to condition

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

* Add header version detection

Signed-off-by: Michael Dolan <688080ba093bba32b8050b0536b1c7a964e2656e@gmail.com>

--- share/cmake/modules/Findpybind11.cmake
+++ share/cmake/modules/Findpybind11.cmake
@@ -3,6 +3,7 @@
 # Variables defined by this module:
 #   pybind11_FOUND - If FALSE, do not try to link to pybind11
 #   pybind11_INCLUDE_DIR - Where to find pybind11.h
+#   pybind11_VERSION - The version of the library
 #
 # Targets defined by this module:
 #   pybind11::module - IMPORTED target, if found
@@ -22,28 +23,101 @@
 ### Try to find package ###

 if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
-    set(_pybind11_SEARCH_DIRS
-        ${pybind11_DIRS}
-        ~/Library/Frameworks
-        /Library/Frameworks
-        /usr/local
-        /usr
-        /sw        # Fink
-        /opt/local # DarwinPorts
-        /opt/csw   # Blastwave
-        /opt
-    )
+    if(DEFINED pybind11_DIRS)
+        # Try user defined search path first. Ignore all default cmake and
+        # system paths, and fall back on a system CMake config.
+        find_path(pybind11_INCLUDE_DIR
+            NAMES
+                pybind11/pybind11.h
+            HINTS
+                ${pybind11_DIRS}
+            PATH_SUFFIXES
+                include
+                pybind11/include
+            NO_DEFAULT_PATH
+        )

-    # Find include directory
-    find_path(pybind11_INCLUDE_DIR
-        NAMES
-            pybind11/pybind11.h
-        HINTS
-            ${_pybind11_SEARCH_DIRS}
-        PATH_SUFFIXES
-            include
-            pybind11/include
-    )
+        # Version information can be extracted from this header
+        set(_pybind11_COMMON_H "${pybind11_INCLUDE_DIR}/pybind11/detail/common.h")
+
+        if(EXISTS "${_pybind11_COMMON_H}")
+            file(STRINGS "${_pybind11_COMMON_H}" _pybind11_VER_SEARCH
+                REGEX "^[ \t]*#define[ \t]+PYBIND11_VERSION_(MAJOR|MINOR|PATCH)[ \t]+([0-9]+).*$")
+
+            if(_pybind11_VER_SEARCH)
+                string(REGEX REPLACE ".*MAJOR[ \t]+([0-9]+).*"
+                    "\\1" _pybind11_MAJOR "${_pybind11_VER_SEARCH}")
+                string(REGEX REPLACE ".*MINOR[ \t]+([0-9]+).*"
+                    "\\1" _pybind11_MINOR "${_pybind11_VER_SEARCH}")
+                string(REGEX REPLACE ".*PATCH[ \t]+([0-9]+).*"
+                    "\\1" _pybind11_PATCH "${_pybind11_VER_SEARCH}")
+
+                set(pybind11_VERSION "${_pybind11_MAJOR}.${_pybind11_MINOR}.${_pybind11_PATCH}")
+                message(STATUS
+                    "Using user defined search path for pybind11 "
+                    "(found version \"${pybind11_VERSION}\")"
+                )
+            endif()
+        endif()
+    endif()
+
+    if(NOT DEFINED pybind11_VERSION)
+        # Search for a CMake config, which should have been installed with
+        # pybind11, and will provide version information.
+        find_package(pybind11 ${pybind11_FIND_VERSION} CONFIG)
+
+        if(NOT pybind11_FOUND)
+            # No CMake config found. Check if pybind11 was installed as a
+            # Python package (i.e. with "pip install pybind11"). This requires
+            # a Python interpreter.
+            find_package(PythonInterp 2.7 QUIET)
+
+            if(PYTHONINTERP_FOUND)
+                execute_process(
+                    COMMAND
+                        "${PYTHON_EXECUTABLE}" -c
+                        "print(__import__('pybind11').__version__)"
+                    RESULTS_VARIABLE
+                        _pybind11_VER_RESULTS
+                    OUTPUT_VARIABLE
+                        _pybind11_VER_OUTPUT
+                    ERROR_QUIET
+                )
+                if(_pybind11_VER_OUTPUT)
+                    # Strip \n from python output
+                    string(STRIP ${_pybind11_VER_OUTPUT} _pybind11_VER_OUTPUT)
+                endif()
+
+                if(_pybind11_VER_RESULTS EQUAL 0 AND "${_pybind11_VER_OUTPUT}" MATCHES "[.0-9]+")
+                    execute_process(
+                        COMMAND
+                            "${PYTHON_EXECUTABLE}" -c
+                            "import os;\
+                             import pybind11;\
+                             print(os.path.join(os.path.dirname(pybind11.__file__), 'include'))"
+                        RESULTS_VARIABLE
+                            _pybind11_DIR_RESULTS
+                        OUTPUT_VARIABLE
+                            _pybind11_DIR_OUTPUT
+                        ERROR_QUIET
+                    )
+                    if(_pybind11_DIR_OUTPUT)
+                        # Strip \n from python output
+                        string(STRIP ${_pybind11_DIR_OUTPUT} _pybind11_DIR_OUTPUT)
+                    endif()
+
+                    if(_pybind11_DIR_RESULTS EQUAL 0 AND EXISTS "${_pybind11_DIR_OUTPUT}")
+                        set(pybind11_VERSION ${_pybind11_VER_OUTPUT})
+                        set(pybind11_INCLUDE_DIR ${_pybind11_DIR_OUTPUT})
+                        message(STATUS
+                            "Using pybind11 python package (version \"${pybind11_VERSION}\", "
+                            "found in python \"${PYTHON_VERSION_STRING}\")"
+                        )
+                    endif()
+                endif()
+            endif()
+        endif()
+    endif()

     # Override REQUIRED if package can be installed
     if(OCIO_INSTALL_EXT_PACKAGES STREQUAL MISSING)
@@ -54,6 +128,8 @@
     find_package_handle_standard_args(pybind11
         REQUIRED_VARS
             pybind11_INCLUDE_DIR
+        VERSION_VAR
+            pybind11_VERSION
     )
 endif()


Disable TSan on Ubuntu.

Disable TSan on Ubuntu.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -364,11 +364,9 @@
 if(CC_NAME STREQUAL "gcc")
     if(CC_VERSION VERSION_GREATER 5 OR CC_VERSION VERSION_EQUAL 5)
         if(CC_TSAN GREATER 0)
-            set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
-            set(CI_UBUNTU 0)
             execute_process(COMMAND cat /etc/os-release COMMAND grep -c Ubuntu OUTPUT_VARIABLE CI_UBUNTU )
-            if(CI_UBUNTU GREATER 0)
-                set(CC_TSAN_FLAGS "-static-libtsan")
+            if(CI_UBUNTU EQUAL 0)
+                set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
             endif()
         endif()
     endif()


Removed dead code from Catkin CMake file.

--- catkin.cmake
+++ catkin.cmake
@@ -24,11 +24,6 @@

 # Generate the OMPL planner wrappers.
 file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src")
-
-execute_process(COMMAND pkg-config ompl --modversion
-    OUTPUT_VARIABLE OMPL_VERSION
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-)

 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
     MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/planners.yaml"


Updated common.cmake

Updated common.cmake

--- common.cmake
+++ common.cmake
@@ -25,7 +25,7 @@
 include(CheckCXXCompilerFlag)
 include(CheckCCompilerFlag)

-## check_variable_name(function_name var_names... [USED used_var_names...])
+## check_variable_name(function_name var_names... USED used_var_names...)
 # Check if variables passed to a function don't have names conflicts with variables used in the function.
 # Generate a fatal error on variable name conflict.
 #   {value} [in] function_name:    Function name
@@ -855,15 +855,18 @@
 	set_target_properties(${target} PROPERTIES FOLDER ${group})
 endfunction()

-## configure_folder(input_folder output_folder)
-# Recursively copie all files from an input folder to an output folder
+## configure_folder(input_folder output_folder [args...])
+# Recursively copy all files from an input folder to an output folder
+# Copy is made with CMake configure_file(), see documentation for more information:
+# https://cmake.org/cmake/help/latest/command/configure_file.html
 #   {value} [in] input_folder:    Input folder
 #   {value} [in] output_folder:   Output folder
+#   {value} [in] args:            CMake configure_file() additional arguments
 function(configure_folder input_folder output_folder)
-	file(GLOB_RECURSE files "${input_folder}" "${input_folder}/*")
+	file(GLOB_RECURSE files "${input_folder}/*")
 	foreach(file ${files})
 		file(RELATIVE_PATH relative_file ${input_folder} ${file})
-		configure_file(${file} "${output_folder}/${relative_file}" COPYONLY)
+		configure_file(${file} "${output_folder}/${relative_file}" ${ARGN})
 	endforeach()
 endfunction()

@@ -881,12 +884,14 @@
 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

 # place generated binaries in build/bin
+file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/build/bin)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/bin)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/build/bin/)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/build/bin/)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/build/bin/)

 # place generated libs in build/lib
+file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/build/lib/)


add O3 for LTO mode

add O3 for LTO mode

using -flto without specifying which optimization we want does not
behave as expected

--- backends/cmake/arm-none-eabi-gcc.cmake
+++ backends/cmake/arm-none-eabi-gcc.cmake
@@ -55,8 +55,8 @@
 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto")
 SET(CMAKE_ASM_FLAGS_RELEASE "")

-SET(CMAKE_CXX_LINK_FLAGS "${MCFLAGS} -T${LDSCRIPT} -Wl,--gc-sections --specs=nano.specs -flto")
-SET(CMAKE_C_LINK_FLAGS "${MCFLAGS} -T${LDSCRIPT} -Wl,--gc-sections --specs=nano.specs -flto")
+SET(CMAKE_CXX_LINK_FLAGS "${MCFLAGS} -T${LDSCRIPT} -Wl,--gc-sections --specs=nano.specs -O3 -flto")
+SET(CMAKE_C_LINK_FLAGS "${MCFLAGS} -T${LDSCRIPT} -Wl,--gc-sections --specs=nano.specs -O3 -flto")

 SET(CMAKE_CROSSCOMPILING TRUE)


cmake/Options: we should use seperate options for every module

this will make the handling inside and outside of cmake muche asier


boards: shields: add shield directories to SHIELD_DIRS

Keep a list of shield directories for use in other parts of the build
system.

Signed-off-by: Henrik Brix Andersen <24a3f13c22635bab658e39fc5f1e63c575328aae@vestas.com>

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -341,6 +341,11 @@
       list(APPEND
         shield_dts_fixups
         ${SHIELD_DIR_${s}}/dts_fixup.h
+        )
+
+      list(APPEND
+        SHIELD_DIRS
+        ${SHIELD_DIR_${s}}
         )

       # search for shield/shield.conf file


Upgrade oneDNN to v2.4.4 (#36226)

Upgrade oneDNN to v2.4.4 (#36226)

* upgrade oneDNN to v2.4-rc

* Removed failing test

* Revert "Removed failing test"

This reverts commit 60e70e717fac2c86b7beb24dfa1343a5804ea455.

* Remove most tests for debugging purposes

* Update hash to oneDNN 2.4

* Revert test change

* Update oneDNN to 2.4.2

* Update oneDNN to 2.4.3

* Change oneDNN version to 2.3 for Jenkins test

* Revert "Change oneDNN version to 2.3 for Jenkins test"

This reverts commit 0b176defc3b63f65dd0ba85873a018534f287000.

* Update oneDNN to 2.4.4

* Change version of oneDNN to 2.3 for new Jenkins test

* Revert "Change version of oneDNN to 2.3 for new Jenkins test"

This reverts commit e005a0f78f2b41cdcf4d7de3a21df7f910b78268.

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -20,7 +20,7 @@
 SET(MKLDNN_INSTALL_DIR    ${THIRD_PARTY_PATH}/install/mkldnn)
 SET(MKLDNN_INC_DIR        "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE)
 SET(MKLDNN_REPOSITORY     ${GIT_URL}/oneapi-src/oneDNN.git)
-SET(MKLDNN_TAG            e2d45252ae9c3e91671339579e3c0f0061f81d49)
+SET(MKLDNN_TAG            145c4b50196ac90ec1b946fb80cb5cef6e7d2d35)

 # Introduce variables:


Fix missing libraries when library versioning is enabled. (#2617)

* Copy and install all mkldnn libraries if versioning is enabled on linux.

* Replace magic numbers with variables.

* Support mkl-dnn library versioning on macos.

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -17,6 +17,8 @@
 include(ExternalProject)

 # Includes blas 3.8.0 in mkldnn
+set(NGRAPH_MKLDNN_SHORT_VERSION 0)
+set(NGRAPH_MKLDNN_FULL_VERSION 0.18.0.0)
 set(NGRAPH_MKLDNN_VERSION "v0.18")
 set(NGRAPH_MKLDNN_SUB_VERSION "2019.0.3.20190220")
 set(NGRAPH_MKLDNN_GIT_TAG "v0.18")
@@ -29,9 +31,13 @@
 if (LINUX)
     set(MKLML_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(OMP_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}iomp5${CMAKE_SHARED_LIBRARY_SUFFIX})
+    set(MKLDNN_SHORT_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mkldnn${CMAKE_SHARED_LIBRARY_SUFFIX}.${NGRAPH_MKLDNN_SHORT_VERSION})
+    set(MKLDNN_FULL_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mkldnn${CMAKE_SHARED_LIBRARY_SUFFIX}.${NGRAPH_MKLDNN_FULL_VERSION})
 elseif (APPLE)
     set(MKLML_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mklml${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(OMP_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}iomp5${CMAKE_SHARED_LIBRARY_SUFFIX})
+    set(MKLDNN_SHORT_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mkldnn.${NGRAPH_MKLDNN_SHORT_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
+    set(MKLDNN_FULL_LIB ${CMAKE_SHARED_LIBRARY_PREFIX}mkldnn.${NGRAPH_MKLDNN_FULL_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
 elseif (WIN32)
     set(MKLDNN_IMPLIB mkldnn${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(MKLML_LIB mklml${CMAKE_SHARED_LIBRARY_SUFFIX})
@@ -268,6 +274,16 @@
         COMMENT "Copy mkldnn runtime libraries to ngraph build directory."
         DEPENDEES install
         )
+    if(NGRAPH_LIB_VERSIONING_ENABLE)
+        ExternalProject_Add_Step(
+            ext_mkldnn
+            CopyMKLDNNEXTRA
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${EXTERNAL_PROJECTS_ROOT}/mkldnn/${CMAKE_INSTALL_LIBDIR}/${MKLDNN_SHORT_LIB} ${NGRAPH_LIBRARY_OUTPUT_DIRECTORY}/${MKLDNN_SHORT_LIB}
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${EXTERNAL_PROJECTS_ROOT}/mkldnn/${CMAKE_INSTALL_LIBDIR}/${MKLDNN_FULL_LIB} ${NGRAPH_LIBRARY_OUTPUT_DIRECTORY}/${MKLDNN_FULL_LIB}
+            COMMENT "Copy extra mkldnn runtime libraries to ngraph build directory."
+            DEPENDEES install
+           )
+    endif()
 endif()

 ExternalProject_Add_Step(
@@ -316,4 +332,14 @@
             ${NGRAPH_INSTALL_LIB}
         OPTIONAL
         )
-endif()
+    if(NGRAPH_LIB_VERSIONING_ENABLE)
+        install(
+            FILES
+            ${NGRAPH_LIBRARY_OUTPUT_DIRECTORY}/${MKLDNN_SHORT_LIB}
+            ${NGRAPH_LIBRARY_OUTPUT_DIRECTORY}/${MKLDNN_FULL_LIB}
+            DESTINATION
+                ${NGRAPH_INSTALL_LIB}
+            OPTIONAL
+            )
+    endif()
+endif()


[cmake] Pass -O3 when linking.

[cmake] Pass -O3 when linking.

Gold and bfd ld enable misc optimizations. lld ignores the option for now.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@221097 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -142,7 +142,14 @@
   set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)
 endfunction(add_llvm_symbol_exports)

-function(add_dead_strip target_name)
+function(add_link_opts target_name)
+  # Pass -O3 to the linker. This enabled different optimizations on different
+  # linkers.
+  if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32))
+    set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                 LINK_FLAGS " -Wl,-O3")
+  endif()
+
   if(NOT LLVM_NO_DEAD_STRIP)
     if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
       # ld64's implementation of -dead_strip breaks tools that use plugins.
@@ -157,7 +164,7 @@
                    LINK_FLAGS " -Wl,--gc-sections")
     endif()
   endif()
-endfunction(add_dead_strip)
+endfunction(add_link_opts)

 # Set each output directory according to ${CMAKE_CONFIGURATION_TYPES}.
 # Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more,
@@ -287,7 +294,7 @@
   endif()
   set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
   llvm_update_compile_flags(${name})
-  add_dead_strip( ${name} )
+  add_link_opts( ${name} )
   if(ARG_OUTPUT_NAME)
     set_target_properties(${name}
       PROPERTIES
@@ -445,7 +452,7 @@
     add_executable(${name} ${ALL_FILES})
   endif()
   llvm_update_compile_flags(${name})
-  add_dead_strip( ${name} )
+  add_link_opts( ${name} )

   # Do not add -Dname_EXPORTS to the command-line when building files in this
   # target. Doing so is actively harmful for the modules build because it


[CMake] Enable autolinking when compiling llbuildSwift

This will let clients avoid passing -l flag when they import
llbuildSwift.

--- cmake/modules/Utility.cmake
+++ cmake/modules/Utility.cmake
@@ -167,6 +167,10 @@
   foreach(arg ${additional_args})
     list(APPEND ARGS ${arg})
   endforeach()
+
+  # Enable autolinking so clients that import this library automatically get the
+  # -l<library-name> flag.
+  list(APPEND ARGS -module-link-name ${name})

   if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     list(APPEND ARGS -sdk ${CMAKE_OSX_SYSROOT})


Fixing unix build

Fixing unix build

--- tools/cmake/ANHPythonBinding.cmake
+++ tools/cmake/ANHPythonBinding.cmake
@@ -104,17 +104,20 @@

     if(WIN32)
         set(BINDING_POSTFIX .pyd)
+		set(BINDING_PREFIX ../)
     else()
         set(BINDING_POSTFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+		set(BINDING_PREFIX swgpy/${base_name}/)
     endif()

     # Create the Common library
-    ADD_LIBRARY(${name} SHARED ${ANHPYTHONLIB_SOURCES})
+	ADD_LIBRARY(${name} SHARED ${ANHPYTHONLIB_SOURCES})
 	SET_TARGET_PROPERTIES(${name}
 		PROPERTIES OUTPUT_NAME py_${base_name}
+		LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
 		RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release/swgpy/${base_name}
 		RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/swgpy/${base_name}
-		PREFIX "../"
+		PREFIX "${BINDING_PREFIX}"
 		SUFFIX "${BINDING_POSTFIX}"
     )