InsightSoftwareConsortium / InsightSoftwareConsortium/ITKElastix

Reset random seed for deterministic registration

Open
#279 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
281
Forks
29
Avg merge
16h 28m
Merged PRs (30d)
8

Description

Hi, I was wondering if there is a way to reset the random seed used by ITKElastix.

In my Python code if I register a set of images, and then if I repeat this registration in the same dataset in the next loop iteration, I get slightly different pixel values for the registered images. I believe at least some of the randomness comes from this part of my bspline registration recipe:
```c++
// **************** Image sampling **********************
(NumberOfSpatialSamples 2048)
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
//(ImageSampler "Full")
```

If I set sampler to `(ImageSampler "Full")` then the registration is deterministic, and I get the same results every iteration, but unfortunately it also takes significantly longer to register.

So my question is: is there a way to reset the random seed in the python code?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.