Displacement Field Format

Displacement Field Format  

  By: xi on July 20, 2021, 6:31 p.m.

Hi there,

I tested the estimated disp_field with map_coordinates, which yields around 0.80 DICE.

warpedmovlab = mapcoordinates(movlab, identity + dispfield, order=0)

When I saved the disp_field and submitted it on the Validation 3, the DICE turned out to be 10% lower, only 0.69.

dispfield = downsample(dispfield, 'Trilinear') np.savez(savenpzname, dispfield.astype(np.float16))

Could anyone help me with this?

Re: Displacement Field Format  

  By: lassehansen on July 22, 2021, 3:35 p.m.

Hi Xi,

Could you give some more details on your local evaluation routine (minmal code example, used segmentation masks,...)? The compression (half resolution, half precision) should not be the problem.

Best wishes, Lasse

Re: Displacement Field Format  

  By: xi on July 22, 2021, 3:56 p.m.

Hi Lasse,

Thank you for the reply. I used the 'aligned_norm.nii.gz' and 'alignd_seg35.nii.gz' as image and mask input respectively.

The whole pipeline goes like: % Load Images fixImg, fixlab, movImg, movlab = loadImageMask('PATH') % Estimate Pytorch Grid pytorch_grid = METHOD(fixImg, movImg) pytorch_warpedLab = grid_sample(movlab, pytorch_grid ) % Convert Pytorch Grid to MapCorrdinates dispfield dispfield = convertPytorch2Disp(pytorch_grid) warpedmovlab = mapcoordinates(movlab, identity + dispfield, order=0) % Compare Pytorch and MapCorrdinates warped maskes assert warpedmovlab == pytorch_warpedLab % Call provided evaluation Code from https://drive.google.com/uc?export=download&id=1EEhAhWchJZjaQctatBoWjRbPyzE2FWdb

It is very straightforward.

Best wishes, Xi

Re: Displacement Field Format  

  By: lassehansen on July 23, 2021, 9:59 a.m.

Thanks for the additional information. We checked our evaluation code with your respective submission but could not find any errors.

I would suggest you send a validation displacement field (eg. disp_0438_0439.npz) + your local evaluation code snippet to learn2reg@gmail.com. We could then perform a side-by-side comparison to see where your evaluation differs from ours.

Best, Lasse

 Last edited by: lassehansen on Aug. 15, 2023, 12:55 p.m., edited 1 time in total.

Re: Displacement Field Format  

  By: songx on Aug. 5, 2021, 6:37 p.m.

Hi! I am experiencing a very similar problem with Xi. Was this issue resolved?

I have emailed you my validation code snippet, as well as some sample files. Thanks in advance!

 Last edited by: songx on Aug. 15, 2023, 12:55 p.m., edited 1 time in total.
Reason: Sent new email and attachements

Re: Displacement Field Format  

  By: xi on Aug. 7, 2021, 8:11 a.m.

Hi Lasse and songx,

Sorry for the late response.

I solved the issuse, thank you very much, which is indeed brought by the down/upsample strategy. In my previous implementation, I used Pytorch 'Trilinear' interpolation which is different from the Scipy zoom thing.

And for songx, I noticed there is a recent update in the submission page, where one can find the provided evaluation scripts in the last sentence, right before References, you can download the scirpts and run a local evaluaiton yourself. Hope it's somehow helpful.

Best regards, Xi

 Last edited by: xi on Aug. 15, 2023, 12:55 p.m., edited 2 times in total.

Re: Displacement Field Format  

  By: songx on Aug. 7, 2021, 3:32 p.m.

Hi Xi,

I also noticed that the Pytorch interpolate() function produces different result compared with the Scipy zoom() function. Specifically, the Pytorch trilinear sampling process extends the distribution of voxel intensities. Have you been able to find out why?