FEM Mesh Analysis & Visualization in Model Module

FEM Mesh Analysis & Visualization in Model Module (refers below picture :-))

in other words, for example.

each mesh, i want to calculate mesh volume and display different color corresponding to the volume.

Does “Information” section shows the correct volume?
You can color each mesh using a solid color (Display/Visibility/Color) or you can use scalars to color different parts of a model with different colors.

Does “Information” section shows the correct volume?
==> yes^^

You can color each mesh using a solid color (Display/Visibility/Color)
==> all of the mesh was drawn by same color ^^;
i want to color each mesh with different color.
each mesh, i want to calculate mesh volume and display different color corresponding to each mesh(not all of the mesh)

    i think that Threshold in Scalars section can be used to calcuate color(0~255)
    i am now finding the source code related to this issue.

I found source code inqMRMLModelDisplayNodeWidget.cxx.
in this source code. i can calcuate and set the color on each mesh from the input of Value in Model Display Widget UI ex. Threshold(Scalors section)

You can assign a color to each mesh cell or point by assigning a scalar array to them and then configuring coloring in Models module’s Scalars section.

1 Like

Scalar Array? for example?
It means only editing Scalar Section in Model module can differentiate color each mesh or point?

Normally you assign scalar values to points or cells of your mesh when generate the mesh (e.g., you can have a scalar attribute to specify material or a physical quantity).

How did you generate the mesh?

How did you generate the mesh?
==>Tetzen(Segment Mesher) on segmented surface of Brain Volume^^. I described in detail. plz refer below texts

Normally you assign scalar values to points or cells of your mesh when generate the mesh (e.g., you can have a scalar attribute to specify material or a physical quantity).
==> i am now reading manual_tezen.pdf :slight_smile: Would u plz introduce using Scalar Array by example code? . My Mesh Analysis is related with Laplacian Equation, so i want to calculate laplacian function on each mesh cell(or point)

You can assign a color to each mesh cell or point by assigning a scalar array to them and then configuring coloring in Models module’s Scalars section.
==> I found it Scalars section, Active Scalar
image

===========================================================

Finite Element Mesh Generation & Visualization for Brain Volume Analysis

Input : Brain MR Volume

Output : FE Mesh Generation

Workflow :
1.DICOM Import
2.Segment Editor
3.Segment Mesher
4.Models

After 1.DICOM Import

2.Segment Editor -> Choose Interested RT Structure(Surface Segment)


image

3.Segment Mesher -> Meshing method(TetGen) -> Apply

4.Models

You need to use Cleaver to generate multi-material meshes.

Tetgen could probably generate multi-material meshes too, but since it seemed quite complicated to set it up, and Tetgen had some stability issues, and comes with restrictive (GPL-type or commercial) license, we did not spend much time with improving Tetgen support. Cleaver works nicely, supports multiple materials, and freely usable, with non-restrictive license.

Thank you so much, i am now reading cleaver mesh rendering process

Normally you assign scalar values to points or cells of your mesh when generate the mesh

(e.g., you can have a scalar attribute to specify material or a physical quantity).
==> How can i set a scalar attribute… would introduce sample code(or workflow). i want to set individual color on each mesh(or point) by scalar array eg. laplacian equation y=ax+b )

(i didn’t find the corresponding source code or document )

You can use vtkArrayCalculator or add a point or cell array and set its values from Python. See how you can get read/write access to point coordinates and point arrays here.

I will do it. and Let it share in this page^^

I have found python script code written by you(Andras Lasso).
But. It has some problem.
I am now checkout latest slicer version .

Would u introduce modification point for all of the mesh, not some mesh?



i have found error message when i use Cleaver instead of Tetzen at preview release. it


I’ve tried this on latest preview release and worked well. Please first follow steps described in the tutorial and let us know if you run into any problems. If everything works well with the tutorial data set then you try with your data set and let us know how it worked.

I will do it from your instruction. and let us know how it worked. Thanks.

I’ve tried this on latest preview release and worked well. Please first follow steps described in the tutorial and let us know if you run into any problems. If everything works well with the tutorial data set then you try with your data set and let us know how it worked.
==> it is working now. but my goal is coloring different color and attaching the cube on the mesh surface like below pictures^^.
anyway very interesting but hard :-). i will try coloring different color now.

image

Is it possible to display like below picture not second picture?
keyword : surface mesh representation

You can do that by using Segment Editor module (before FEM mesh generation). You can grow a shell on the skin using “Hollow” effect, then cut out rectangular shapes using “Scissors” effect.

You can hide the background mesh in Models module / Display / Scalars section, enable Threshold and set lower value to 1.