airlab-unibas / airlab

Image registration laboratory for 2D and 3D image data
Apache License 2.0
408 stars 92 forks source link

Random Elastic using BSpline #33

Open soumickmj opened 4 years ago

soumickmj commented 4 years ago

Its actually not an issue, rather I have a question. I'm trying to use BsplineTransformation for Random Elastic Deformation. For the same, I would like to set custom parameters for the BSpline transformation. Can someone recomand some way for doing the same? Thanks.

qiuhuaqi commented 4 years ago

Not 100% sure that I understand you. Are you trying to use B-Spline transformation to generate random elastic deformation?

If so, you can use the B-spline kernel transformation module. Filling the self.trans_parameters with randomly sampled parameters from a Gaussian or uniform distribution, and call the forward() method to get the dense displacement field.

https://github.com/airlab-unibas/airlab/blob/80c9d487c012892c395d63c6d937a67303c321d1/airlab/transformation/pairwise.py#L624