oanegros / MicroscopyNodes

Loading and handling microscopy data in blender
https://oanegros.github.io/MicroscopyNodes/
GNU General Public License v3.0
100 stars 8 forks source link

blender coordinates of imported tifs #54

Closed nikolas-claussen closed 3 months ago

nikolas-claussen commented 3 months ago

Hello,

I am using blender to process surface meshes computed from 3d .tif stacks (e.g. a mesh of the surface of an organoid). I want to use MicroscopyNodes to import the original .tif into blender so I can overlay it with my mesh and see whether the mesh matches the raw data as intended.

My issue is as follows. From my .tif stack (for example 500 x 500 x100 pixels), I compute a mesh, saved as a .obj file. The vertex positions are in pixel coordinates, (i.e. x and y coordinates ranging from 0-500, z coordinate from 0-100 in the example). When I import both the mesh and .tif using MicroscopyNodes, the two objects do not overlap - the scales are completely different and it appears that the MicroscopyNode volume is also centered differently. Can you explain how exactly MicroscopyNodes maps image pixel coordinates to blender coordinates? Could you explain how to customize the coordinate choice (for example the centering)?

Best,

Nikolas

oanegros commented 3 months ago

Hi! this makes a lot of sense and in the long run i want to have a version of the loading interface where you can append obj or ilp files, as i've seen this is also relevant for EM data hosted on EMPIAR, for example.

Until then, this is what Microscopy Nodes currently does:

The registration of your object may become more difficult if the bounds of the .obj are not the same as the size of the volume, and you may have to do some math to figure out the object scale vs volume scale if that makes sense.

To decenter the volume versus the empty parent that holds it, you can unlock the object position in the axes and volume objects, and then move them such that they are at a different location versus the holder. I considered for a while to have the location of the center of rotation settable, but thought that it would add too many extra import options.

I hope this helps!

nikolas-claussen commented 3 months ago

Thanks - this is the info I needed!

Nikolas

On Sun, Aug 11, 2024, 00:20 Oane Gros @.***> wrote:

Hi! this makes a lot of sense and in the long run i want to have a version of the loading interface where you can append obj or ilp files, as i've seen this is also relevant for EM data hosted on EMPIAR, for example.

Until then, this is what Microscopy Nodes currently does:

  • centers the object at (0.5, 0.5, 0)*shape of the object, meaning it centers the volume in x and y.
  • scales it to 0.02 and stretches for anisotropy. This can also be assessed in the Geometry Nodes window for the axes object, as this requires µm to blender-meter calculations.

I hope this helps!

— Reply to this email directly, view it on GitHub https://github.com/oanegros/MicroscopyNodes/issues/54#issuecomment-2282653380, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUTVVLAVAFTDY6MDT5KTN3ZQ4GD7AVCNFSM6AAAAABMD4DK2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBSGY2TGMZYGA . You are receiving this because you authored the thread.Message ID: @.***>