When using the ImageRegistrationMethod with a virtual image and a sampling strategy, there is a serious problem with the spaces.
->The ImageRegistrationMethod generate a sampled point set by iterating on the virtual image:
This is then set to the metric by ImageToImageMetricv4::SetFixedSampledPointSet. The Metric expects the samples to be in the fixed image domain!
-> The metric then transforms these points from the fixed image domain to the virtual image domain :
I have a patch which has a hack for a solution for how I was using it:
Here is the commit message:
For using a sampled point set for a metric in the
ImageRegistrationMethodv4, the point set was generated by iterating
over the virtual domain. This matches the way the dense sampling is
done. However, this is set to the metrics as the fixed point set,
which the metric then transform from the fixed image domain to the
virtual image domain, essentially applying the initial fixed image
The SetFixedSampledPointSet is widely used. and the
“UseFixedSampledPointSet” ivar is checked to determine if the
“VirtualSampledPointSet” can be used. The FixedSampledPointSet is only
used by the initialization of the metric, as the evaluation of the
metrics access the virtual sampled point set.
It could be made clear by a “UseSampledPointSet” variable instead of
the “UsedFixedSampledPointSet”, but this would be an API change.
When the VirtualSampledPointSet is set should it be transformed to the
FixedSampledPointSet? This data is not used, but would help keep the
state of the class consistent.
Steps to move forward:
- Agreement this is a bug
- Determine compatibility requirements.
->Need a way to clearly set fixed or virtual point set, but currently
UsedFixedSampledPointSetis use to determine if the transformed virtual point set is used, while the original point set does not appear to be used anywhere. Keeping
UseFixedSamplesPointSetwill be very confusing, misleading, and a bad name for the states of the variables!