Image Registration with Pseudo-Random Sampling throws exception randomly (maybe bug)

Just a report.
Exceptions were throw at trial 52203 & 52204.
Is there anything that I did wrong in building the code?

Wow! That is running for quite a long time!

@matt.mccormick @dzenanz
I am going to take a guess that you are running into the problem of the time stamp overflowing.
It looks like it is still 32-bits on windows:

This should be fixed.

2 Likes

I am giving it a try.

1 Like

Here is the PR:

3 Likes

With the update, this test program can run up to trial 394000 now without any exception!
I’ll test on my original program and report the result.
Thank you so much @blowekamp @dzenanz !


By the way, I’m still using ITK version: 82dfa9ee752cdc240c46ded10242591dba97b21a
I have to update line 660, 669 of Modules\Core\SpatialObjects\include\itkSpatialObject.hxx
unsigned long -> ModifiedTimeType
or the build will fail

2 Likes

Please update to the latest revision. If that still occurs, please submit a patch!

2 Likes

I tried using the latest revision (a11cdfcd7feaeabaec5124b472f1f2a92d98b07e)
I can build the code but when I run my testing program, it throws lots of exception immediately

ExceptionObject caught !
itk::ExceptionObject (0000000E547FF6F0)
Location: “unknown”
File: c:\itk\modules\registration\metricsv4\include\itkCorrelationImageToImageMetricv4.hxx
Line: 75
Description: itk::ERROR: CorrelationImageToImageMetricv4(000001F7208A1A80): FixedSampledPointSet must have 1 or more points.

Am I using the correct revision?

If you are using a fixed image mask, none of the randomly selected sample points fall inside the mask. You should increase number of sample points (increase sampling percentage).

1 Like

No, I don’t think that is the problem.
Using older version of ITK (like 82dfa9ee752cdc240c46ded10242591dba97b21a) is fine.
I’m wondering if a11cdfcd7feaeabaec5124b472f1f2a92d98b07e is a none stable version?
Or the interface has changed?
Or there might be bug?

a11cdfcd7feaeabaec5124b472f1f2a92d98b07e is no more stable than 82dfa9ee752cdc240c46ded10242591dba97b21a. Both of those are recent commits on the master branch. There might be a bug introduced since 82dfa9e, or there is a bug in your program which only manifests itself with a11cdfc.