STalign icon indicating copy to clipboard operation
STalign copied to clipboard

Affine transform issue

Open ebolotin02 opened this issue 2 years ago • 1 comments

I am trying to mostly do Affine transform, I have a lot of images mostly rotated/scaled/moved coordinates, when I try to add diffeo_start and set to any value I get no output and a RuntimeWarning (invalid value) params = { 'niter': 200,

      'device': device,
      'sigmaP': 2e-1,
      'sigmaM': 0.18,
      'sigmaB': 0.18,
      'sigmaA': 0.18,
     'diffeo_start' : 100,
      'epL': 5e-11,
      'epT': 5e-4,
      'epV': 5e1
      }

Output message here:

/opt/mamba/envs/stalign_conda_v2/lib/python3.10/site-packages/torch/utils/device.py:77: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad(True), rather than torch.tensor(sourceTensor). return func(*args, **kwargs) /opt/mamba/envs/stalign_conda_v2/lib/python3.10/site-packages/STalign/STalign.py:1301: UserWarning: Data has no positive values, and therefore cannot be log-scaled. axE[2].set_yscale('log') /opt/mamba/envs/stalign_conda_v2/lib/python3.10/site-packages/matplotlib/cm.py:494: RuntimeWarning: invalid value encountered in cast xx = (xx * 255).astype(np.uint8)

Any ideas? Thanks!

ebolotin02 avatar Jan 10 '24 21:01 ebolotin02

Hi,

Thanks for your question and apologies for the delay in response. I haven't been able to reproduce the issue in which you get no output when using diffeo_start. I have gotten the same output messages before but even with the messages the function is still able to return the intended output in that case.

If you are still interested in diagnosing the issue, could you try reproducing this tutorial notebook which we used diffeo_start to see if you get the output messages but still get the function output?

Best, Kalen

kpclifton avatar Feb 27 '24 22:02 kpclifton