ENH: Add a parameter to test to improve itk::ResampleImageFilter testing.#447
Conversation
itk::ResampleImageFilter te…itk::ResampleImageFilter testing.
d4b49da to
1d32259
Compare
|
Looks like the The corresponding baselines in the commit are just there to avoid CMake warning that they do not exist (since due to the above exception they were not generated). However, I'm wondering about a use case where the target region would not be determined by the reference image. Any suggestions? Thanks. |
|
Thanks @jhlegarreta for these improvements and thanks to @thewtex for CCing me. Yes there are use cases, for example if you want to use |
…sting. Add a parameter to the `itkResampleImageFilterTest2.cxx` to improve the `itk::ResampleImageFilter` class testing. Specifically, exercise the workflow when the `UseReferenceImage` boolean is set to `false`. Add to the test arguments: - A boolean to as a hint to use or discard the reference image. - The spacing to be used when resampling when no reference image is used. Add the corresponding baselines. Rename the tests and old baselines to account for this new test. Take advantage of the commit to improve the style of the test: - Use the `TRY_EXPECT_NO_EXCEPTION` in lieu of `try/catch` for the sake of readability/compactness/save typing boilerplate code. - Explicitly call `Update()` on filters with the help of the `TRY_EXPECT_EXCEPTION` macro. - Use the `TEST_SET_GET_BOOLEAN` macro to test the boolean members. - Remove unused/unnecessary `reader` declared variables. - Move the `std::cout` messages before the filter calls to `Update()`.
1d32259 to
14b24ed
Compare
|
Thanks @romangrothausmann ! I re-worked the test to take the output spacing as an optional parameter in case the reference image is not to be used. I thought repeatedly at getting rid of the boolean and just using the presence of the reference image as a signal to use it. Having the output spacing also as an optional argument made things less clear to me. If anyone has better suggestion, please go ahead. Also, I could have made the spacing anisotropic, but the boilerplate code to handle a double-quote enclosed argument holding all spatial dimensions as an array put me off this time. |
|
CDash reported compiler warnings come from the The concerned tests are passing: |
|
There seems to been some baseline comparison issues with 32-bit systems: https://open.cdash.org/testDetails.php?test=728564967&build=5731782 |
|
I guess it has to do with this division being rounded differently in a 32-bit system vs. the 64-bit system I use. Not sure I will be able to test any solution, but I'd guess that doing a |
|
Fantastic, thanks @jhlegarreta ! |
|
Opened PR #462. |
Add a parameter to the
itkResampleImageFilterTest2.cxxto improve theitk::ResampleImageFilterclass testing.Specifically, exercise the workflow when the
UseReferenceImagebooleanis set to
false. Add the corresponding baselines.Rename the tests and old baselines to account for this new test.
Take advantage of the commit to improve the style of the test:
TRY_EXPECT_NO_EXCEPTIONin lieu oftry/catchfor the sake ofreadability/compactness/save typing boilerplate code.
Update()on filters with the help of theTRY_EXPECT_EXCEPTIONmacro.TEST_SET_GET_BOOLEANmacro to test the boolean members.std::coutmessages before the filter calls toUpdate().