navis-org / navis-flybrains

Transforms for navis that enable mapping between different Drosophila template brains.
GNU General Public License v3.0
7 stars 2 forks source link

Adding L1/Seymour um & mirroring #13

Open Robbie1977 opened 1 year ago

Robbie1977 commented 1 year ago

adding um to match the VFB content and adding mirroring for NBLAST from CMTK warp

Robbie1977 commented 1 year ago

@schlegelp how can I convert the CMTK xform warp from a um Seymour to a mirrored version into something you could use for mirroring in Navis (looks like you need csv points)?

schlegelp commented 1 year ago

Hi Robbie. The mirroring is a two step process in navis:

  1. Flip x/y/z points along an axis
  2. Apply a warp transform that offsets any left/right asymmetries (transform_type="mirror")

I suspect your CMTK transform is doing both of these together? You could - in theory - just use this to define a transform between DmelL1CNS_Seymourum and DmelL1CNS_Seymourum_mirrored.

The more canonical way is to try to generate a warping transform that offsets asymmetries after the flipping though. What I've done in the past is this:

  1. Define a set of points that tile the volume
  2. Then generate two sets of points: a. One where you just flip the points b. A second where you use the CMTK transform to move the points to the mirrored position accurately
  3. Use these two sets of points to generate a landmark transform and register it as MirrorTransform

For FAFB I did just that using the JRC2018F symmetrical template for step 2b.

That will obviously subsample the CMTK transform and would likely be a bit less precise (but faster!) - so you might want to run some quality checks. I do wonder if there is a way to extract the warping part out of the CMTK transform and plug that in as the transform_type='mirror'.