Save a 2D image from a planar, rectangular mesh, and a texture
The goal is to get rid of the mesh triangular structure and to get to an image pixels grid.
To do so, a rendering of the textured mesh will be done in Anatomist, a snapshot is taken from it, and the resulting image will be saved.
The RGB mode (which is actually RGBA) will save the pixels of the snapshot without changing them.
The non-RGB mode will use the pixels intensities to map the values back into the input texture values space. But in the process, two unwanted phenomenons will happen:
- Values quantization: RGB pixels intensities are 8 bit ints in the range 0-255, so values will be rounded to these 256 values, then scaled back into the input values space. It should be possible to improve this by rendering a "depth map" (a mesh with vertices depth changed to that of the texture) and by using a snapshot of the depth buffer, which also suffers quantization effects but with a higher resolution.
- Values interpolation: colors are interpolated in the OpenGL rendering (either in palette space or in RGB space), so a "label texture" with int values will get intermediate values. We don't have a simple solution for that.
flat_texture: Texture ( entrée )
flat_mesh: Rectangular flat mesh ( entrée )
image_2d: 2D Image ( sortie )
width: Entier ( input )
height: Entier ( input )
rgb_interpolation: Booléen ( input )
output_rgb_image: Booléen ( input )
palette: String ( input )
background_value: Réel ( input )
keep_aspect_ratio: Booléen ( input )
Toolbox : Surface corticale
Niveau d'utilisateur : 2
Identifiant :
flatmap_image
Nom de fichier :
brainvisa/toolboxes/cortical_surface/processes/anatomy/tools/flatmap_image.py
Supported file formats :
flat_texture :GIFTI file, GIFTI file, Textureflat_mesh :GIFTI file, GIFTI file, Maillage MESH, MNI OBJ mesh, PLY mesh, Maillage TRI, Z compressed GIFTI file, Z compressed GIFTI file, Z compressed MESH mesh, Z compressed MNI OBJ mesh, Z compressed PLY mesh, Z compressed TRI mesh, gz compressed GIFTI file, gz compressed GIFTI file, gz compressed MESH mesh, gz compressed MNI OBJ mesh, gz compressed PLY mesh, gz compressed TRI meshimage_2d :gz compressed NIFTI-1 image, BMP image, DICOM image, Répertoire, ECAT i image, ECAT v image, FDF image, GIF image, GIS image, JPEG image, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, TIFF image, TIFF(.tif) image, VIDA image, XBM image, XPM image, gz compressed MINC image, gz compressed NIFTI-1 image