Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix mattes metric with sse instructions #1762

Conversation

hjmjohnson
Copy link
Member

This may be a compiler bug with clang and using SSE instructions with floating point exceptions, but cleaning up the code avoids the bug altogether.

Inspection of the assembly code indicated that the loop was being unrolled, and SSE instructions used to do division. The second division (which was never used due to a "continue" statement in the loop when the second denominator was zero) caused a floating point exception to be thrown on the otherwise unused value.

The code review subsequently identified several places that could be simplified, increase the likelihood of using parallelization or vectorization, and removed redundant code.

PR Checklist

Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, some in-line remarks.

When the pointer to the local variable persists outside of
the local function.  When the local variable goes out of
scope the mutable class variable should be set to nullptr.
Pre-compute commmon logFixedImagePDFValue outside of inner loop.
Multiplication is more efficient than division, so
use multiply by reciprical to make 1 division.
Replace 'if(! condition) {continue;}' with 'if( condition ) { large block of code }'
to remove early loop termination.
Use alias variable names that more clearly document what the intent
of the workspace ivars that are re-used memory this stage of the processing.
The Per-thread arrays of array accumulators have been reduced into thread 0
at this point, and will be normalized into PDF values by dividing by the total
mass of the joint accumulator PDF.

Also move exception checking for pre-existing states to the top of the function call
( there is no need to do computations before checking for pre-state exception cases).
Simplify computations avoiding duplicate work to compute same
value for totalMassOfPDF that is already available from this->m_JointPDFSum.

This also allows for simplifying loops and the use of std::for_each transforms

Avoid unnecessary indexing by looping over vectors with range-based loops.
A dummy value is used in the case where the log computation is not used
and would otherwise be invalid so that the log() can be precomputed
outside the looping structure.
@hjmjohnson hjmjohnson self-assigned this Apr 10, 2020
@hjmjohnson hjmjohnson force-pushed the fix-mattes-metric-sse-instructions branch from f9347a4 to fc63ed3 Compare April 10, 2020 23:01
@hjmjohnson
Copy link
Member Author

NOTE: ANTS and BRAINSTools (both use this filter extensively) pass all regression tests.

