This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How can i convert an image .tiff in a dolfin xml?

0 votes

Hi,

I need to convert an image .tiff (or .png, .jpg etc) in a dolfin xml.
Is it possible?

I tried with:

os.system('dolfin-convert brain.tiff brain.xml')
mesh = Mesh ("brain.xml")

but i received

*** Sorry, unknown suffix tiff.

Kind regards
Valentina

asked May 28, 2015 by ValeS FEniCS Novice (330 points)
edited May 28, 2015 by ValeS

1 Answer

+1 vote
 
Best answer

You cannot convert a image directly into a mesh.
If it is an object from the image you want to simulate on, then you first have to locate the object on the image, then make a mesh on the object.
If you would use gmsh for that, you first have to create a .geo file, with points and lines for the boundary of your object then create a .msh file which contains the mesh and in the end you can use the dolphin-convert to convert it into a .xml file.

answered May 28, 2015 by christianv FEniCS User (2,460 points)
selected May 31, 2015 by Garth N. Wells

Is there any way to automate the procedure of 'meshing', if I have an image .tiff (or .jpg, .png etc.)?

There is no automated procedure right now. I'm corrently working on a project, where I implemented the Chan-Vese algorithm to segment the image, and afterwards used gmsh to make the mesh.
See http://www.christianvaldemar.dk for further reading.

...