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

Voxel size in elliptic transformed image #18

Open
tischi opened this issue Sep 18, 2021 · 4 comments
Open

Voxel size in elliptic transformed image #18

tischi opened this issue Sep 18, 2021 · 4 comments

Comments

@tischi
Copy link

tischi commented Sep 18, 2021

@NicoKiaru

We would like to assign voxel sizes to the elliptic transformed image.
This is tricky as the size of every voxel in the transformed image can be different (in terms of what volume it represented in the original image). I guess thus we would actually need a "voxel size image" (like a deformation field)?
(ping @bogovicj)

Do you have any ideas? I thought if we could compute the volume of a region in the transformed image in the original image this would get us something; but now I am confused, because even if we know this, how do we go from the volume to the voxel sizes along the three dimensions?

BTW: This is why I asked on the forum about how to compute the volume...
https://forum.image.sc/t/compute-volume-after-transformation/57728/2

@tischi
Copy link
Author

tischi commented Sep 18, 2021

Maybe (pseudo-code) one could create an n-dimensional distance field like this?

for d in dimensions:
   for v in voxels of an iterable region in the transformed image:
      pos = v.getPosition()
      neighborPos = v.move(d,1).getPosition()
      posInOriginalImage = transform.inverse().apply( pos )
      neighborPosInOriginalImage = transform.inverse().apply( neighborPos )

      distance_image[d, v.getPosition()] = distance( posInOriginalImage - neighborPosInOriginalImage )

If this is correct, from this one could then, btw, also compute the volume in the original image...

@tischi
Copy link
Author

tischi commented Sep 18, 2021

If above algorithm is correct, would it be OK for you if we (I can contribute the code) add this to the Elliptic3DTransformerCommand such that it would output not only the transformed image but in addition also three more sources with the corresponding local voxel dimensions in the original image? I think this could be very useful, because one could then still measure physical volumes and distances in the transformed image and also would have a visual representation of the deformations that have been applied to go from the original image to this one.

@tischi
Copy link
Author

tischi commented Sep 20, 2021

@bogovicj I have a feeling that your code is very similar to the algorithm that I proposed above? Would you say it essentially is the same idea?

@bogovicj
Copy link
Contributor

@tischi , I agree, your pseudocode is doing something similar to that code of mine you pointed to.

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

No branches or pull requests

2 participants