➜ ANTs-RelWithDebInfo-build ctest
Test project /Users/johnsonhj/src/BRAINSTools-sysclang-RelWithDebInfo/ANTs-RelWithDebInfo-build
Start 1: ANTS_HELP_LONG
1/130 Test #1: ANTS_HELP_LONG .................................................. Passed 0.03 sec
Start 2: ANTS_HELP_SHORT
2/130 Test #2: ANTS_HELP_SHORT ................................................. Passed 0.03 sec
Start 3: antsApplyTransforms_HELP_LONG
3/130 Test #3: antsApplyTransforms_HELP_LONG ................................... Passed 0.03 sec
Start 4: antsApplyTransforms_HELP_SHORT
4/130 Test #4: antsApplyTransforms_HELP_SHORT .................................. Passed 0.03 sec
Start 5: antsApplyTransformsToPoints_HELP_LONG
5/130 Test #5: antsApplyTransformsToPoints_HELP_LONG ........................... Passed 0.03 sec
Start 6: antsApplyTransformsToPoints_HELP_SHORT
6/130 Test #6: antsApplyTransformsToPoints_HELP_SHORT .......................... Passed 0.03 sec
Start 7: ANTSIntegrateVectorField_HELP_LONG
7/130 Test #7: ANTSIntegrateVectorField_HELP_LONG .............................. Passed 0.03 sec
Start 8: ANTSIntegrateVectorField_HELP_SHORT
8/130 Test #8: ANTSIntegrateVectorField_HELP_SHORT ............................. Passed 0.03 sec
Start 9: ANTSIntegrateVelocityField_HELP_LONG
9/130 Test #9: ANTSIntegrateVelocityField_HELP_LONG ............................ Passed 0.03 sec
Start 10: ANTSIntegrateVelocityField_HELP_SHORT
10/130 Test #10: ANTSIntegrateVelocityField_HELP_SHORT ........................... Passed 0.03 sec
Start 11: ANTSJacobian_HELP_LONG
11/130 Test #11: ANTSJacobian_HELP_LONG .......................................... Passed 0.02 sec
Start 12: ANTSJacobian_HELP_SHORT
12/130 Test #12: ANTSJacobian_HELP_SHORT ......................................... Passed 0.03 sec
Start 13: antsMotionCorr_HELP_LONG
13/130 Test #13: antsMotionCorr_HELP_LONG ........................................ Passed 0.09 sec
Start 14: antsMotionCorr_HELP_SHORT
14/130 Test #14: antsMotionCorr_HELP_SHORT ....................................... Passed 0.03 sec
Start 15: antsRegistration_HELP_LONG
15/130 Test #15: antsRegistration_HELP_LONG ...................................... Passed 0.03 sec
Start 16: antsRegistration_HELP_SHORT
16/130 Test #16: antsRegistration_HELP_SHORT ..................................... Passed 0.03 sec
Start 17: ANTSUseDeformationFieldToGetAffineTransform_HELP_LONG
17/130 Test #17: ANTSUseDeformationFieldToGetAffineTransform_HELP_LONG ........... Passed 0.08 sec
Start 18: ANTSUseDeformationFieldToGetAffineTransform_HELP_SHORT
18/130 Test #18: ANTSUseDeformationFieldToGetAffineTransform_HELP_SHORT .......... Passed 0.03 sec
Start 19: ANTSUseLandmarkImagesToGetAffineTransform_HELP_LONG
19/130 Test #19: ANTSUseLandmarkImagesToGetAffineTransform_HELP_LONG ............. Passed 0.03 sec
Start 20: ANTSUseLandmarkImagesToGetAffineTransform_HELP_SHORT
20/130 Test #20: ANTSUseLandmarkImagesToGetAffineTransform_HELP_SHORT ............ Passed 0.03 sec
Start 21: ANTSUseLandmarkImagesToGetBSplineDisplacementField_HELP_LONG
21/130 Test #21: ANTSUseLandmarkImagesToGetBSplineDisplacementField_HELP_LONG .... Passed 0.03 sec
Start 22: ANTSUseLandmarkImagesToGetBSplineDisplacementField_HELP_SHORT
22/130 Test #22: ANTSUseLandmarkImagesToGetBSplineDisplacementField_HELP_SHORT ... Passed 0.03 sec
Start 23: Atropos_HELP_LONG
23/130 Test #23: Atropos_HELP_LONG ............................................... Passed 0.09 sec
Start 24: Atropos_HELP_SHORT
24/130 Test #24: Atropos_HELP_SHORT .............................................. Passed 0.03 sec
Start 25: AverageAffineTransform_HELP_LONG
25/130 Test #25: AverageAffineTransform_HELP_LONG ................................ Passed 0.03 sec
Start 26: AverageAffineTransform_HELP_SHORT
26/130 Test #26: AverageAffineTransform_HELP_SHORT ............................... Passed 0.03 sec
Start 27: AverageImages_HELP_LONG
27/130 Test #27: AverageImages_HELP_LONG ......................................... Passed 0.03 sec
Start 28: AverageImages_HELP_SHORT
28/130 Test #28: AverageImages_HELP_SHORT ........................................ Passed 0.02 sec
Start 29: AverageTensorImages_HELP_LONG
29/130 Test #29: AverageTensorImages_HELP_LONG ................................... Passed 0.08 sec
Start 30: AverageTensorImages_HELP_SHORT
30/130 Test #30: AverageTensorImages_HELP_SHORT .................................. Passed 0.02 sec
Start 31: ClusterImageStatistics_HELP_LONG
31/130 Test #31: ClusterImageStatistics_HELP_LONG ................................ Passed 0.02 sec
Start 32: ClusterImageStatistics_HELP_SHORT
32/130 Test #32: ClusterImageStatistics_HELP_SHORT ............................... Passed 0.03 sec
Start 33: ComposeMultiTransform_HELP_LONG
33/130 Test #33: ComposeMultiTransform_HELP_LONG ................................. Passed 0.09 sec
Start 34: ComposeMultiTransform_HELP_SHORT
34/130 Test #34: ComposeMultiTransform_HELP_SHORT ................................ Passed 0.03 sec
Start 35: CompositeTransformUtil_HELP_LONG
35/130 Test #35: CompositeTransformUtil_HELP_LONG ................................ Passed 0.03 sec
Start 36: CompositeTransformUtil_HELP_SHORT
36/130 Test #36: CompositeTransformUtil_HELP_SHORT ............................... Passed 0.03 sec
Start 37: ConvertImagePixelType_HELP_LONG
37/130 Test #37: ConvertImagePixelType_HELP_LONG ................................. Passed 0.03 sec
Start 38: ConvertImagePixelType_HELP_SHORT
38/130 Test #38: ConvertImagePixelType_HELP_SHORT ................................ Passed 0.03 sec
Start 39: ConvertScalarImageToRGB_HELP_LONG
39/130 Test #39: ConvertScalarImageToRGB_HELP_LONG ............................... Passed 0.03 sec
Start 40: ConvertScalarImageToRGB_HELP_SHORT
40/130 Test #40: ConvertScalarImageToRGB_HELP_SHORT .............................. Passed 0.03 sec
Start 41: ConvertToJpg_HELP_LONG
41/130 Test #41: ConvertToJpg_HELP_LONG .......................................... Passed 0.03 sec
Start 42: ConvertToJpg_HELP_SHORT
42/130 Test #42: ConvertToJpg_HELP_SHORT ......................................... Passed 0.03 sec
Start 43: CopyImageHeaderInformation_HELP_LONG
43/130 Test #43: CopyImageHeaderInformation_HELP_LONG ............................ Passed 0.03 sec
Start 44: CopyImageHeaderInformation_HELP_SHORT
44/130 Test #44: CopyImageHeaderInformation_HELP_SHORT ........................... Passed 0.02 sec
Start 45: CreateDisplacementField_HELP_LONG
45/130 Test #45: CreateDisplacementField_HELP_LONG ............................... Passed 0.02 sec
Start 46: CreateDisplacementField_HELP_SHORT
46/130 Test #46: CreateDisplacementField_HELP_SHORT .............................. Passed 0.02 sec
Start 47: CreateDTICohort_HELP_LONG
47/130 Test #47: CreateDTICohort_HELP_LONG ....................................... Passed 0.03 sec
Start 48: CreateDTICohort_HELP_SHORT
48/130 Test #48: CreateDTICohort_HELP_SHORT ...................................... Passed 0.03 sec
Start 49: CreateImage_HELP_LONG
49/130 Test #49: CreateImage_HELP_LONG ........................................... Passed 0.03 sec
Start 50: CreateImage_HELP_SHORT
50/130 Test #50: CreateImage_HELP_SHORT .......................................... Passed 0.02 sec
Start 51: CreateWarpedGridImage_HELP_LONG
51/130 Test #51: CreateWarpedGridImage_HELP_LONG ................................. Passed 0.03 sec
Start 52: CreateWarpedGridImage_HELP_SHORT
52/130 Test #52: CreateWarpedGridImage_HELP_SHORT ................................ Passed 0.03 sec
Start 53: ExtractRegionFromImage_HELP_LONG
53/130 Test #53: ExtractRegionFromImage_HELP_LONG ................................ Passed 0.03 sec
Start 54: ExtractRegionFromImage_HELP_SHORT
54/130 Test #54: ExtractRegionFromImage_HELP_SHORT ............................... Passed 0.03 sec
Start 55: ExtractRegionFromImageByMask_HELP_LONG
55/130 Test #55: ExtractRegionFromImageByMask_HELP_LONG .......................... Passed 0.03 sec
Start 56: ExtractRegionFromImageByMask_HELP_SHORT
56/130 Test #56: ExtractRegionFromImageByMask_HELP_SHORT ......................... Passed 0.02 sec
Start 57: ExtractSliceFromImage_HELP_LONG
57/130 Test #57: ExtractSliceFromImage_HELP_LONG ................................. Passed 0.08 sec
Start 58: ExtractSliceFromImage_HELP_SHORT
58/130 Test #58: ExtractSliceFromImage_HELP_SHORT ................................ Passed 0.02 sec
Start 59: ImageCompare_HELP_LONG
59/130 Test #59: ImageCompare_HELP_LONG .......................................... Passed 0.02 sec
Start 60: ImageCompare_HELP_SHORT
60/130 Test #60: ImageCompare_HELP_SHORT ......................................... Passed 0.03 sec
Start 61: ImageMath_HELP_LONG
61/130 Test #61: ImageMath_HELP_LONG ............................................. Passed 0.03 sec
Start 62: ImageMath_HELP_SHORT
62/130 Test #62: ImageMath_HELP_SHORT ............................................ Passed 0.03 sec
Start 63: ImageSetStatistics_HELP_LONG
63/130 Test #63: ImageSetStatistics_HELP_LONG .................................... Passed 0.03 sec
Start 64: ImageSetStatistics_HELP_SHORT
64/130 Test #64: ImageSetStatistics_HELP_SHORT ................................... Passed 0.02 sec
Start 65: KellyKapowski_HELP_LONG
65/130 Test #65: KellyKapowski_HELP_LONG ......................................... Passed 0.03 sec
Start 66: KellyKapowski_HELP_SHORT
66/130 Test #66: KellyKapowski_HELP_SHORT ........................................ Passed 0.03 sec
Start 67: KellySlater_HELP_LONG
67/130 Test #67: KellySlater_HELP_LONG ........................................... Passed 0.03 sec
Start 68: KellySlater_HELP_SHORT
68/130 Test #68: KellySlater_HELP_SHORT .......................................... Passed 0.03 sec
Start 69: LabelClustersUniquely_HELP_LONG
69/130 Test #69: LabelClustersUniquely_HELP_LONG ................................. Passed 0.03 sec
Start 70: LabelClustersUniquely_HELP_SHORT
70/130 Test #70: LabelClustersUniquely_HELP_SHORT ................................ Passed 0.02 sec
Start 71: LabelGeometryMeasures_HELP_LONG
71/130 Test #71: LabelGeometryMeasures_HELP_LONG ................................. Passed 0.03 sec
Start 72: LabelGeometryMeasures_HELP_SHORT
72/130 Test #72: LabelGeometryMeasures_HELP_SHORT ................................ Passed 0.03 sec
Start 73: LabelOverlapMeasures_HELP_LONG
73/130 Test #73: LabelOverlapMeasures_HELP_LONG .................................. Passed 0.03 sec
Start 74: LabelOverlapMeasures_HELP_SHORT
74/130 Test #74: LabelOverlapMeasures_HELP_SHORT ................................. Passed 0.03 sec
Start 75: LaplacianThickness_HELP_LONG
75/130 Test #75: LaplacianThickness_HELP_LONG .................................... Passed 0.03 sec
Start 76: LaplacianThickness_HELP_SHORT
76/130 Test #76: LaplacianThickness_HELP_SHORT ................................... Passed 0.03 sec
Start 77: MeasureImageSimilarity_HELP_LONG
77/130 Test #77: MeasureImageSimilarity_HELP_LONG ................................ Passed 0.03 sec
Start 78: MeasureImageSimilarity_HELP_SHORT
78/130 Test #78: MeasureImageSimilarity_HELP_SHORT ............................... Passed 0.03 sec
Start 79: MeasureMinMaxMean_HELP_LONG
79/130 Test #79: MeasureMinMaxMean_HELP_LONG ..................................... Passed 0.03 sec
Start 80: MeasureMinMaxMean_HELP_SHORT
80/130 Test #80: MeasureMinMaxMean_HELP_SHORT .................................... Passed 0.03 sec
Start 81: MemoryTest_HELP_LONG
81/130 Test #81: MemoryTest_HELP_LONG ............................................ Passed 0.03 sec
Start 82: MemoryTest_HELP_SHORT
82/130 Test #82: MemoryTest_HELP_SHORT ........................................... Passed 0.03 sec
Start 83: MultiplyImages_HELP_LONG
83/130 Test #83: MultiplyImages_HELP_LONG ........................................ Passed 0.03 sec
Start 84: MultiplyImages_HELP_SHORT
84/130 Test #84: MultiplyImages_HELP_SHORT ....................................... Passed 0.03 sec
Start 85: N3BiasFieldCorrection_HELP_LONG
85/130 Test #85: N3BiasFieldCorrection_HELP_LONG ................................. Passed 0.03 sec
Start 86: N3BiasFieldCorrection_HELP_SHORT
86/130 Test #86: N3BiasFieldCorrection_HELP_SHORT ................................ Passed 0.03 sec
Start 87: N4BiasFieldCorrection_HELP_LONG
87/130 Test #87: N4BiasFieldCorrection_HELP_LONG ................................. Passed 0.03 sec
Start 88: N4BiasFieldCorrection_HELP_SHORT
88/130 Test #88: N4BiasFieldCorrection_HELP_SHORT ................................ Passed 0.03 sec
Start 89: PasteImageIntoImage_HELP_LONG
89/130 Test #89: PasteImageIntoImage_HELP_LONG ................................... Passed 0.02 sec
Start 90: PasteImageIntoImage_HELP_SHORT
90/130 Test #90: PasteImageIntoImage_HELP_SHORT .................................. Passed 0.03 sec
Start 91: PermuteFlipImageOrientationAxes_HELP_LONG
91/130 Test #91: PermuteFlipImageOrientationAxes_HELP_LONG ....................... Passed 0.03 sec
Start 92: PermuteFlipImageOrientationAxes_HELP_SHORT
92/130 Test #92: PermuteFlipImageOrientationAxes_HELP_SHORT ...................... Passed 0.03 sec
Start 93: PrintHeader_HELP_LONG
93/130 Test #93: PrintHeader_HELP_LONG ........................................... Passed 0.03 sec
Start 94: PrintHeader_HELP_SHORT
94/130 Test #94: PrintHeader_HELP_SHORT .......................................... Passed 0.03 sec
Start 95: RebaseTensorImage_HELP_LONG
95/130 Test #95: RebaseTensorImage_HELP_LONG ..................................... Passed 0.03 sec
Start 96: RebaseTensorImage_HELP_SHORT
96/130 Test #96: RebaseTensorImage_HELP_SHORT .................................... Passed 0.03 sec
Start 97: ReorientTensorImage_HELP_LONG
97/130 Test #97: ReorientTensorImage_HELP_LONG ................................... Passed 0.09 sec
Start 98: ReorientTensorImage_HELP_SHORT
98/130 Test #98: ReorientTensorImage_HELP_SHORT .................................. Passed 0.03 sec
Start 99: ResampleImage_HELP_LONG
99/130 Test #99: ResampleImage_HELP_LONG ......................................... Passed 0.09 sec
Start 100: ResampleImage_HELP_SHORT
100/130 Test #100: ResampleImage_HELP_SHORT ........................................ Passed 0.03 sec
Start 101: ResampleImageBySpacing_HELP_LONG
101/130 Test #101: ResampleImageBySpacing_HELP_LONG ................................ Passed 0.03 sec
Start 102: ResampleImageBySpacing_HELP_SHORT
102/130 Test #102: ResampleImageBySpacing_HELP_SHORT ............................... Passed 0.03 sec
Start 103: ResetDirection_HELP_LONG
103/130 Test #103: ResetDirection_HELP_LONG ........................................ Passed 0.03 sec
Start 104: ResetDirection_HELP_SHORT
104/130 Test #104: ResetDirection_HELP_SHORT ....................................... Passed 0.03 sec
Start 105: sccan_HELP_LONG
105/130 Test #105: sccan_HELP_LONG ................................................. Passed 0.03 sec
Start 106: sccan_HELP_SHORT
106/130 Test #106: sccan_HELP_SHORT ................................................ Passed 0.03 sec
Start 107: SetDirectionByMatrix_HELP_LONG
107/130 Test #107: SetDirectionByMatrix_HELP_LONG .................................. Passed 0.03 sec
Start 108: SetDirectionByMatrix_HELP_SHORT
108/130 Test #108: SetDirectionByMatrix_HELP_SHORT ................................. Passed 0.03 sec
Start 109: SetOrigin_HELP_LONG
109/130 Test #109: SetOrigin_HELP_LONG ............................................. Passed 0.03 sec
Start 110: SetOrigin_HELP_SHORT
110/130 Test #110: SetOrigin_HELP_SHORT ............................................ Passed 0.02 sec
Start 111: SetSpacing_HELP_LONG
111/130 Test #111: SetSpacing_HELP_LONG ............................................ Passed 0.02 sec
Start 112: SetSpacing_HELP_SHORT
112/130 Test #112: SetSpacing_HELP_SHORT ........................................... Passed 0.03 sec
Start 113: SmoothImage_HELP_LONG
113/130 Test #113: SmoothImage_HELP_LONG ........................................... Passed 0.03 sec
Start 114: SmoothImage_HELP_SHORT
114/130 Test #114: SmoothImage_HELP_SHORT .......................................... Passed 0.03 sec
Start 115: StackSlices_HELP_LONG
115/130 Test #115: StackSlices_HELP_LONG ........................................... Passed 0.03 sec
Start 116: StackSlices_HELP_SHORT
116/130 Test #116: StackSlices_HELP_SHORT .......................................... Passed 0.03 sec
Start 117: SurfaceBasedSmoothing_HELP_LONG
117/130 Test #117: SurfaceBasedSmoothing_HELP_LONG ................................. Passed 0.08 sec
Start 118: SurfaceBasedSmoothing_HELP_SHORT
118/130 Test #118: SurfaceBasedSmoothing_HELP_SHORT ................................ Passed 0.03 sec
Start 119: SurfaceCurvature_HELP_LONG
119/130 Test #119: SurfaceCurvature_HELP_LONG ...................................... Passed 0.03 sec
Start 120: SurfaceCurvature_HELP_SHORT
120/130 Test #120: SurfaceCurvature_HELP_SHORT ..................................... Passed 0.03 sec
Start 121: ThresholdImage_HELP_LONG
121/130 Test #121: ThresholdImage_HELP_LONG ........................................ Passed 0.03 sec
Start 122: ThresholdImage_HELP_SHORT
122/130 Test #122: ThresholdImage_HELP_SHORT ....................................... Passed 0.03 sec
Start 123: TileImages_HELP_LONG
123/130 Test #123: TileImages_HELP_LONG ............................................ Passed 0.03 sec
Start 124: TileImages_HELP_SHORT
124/130 Test #124: TileImages_HELP_SHORT ........................................... Passed 0.02 sec
Start 125: WarpImageMultiTransform_HELP_LONG
125/130 Test #125: WarpImageMultiTransform_HELP_LONG ............................... Passed 0.03 sec
Start 126: WarpImageMultiTransform_HELP_SHORT
126/130 Test #126: WarpImageMultiTransform_HELP_SHORT .............................. Passed 0.03 sec
Start 127: WarpTensorImageMultiTransform_HELP_LONG
127/130 Test #127: WarpTensorImageMultiTransform_HELP_LONG ......................... Passed 0.03 sec
Start 128: WarpTensorImageMultiTransform_HELP_SHORT
128/130 Test #128: WarpTensorImageMultiTransform_HELP_SHORT ........................ Passed 0.03 sec
Start 129: WarpTimeSeriesImageMultiTransform_HELP_LONG
129/130 Test #129: WarpTimeSeriesImageMultiTransform_HELP_LONG ..................... Passed 0.03 sec
Start 130: WarpTimeSeriesImageMultiTransform_HELP_SHORT
130/130 Test #130: WarpTimeSeriesImageMultiTransform_HELP_SHORT .................... Passed 0.03 sec

