brianlee324 / torch-lddmm

GPU and CPU implementation of LDDMM image registration
56 stars 16 forks source link

question about the initial of self.X0 #2

Open Vive940219 opened 4 years ago

Vive940219 commented 4 years ago

hello, I am using your code to realize the lddmm, but I am curious about why you X0-np.mean(X0) for the grids instead use the original grids X0 = range(imgsize)?

self.X0 = torch.tensor(X0-np.mean(X0)).type(self.params['dtype']).to(device=self.params['cuda']) self.X1 = torch.tensor(X1-np.mean(X1)).type(self.params['dtype']).to(device=self.params['cuda'])

brianlee324 commented 3 years ago

Subtracting the mean of X0 places the origin of the transformation at the center of the image volume - this is somewhat more natural for transformations like rigid motions, else the volume would rotate around one of its corners. (Sorry for the delayed response)