anatomist texture rendering no interpolation

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

anatomist texture rendering no interpolation

Post by pdeman »

Hi,
I am trying to do some rendering using MarsAtlas and when I open the volume, on the "line" between two parcels, the color is interpolated as shown on this image:
interpolation_between_parcels.png
interpolation_between_parcels.png (210.3 KiB) Viewed 18591 times
I have unchecked the option "interpolation on volumes" in anatomist, settings, preferences, volumes but doesn't change anything.
Is there an option to remove this interpolation somewhere?

and I have another question,
If I want a "red line" to delimitate MarsAtlas parcels (or any other parcelation) is there an option for that or not ?
I guess not.
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Re: anatomist texture rendering no interpolation

Post by Olivier Coulon »

Hello,
I m sorry but I don't see the problem with the interpolation ? It is displayed as it should to me... Nevertheless, the MarsAtlas viewer is setup to display like this. You're only option to change the texture interpolation is, in the main Anatomist window, to right click on the mesh+texture fusion, select 'color -> texturing' in the contextual menu, and unclick 'RGB space interpolation'.
About the red lines between parcels there is nothing like that in BrainVisa, sorry...

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: anatomist texture rendering no interpolation

Post by riviere »

Hi,

As Olivier said, the best simple option is to use RGB interpolation on label textures, but I think this is already done in your snapshot. OpenGL always performs interpolation, so using sharp edges to regions would require to duplicate mesh vertices at regions boundaries, and a texture with additional values for these duplicated vertices. So it would end up with a different mesh, requiring different textures. It would be feasible but thus would involve some complications for the user to manipulate them.

For your second question: is it possible to have a red line making regions boundaries, yes it is possible, but it's not directly integrated in Anatomist (yet). It can be done in a little python script, which will generate a wireframe mesh corresponding to the boundaries.

The python script would look like this:

Code: Select all

from soma import aims

mesh_filename = 'brain_mesh.gii'
regions_texture_filename = 'marsatlas_regions.gii'
boundaries_filename = 'marsatlas_boundaries.mesh'

mesh  = aims.read(mesh_filename)
regions_texture = aims.read(regions_texture_filename)
boundaries = aims.SurfaceManip.meshTextureBoundary(
    mesh.surface(), regions_texture, -1)
boundaries.header()['material'] =  {
    'diffuse': [1., 0., 0., 1.],
    'line_width': 3,
}
aims.write(boundaries, boundaries_filename)
To run the script, use the python within the BrainVisa distribution:

Code: Select all

<brainvisa_dir>/bin/bv_env python the_above_script.py
Running this script will write a "marsatlas_boundaries.mesh" file, that you can load in Anatomist and display in a 3D view, which can be the one displaying the textured mesh.

We could think of including this functionality in Anatomist for label textures, to avoid the need to running a little script...

Denis
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: anatomist texture rendering no interpolation

Post by pdeman »

thanks.

for the boundaries, the code make an error:
"*** AttributeError: 'AimsTimeSurface_3_VOID' object has no attribute 'surface'"

but it works fine if I do:

Code: Select all

boundaries = aims.SurfaceManip.meshTextureBoundary(mesh, regions_texture, -1)
(without the .surface())
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: anatomist texture rendering no interpolation

Post by pdeman »

it worked fine on the Lwhite Lwhite_marsatlas.
image1.jpg
image1.jpg (116.83 KiB) Viewed 18570 times
but it doesn't work on the inflatedLwhite Lwhite_maratlas.
inflated_mesh_boundaries.jpg
inflated_mesh_boundaries.jpg (53.34 KiB) Viewed 18570 times
I don't get it ...
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: anatomist texture rendering no interpolation

Post by riviere »

It should work exactly the same way. Are you sure you have used the script using compatible mesh and ROI texture ?
(anyway the inflated mesh should have the same structure as the non-inflated one, so it should work using the same marsatlas texture)
Denis
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: anatomist texture rendering no interpolation

Post by pdeman »

i know it should work exactly the same :)
yes mesh and roi texture are compatible as you can see on the second picture, the left side, the fusion between the inflated mesh and mars atlas texture worked well. I am using the same marsatlas texture for the inflated one and the non inflated one. for the fusion it works perfectly. but not for the boundaries generation.
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: anatomist texture rendering no interpolation

Post by riviere »

Could you send me the mesh and texture so that I can look at it?
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: anatomist texture rendering no interpolation

Post by pdeman »

so solved, as you find, another process modified the .gii and I didn't notice it ... sorry
Post Reply