100% tests passed, 0 tests failed out of 130

Total Test time (real) = 344.88 sec
➜ BRAINSTools-RelWithDebInfo-EPRelWithDebInfo-build ctest
Test project /Users/johnsonhj/src/BRAINSTools-sysclang-RelWithDebInfo/BRAINSTools-RelWithDebInfo-EPRelWithDebInfo-build
Start 1: AverageImageFilterTest
1/87 Test #1: AverageImageFilterTest ....................................... Passed 0.29 sec
Start 2: PrettyPrintTableTest
2/87 Test #2: PrettyPrintTableTest ......................................... Passed 0.12 sec
Start 3: Slicer3LandmarkIOExceptionTest
3/87 Test #3: Slicer3LandmarkIOExceptionTest ............................... Passed 0.09 sec
Start 4: FindCenterOfBrainTest
4/87 Test #4: FindCenterOfBrainTest ........................................ Passed 6.92 sec
Start 5: DWIMetaDataDictionaryValidatorTest
5/87 Test #5: DWIMetaDataDictionaryValidatorTest ........................... Passed 2.14 sec
Start 6: CenterOfROIInitTest
6/87 Test #6: CenterOfROIInitTest .......................................... Passed 1.14 sec
Start 7: BRAINSFitTest_AffineRotationMasks
7/87 Test #7: BRAINSFitTest_AffineRotationMasks ............................ Passed 3.08 sec
Start 8: BRAINSFitTest_AffineRotationNoMasks
8/87 Test #8: BRAINSFitTest_AffineRotationNoMasks .......................... Passed 3.65 sec
Start 9: BRAINSFitTest_AffineScaleMasks
9/87 Test #9: BRAINSFitTest_AffineScaleMasks ............................... Passed 2.01 sec
Start 10: BRAINSFitTest_AffineScaleNoMasks
10/87 Test #10: BRAINSFitTest_AffineScaleNoMasks ............................. Passed 2.33 sec
Start 11: BRAINSFitTest_AffineTranslationMasks
11/87 Test #11: BRAINSFitTest_AffineTranslationMasks ......................... Passed 0.33 sec
Start 12: BRAINSFitTest_AffineTranslationNoMasks
12/87 Test #12: BRAINSFitTest_AffineTranslationNoMasks ....................... Passed 0.37 sec
Start 13: BRAINSFitTest_BSplineAnteScaleRotationRescaleHeadMasks
13/87 Test #13: BRAINSFitTest_BSplineAnteScaleRotationRescaleHeadMasks ....... Passed 8.00 sec
Start 14: BRAINSFitTest_BSplineOnlyRescaleHeadMasks
14/87 Test #14: BRAINSFitTest_BSplineOnlyRescaleHeadMasks .................... Passed 73.39 sec
Start 15: BRAINSFitTest_BSplineScaleRotationRescaleHeadMasks
15/87 Test #15: BRAINSFitTest_BSplineScaleRotationRescaleHeadMasks ........... Passed 6.36 sec
Start 16: BRAINSFitTest_BSplineScaleRotationHistogramHeadMasks
16/87 Test #16: BRAINSFitTest_BSplineScaleRotationHistogramHeadMasks ......... Passed 4.08 sec
Start 17: BRAINSFitTest_RigidAnisotropicMasks
17/87 Test #17: BRAINSFitTest_RigidAnisotropicMasks .......................... Passed 1.18 sec
Start 18: BRAINSFitTest_RigidMedianRotationNoMasks
18/87 Test #18: BRAINSFitTest_RigidMedianRotationNoMasks ..................... Passed 0.92 sec
Start 19: BRAINSFitTest_RigidRotGeomNoMasks
19/87 Test #19: BRAINSFitTest_RigidRotGeomNoMasks ............................ Passed 1.43 sec
Start 20: BRAINSFitTest_RigidRotaRotaRotNoMasks
20/87 Test #20: BRAINSFitTest_RigidRotaRotaRotNoMasks ........................ Passed 2.20 sec
Start 21: BRAINSFitTest_RigidRotationHeadMasks
21/87 Test #21: BRAINSFitTest_RigidRotationHeadMasks ......................... Passed 0.90 sec
Start 22: BRAINSFitTest_RigidRotationMasks
22/87 Test #22: BRAINSFitTest_RigidRotationMasks ............................. Passed 4.34 sec
Start 23: BRAINSFitTest_RigidRotationNoMasks
23/87 Test #23: BRAINSFitTest_RigidRotationNoMasks ........................... Passed 1.10 sec
Start 24: BRAINSFitTest_RigidRotationNoMasksRiginInPlaceInterp
24/87 Test #24: BRAINSFitTest_RigidRotationNoMasksRiginInPlaceInterp ......... Passed 0.77 sec
Start 25: BRAINSFitTest_ScaleRotationRescaleHeadMasksNoInit
25/87 Test #25: BRAINSFitTest_ScaleRotationRescaleHeadMasksNoInit ............ Passed 2.89 sec
Start 26: BRAINSFitTest_ScaleSkewVersorRotationMasks
26/87 Test #26: BRAINSFitTest_ScaleSkewVersorRotationMasks ................... Passed 0.72 sec
Start 27: BRAINSFitTest_ScaleSkewVersorRotationNoMasks
27/87 Test #27: BRAINSFitTest_ScaleSkewVersorRotationNoMasks ................. Passed 0.87 sec
Start 28: BRAINSFitTest_ScaleSkewVersorScaleMasks
28/87 Test #28: BRAINSFitTest_ScaleSkewVersorScaleMasks ...................... Passed 0.73 sec
Start 29: BRAINSFitTest_ScaleSkewVersorScaleNoMasks
29/87 Test #29: BRAINSFitTest_ScaleSkewVersorScaleNoMasks .................... Passed 0.52 sec
Start 30: BRAINSFitTest_ScaleTranslationRescaleHeadMasksNoInit
30/87 Test #30: BRAINSFitTest_ScaleTranslationRescaleHeadMasksNoInit ......... Passed 5.15 sec
Start 31: BRAINSFitTest_ScaleTranslationRescaleHeadMasksInit
31/87 Test #31: BRAINSFitTest_ScaleTranslationRescaleHeadMasksInit ........... Passed 1.35 sec
Start 32: BRAINSFitTest_ScaleVersorRotationMasks
32/87 Test #32: BRAINSFitTest_ScaleVersorRotationMasks ....................... Passed 0.47 sec
Start 33: BRAINSFitTest_ScaleVersorRotationNoMasks
33/87 Test #33: BRAINSFitTest_ScaleVersorRotationNoMasks ..................... Passed 0.77 sec
Start 34: BRAINSFitTest_ScaleVersorScaleMasks
34/87 Test #34: BRAINSFitTest_ScaleVersorScaleMasks .......................... Passed 0.63 sec
Start 35: BRAINSFitTest_ScaleVersorScaleNoMasks
35/87 Test #35: BRAINSFitTest_ScaleVersorScaleNoMasks ........................ Passed 0.59 sec
Start 36: BRAINSFitTest_BSplineScaleRotationHeadMasksUShort
36/87 Test #36: BRAINSFitTest_BSplineScaleRotationHeadMasksUShort ............ Passed 4.75 sec
Start 37: BRAINSFitTest_BSplineScaleRotationHistogramHeadMasksUShort
37/87 Test #37: BRAINSFitTest_BSplineScaleRotationHistogramHeadMasksUShort ... Passed 4.04 sec
Start 38: BRAINSFitTest_NCMetricBrainToItself
38/87 Test #38: BRAINSFitTest_NCMetricBrainToItself .......................... Passed 0.21 sec
Start 39: BRAINSFitTest_NCAffineRotationMasks
39/87 Test #39: BRAINSFitTest_NCAffineRotationMasks .......................... Passed 0.94 sec
Start 40: BRAINSFitTest_NCScaleSkewVersorRotationMasks
40/87 Test #40: BRAINSFitTest_NCScaleSkewVersorRotationMasks ................. Passed 0.44 sec
Start 41: BRAINSFitTest_MSEMetricBrainToItself
41/87 Test #41: BRAINSFitTest_MSEMetricBrainToItself ......................... Passed 0.19 sec
Start 42: BRAINSFitTest_MSEAffineRotationMasks
42/87 Test #42: BRAINSFitTest_MSEAffineRotationMasks ......................... Passed 0.58 sec
Start 43: BRAINSFitTest_MSEScaleSkewVersorRotationMasks
43/87 Test #43: BRAINSFitTest_MSEScaleSkewVersorRotationMasks ................ Passed 0.31 sec
Start 44: BRAINSFitTest_MIHAffineRotationMasks
44/87 Test #44: BRAINSFitTest_MIHAffineRotationMasks ......................... Passed 2.58 sec
Start 45: BRAINSFitTest_MIHScaleSkewVersorRotationMasks
45/87 Test #45: BRAINSFitTest_MIHScaleSkewVersorRotationMasks ................ Passed 0.49 sec
Start 46: BRAINSABCSmallTest
46/87 Test #46: BRAINSABCSmallTest ........................................... Passed 249.95 sec
Start 47: BRAINSEyeDetectorTest_T1
47/87 Test #47: BRAINSEyeDetectorTest_T1 ..................................... Passed 10.34 sec
Start 48: BRAINSAlignMSPTest_T1
48/87 Test #48: BRAINSAlignMSPTest_T1 ........................................ Passed 18.71 sec
Start 49: BCDTest_forceHoughReportFailure
49/87 Test #49: BCDTest_forceHoughReportFailure .............................. Passed 0.48 sec
Start 50: BCDTest_inputVolumeError
50/87 Test #50: BCDTest_inputVolumeError ..................................... Passed 0.03 sec
Start 51: BCDTest_LLSModelError
51/87 Test #51: BCDTest_LLSModelError ........................................ Passed 0.03 sec
Start 52: BRAINSTrimForegroundInDirectionTest_T1
52/87 Test #52: BRAINSTrimForegroundInDirectionTest_T1 ....................... Passed 1.03 sec
Start 53: insertMidACPCpointTest
53/87 Test #53: insertMidACPCpointTest ....................................... Passed 0.26 sec
Start 54: chk_insertMidACPCpointTest
54/87 Test #54: chk_insertMidACPCpointTest ................................... Passed 0.22 sec
Start 55: landmarksConstellationAlignerTest
55/87 Test #55: landmarksConstellationAlignerTest ............................ Passed 0.37 sec
Start 56: chk_landmarksConstellationAlignerTest
56/87 Test #56: chk_landmarksConstellationAlignerTest ........................ Passed 0.01 sec
Start 57: BCD_HELP_TEST
57/87 Test #57: BCD_HELP_TEST ................................................ Passed 0.04 sec
Start 58: BCDTest_ForceRPPoint
58/87 Test #58: BCDTest_ForceRPPoint ......................................... Passed 1030.04 sec
Start 59: chk_BCDTest_ForceRPPoint
59/87 Test #59: chk_BCDTest_ForceRPPoint ..................................... Passed 0.01 sec
Start 60: BCDTest_ForceACPoint
60/87 Test #60: BCDTest_ForceACPoint ......................................... Passed 200.12 sec
Start 61: chk_BCDTest_ForceACPoint
61/87 Test #61: chk_BCDTest_ForceACPoint ..................................... Passed 0.01 sec
Start 62: BCDTest_ForcePCPoint
62/87 Test #62: BCDTest_ForcePCPoint ......................................... Passed 41.31 sec
Start 63: chk_BCDTest_ForcePCPoint
63/87 Test #63: chk_BCDTest_ForcePCPoint ..................................... Passed 0.01 sec
Start 64: BCDTest_ForceVN4Point
64/87 Test #64: BCDTest_ForceVN4Point ........................................ Passed 40.89 sec
Start 65: chk_BCDTest_ForceVN4Point
65/87 Test #65: chk_BCDTest_ForceVN4Point .................................... Passed 0.01 sec
Start 66: BCDTest_acLowerBound
66/87 Test #66: BCDTest_acLowerBound ......................................... Passed 42.90 sec
Start 67: BCDTest_backgroundValue
67/87 Test #67: BCDTest_backgroundValue ...................................... Passed 42.35 sec
Start 68: BCDTest_cutOutHeadInOutputResampledVolume
68/87 Test #68: BCDTest_cutOutHeadInOutputResampledVolume .................... Passed 42.72 sec
Start 69: BCDTest_cutOutHeadInOutputVolume
69/87 Test #69: BCDTest_cutOutHeadInOutputVolume ............................. Passed 41.50 sec
Start 70: BCDTest_interpolationMode
70/87 Test #70: BCDTest_interpolationMode .................................... Passed 43.70 sec
Start 71: BCDTest_mspLevel
71/87 Test #71: BCDTest_mspLevel ............................................. Passed 42.19 sec
Start 72: BCDTest_otsuThreshold
72/87 Test #72: BCDTest_otsuThreshold ........................................ Passed 44.51 sec
Start 73: BCDTest_outputUntransformedClippedVolume
73/87 Test #73: BCDTest_outputUntransformedClippedVolume ..................... Passed 43.24 sec
Start 74: BCDTest_rac
74/87 Test #74: BCDTest_rac .................................................. Passed 107.31 sec
Start 75: BCDTest_rescaleIntensity
75/87 Test #75: BCDTest_rescaleIntensity ..................................... Passed 45.98 sec
Start 76: BCDTest_rescaleIntensityRange
76/87 Test #76: BCDTest_rescaleIntensityRange ................................ Passed 42.38 sec
Start 77: BCDTest_rmpj
77/87 Test #77: BCDTest_rmpj ................................................. Passed 104.73 sec
Start 78: BCDTest_rpc
78/87 Test #78: BCDTest_rpc .................................................. Passed 237.24 sec
Start 79: BCDTest_rVN4
79/87 Test #79: BCDTest_rVN4 ................................................. Passed 42.34 sec
Start 80: BCDTest_rVN4-rpc-rac-rmpj
80/87 Test #80: BCDTest_rVN4-rpc-rac-rmpj .................................... Passed 43.30 sec
Start 81: BCDTest_T1_outputResampledVolume
81/87 Test #81: BCDTest_T1_outputResampledVolume ............................. Passed 42.63 sec
Start 82: BCDTest_T1_outputVolume
82/87 Test #82: BCDTest_T1_outputVolume ...................................... Passed 41.40 sec
Start 83: BCDTest_trimRescaledIntensities
83/87 Test #83: BCDTest_trimRescaledIntensities .............................. Passed 42.85 sec
Start 84: BCDTest_writeBranded2DImage
84/87 Test #84: BCDTest_writeBranded2DImage .................................. Passed 44.99 sec
Start 85: BCDTestForLandmarkCompare
85/87 Test #85: BCDTestForLandmarkCompare .................................... Passed 43.01 sec
Start 86: chk_a_BCDTestForLandmarkCompare
86/87 Test #86: chk_a_BCDTestForLandmarkCompare .............................. Passed 0.02 sec
Start 87: chk_i_BCDTestForLandmarkCompare
87/87 Test #87: chk_i_BCDTestForLandmarkCompare .............................. Passed 0.01 sec

100% tests passed, 0 tests failed out of 87

When either the fixedMarginalPDF or movingMarginalPDF (which are sums of
rows or columns of the 2D joint histogram) then the intersection point
must also be zero.  Both the contribution to the final values of such a point
is no change, so one can avoid much testing and subsequent inner conditional
processing in such cases.
This test started failing due to very small numerical accumulation
changes.  Other packages (i.e. ANTs & BRAINSTools) registration tools
that are more complete versions of this example all pass their
more extensive testing.
@hjmjohnson hjmjohnson force-pushed the fix-mattes-metric-sse-instructions branch from 6294dca to aa53465 Compare April 11, 2020 03:43
@hjmjohnson hjmjohnson added type:Compiler Compiler support or related warnings type:Performance Improvement in terms of compilation or execution time labels Apr 11, 2020
@dzenanz
Copy link
Member

dzenanz commented Apr 11, 2020

Preferably wait until Monday noon to give other people time to chime in.

@hjmjohnson hjmjohnson merged commit 623bef5 into InsightSoftwareConsortium:master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Compiler Compiler support or related warnings type:Performance Improvement in terms of compilation or execution time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants