Skip to content

Commit b668ce6

Browse files
committed
ENH: Modified time-varying test switching off time normalization
This is a modification to the time-varying test using the recently introduced option in itkTimeVaryingVelocityFieldIntegrationImageFilter to interpret LowerTimeBound and UpperTimeBound either as absolute times or as rates in the velocity field time span.
1 parent 7ae8a4e commit b668ce6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[])
123123
size[0] = 3;
124124
size[1] = 3;
125125
size[2] = 401;
126-
size[3] = 41;
126+
size[3] = 61;
127127
ImportFilterType::IndexType start;
128128
start.Fill(0);
129129

@@ -136,7 +136,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[])
136136
origin.Fill(0.);
137137
importFilter->SetOrigin(origin);
138138

139-
double spaceTimeSpan[4] = { 20., 20., 20., 1. };
139+
double spaceTimeSpan[4] = { 20., 20., 20., 1.5 };
140140
for (unsigned int i = 0; i < 4; i++)
141141
{
142142
spacing[i] = spaceTimeSpan[i] / (size[i] - 1);
@@ -151,8 +151,8 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[])
151151
{
152152
for (unsigned int z = 0; z < size[2]; ++z)
153153
{
154-
const double zz = static_cast<double>(z) * spacing[2];
155-
const double kappa = zz / (1 + t * spacing[3]);
154+
const double zz = spacing[2] * z;
155+
const double kappa = zz / (1 + spacing[3] * t);
156156
for (unsigned int y = 0; y < size[1]; ++y)
157157
{
158158
for (unsigned int x = 0; x < size[0]; ++x, ++it)
@@ -173,6 +173,11 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[])
173173
integrator->SetInput(timeVaryingVelocityField);
174174
integrator->SetLowerTimeBound(0.2);
175175
integrator->SetUpperTimeBound(0.8);
176+
/* This time bounds are meant to be absolute
177+
* for the velocity field original time span [0, 1.5].
178+
* Thus, we need to switch off the default rescaling
179+
* to the normalized time span [0, 1] */
180+
integrator->TimeBoundsAsRatesOff();
176181
integrator->SetNumberOfIntegrationSteps(50);
177182
integrator->Update();
178183

0 commit comments

Comments
 (0)