Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Mirror transforms #2

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

WIP: Mirror transforms #2

wants to merge 9 commits into from

Conversation

dokato
Copy link
Contributor

@dokato dokato commented Oct 18, 2021

Introducing symmetrisation based on landmarks to FANCr.

Screenshot 2021-10-18 at 15 18 46

Done:

  • mirror_fanc
  • added simplified mesh FANC.surf
  • mirror_fanc_reglist
  • symmetric_fanc

TBD:

  • fill the parameters of FANCsym

@dokato dokato requested a review from jefferis October 18, 2021 14:41
@dokato
Copy link
Contributor Author

dokato commented Oct 18, 2021

About FANCsym template, I was tempted to just copy https://github.com/navis-org/navis-flybrains/blob/a8c24e44dd1a692661b0add93dc74829977a6105/flybrains/data/template_meta.json#L651 but we need a symmetrised version of these, right @jefferis ?

@jefferis
Copy link
Member

Thanks a lot @dokato. So actually the symmetric FANC space defined by the registration is just the symmetric MANC space. So I think you could use the dimensions of that.

> dput(MANCsym)
structure(list(name = "mancsym-4-symmetric", regName = "MANCsym", 
    type = "Synthetic average brain from T-bar predictions based on MANC FIB sem data", 
    sex = "M", dims = c(672L, 830L, 1280L), voxdims = c(0.512, 
    0.512, 0.512), origin = c(0, 0, 0), BoundingBox = structure(c(0, 
    343.552, 0, 424.448, 0, 654.848), .Dim = 2:3, class = "boundingbox"), 
    units = NULL, description = NULL, doi = NULL), class = "templatebrain")
> MANCsym
=== Template Brain === 
Name: mancsym-4-symmetric 
Short Name: MANCsym 
Type: Synthetic average brain from T-bar predictions based on MANC FIB sem data 
Sex:  M 
Dimensions:672 x 830 x 1280 voxels
Voxel size:
  x = 0.512 
  y = 0.512 
  z = 0.512 
Bounding box ():
  x = 0, y = 0, z = 0,
  x = 343.552, y = 424.448, z = 654.848.
Description: 
DOI:

@dokato
Copy link
Contributor Author

dokato commented Oct 18, 2021

Are you sure @jefferis? All my landmark are in nm so my transformation expects nm too; the above is microns. When I plot FANC and MANC surfaces meshes in um I got sth like that ⬇️ . Do I miss some scaling factor?

Screenshot 2021-10-18 at 16 24 32

@schlegelp
Copy link

schlegelp commented Oct 18, 2021

If you are using the FANC_mirror_landmarks.csv from navis-flybrains then this is not a bridging but a mirror transform - i.e. it compensates for left right asymmetries after flipping within the FANC template space.

@dokato
Copy link
Contributor Author

dokato commented Oct 18, 2021

No, I get that and I use landmarks file just for symmetrization, above is supposed to show that I don't quite get why: "symmetric FANC space defined by the registration is just the symmetric MANC space" when they are dissimilar in um.

@jefferis
Copy link
Member

Hi both, I guess I didn't look closely enough at what @dokato did. I gave @schlegelp a bridging registration from FANC (µm) -> MANCsym (µm). Philipp then used that to generate landmark pairs that would define FANC (nm) -> FANC-mirrored (nm). Now I guess what Dominik has done is use the LR to mirroring field to generate a symmetrised FANC template version. How did you do that in detail, Dominik? Is it actually affine aligned to the YZ plane, something we normally do as final step when making an image-based symmetric template?

@dokato
Copy link
Contributor Author

dokato commented Oct 21, 2021

@jefferis I did:

  mirror_reg_f <- tpsreg(
    mirror_landmarks[c("x_flip", "y_flip", "z_flip")],
    mirror_landmarks[c("x_mirr", "y_mirr", "z_mirr")]
  )

but TBH I got confused a little, I can see from these points that they just shift the voxels a little
Screenshot 2021-10-21 at 17 03 10
I.e. they symmetrize the mesh in FANC nm space (at least what I thought it's doing) - hence why the name mirror landmarks or "FANC-mirrored (nm)" as I don't see any mirroring done?
Yet... as after symmetrisation (as done above) I imagined that I could use the same landmarks, invert the x axis to perform mirroring, does that sound like it?

This was referenced Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants