Warpfield as a "pointcloud registration" tool? #33
Replies: 3 comments
-
|
Hi @danielhannuschke , great to hear that warpfield has been working for you! If you like to, you are welcome to share some registration videos in the show-and-tell channel. We are genuinely curious about various – often unforeseen – use cases. Pointcloud... we can apply any warp field to points, but I don't think warpfield will ever support registering point clouds directly. Not because I think there is no need for it, but the underlying approach would be so different that it would merit a separate tool. There are of course workarounds, if you find a way to convert your coordinates to dense volumes. You could, for example, create a 3D histogram of your points and smooth them, as long as the outcome looks somewhat similar to the reference volume (which you could prepare in analogous ways).
import cupy as cp
import numpy as np
from warpfield.register import WarpMap
def wm_to_dict(wm):
to_host = lambda x: cp.asnumpy(x) if isinstance(x, cp.ndarray) else x
keys = ("warp_field", "block_size", "block_stride", "ref_shape", "mov_shape")
return {k: to_host(getattr(wm, k)) for k in keys}
def dict_to_wm(d):
return WarpMap(d["warp_field"], d["block_size"], d["block_stride"],
tuple(d["ref_shape"]), tuple(d["mov_shape"]))(and save/load the dict with your favorite tool, e.g. See answer below |
Beta Was this translation helpful? Give feedback.
-
|
Since it was a simple change, I added the Example: wm.to_h5('test.h5')
# some time later:
wm2 = warpfield.register.WarpMap.from_h5('test.h5') |
Beta Was this translation helpful? Give feedback.
-
|
Since you didn't answer I'll take the optimistic interpretation that it worked for you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
first of all I wanted to say how amazing warpfield is! I've been using it to register some multiplex IF and it works amazingly well. Thanks!
I was wondering if this approach could also be used to perform a sort of pointcloud registration approach. Essentially what I want to do at some point is to warp a dense source pointcloud to a target volume. I realize this is more of a surface deformation problem but since I also care about the displacement of the points inside my object I was thinking that the warpmaps from this tool could be a promising road.
For context I am working with zebrafish embryos so for the point cloud, think of a half-sphere filled with cells, and the deformation happening is an invagination at the center of the base circle. I'm happy to share some example images, e.g. I tried just applying warpfield to the embryo segmentation mask, but obviously it needs some intensity gradients to work properly.
I also had a minor thing: Is it also possible to save and load the WarpField objects at the moment? I couldn't find anything in the code...
Any ideas or pointers would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions