Hello everyone,
I’m using ITK for 3D brain image registration, but the registration is too slow. I try to change the sample rate but it seems not working, reducing sample rate does not affect the registration speed. It really confused me and I’m trying to get some help.
Here is part of the code
using ImageType = itk::Image<float, K_DIM>;
using TransformType = itk::VersorRigid3DTransform<double>;
using MetricType = itk::MattesMutualInformationImageToImageMetricv4<ImageType, ImageType>;
using OptimizerType = itk::RegularStepGradientDescentOptimizerv4<double>;
using RegistrationType = itk::ImageRegistrationMethodv4<ImageType, ImageType, TransformType>;
RegistrationType::Pointer registration = RegistrationType::New();
registration->SetFixedImage(fixed);
registration->SetMovingImage(moving);
MetricType::Pointer metric = MetricType::New();
registration->SetMetric(metric);
OptimizerType::Pointer optimizer = OptimizerType::New();
registration->SetOptimizer(optimizer);
metric->SetNumberOfHistogramBins(histogram_bins);
metric->SetUseMovingImageGradientFilter(false);
metric->SetUseFixedImageGradientFilter(false);
if (sample_rate < 1) {
registration->SetMetricSamplingStrategy(RegistrationType::RANDOM);
registration->SetMetricSamplingPercentage(sample_rate);
registration->MetricSamplingReinitializeSeed(42);
}
else {
metric->SetUseSampledPointSet(false);
}