# How can I import the mesh created in comsol to the nirfast ?

**URL:** <https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669>\
**Category:** Support\
**Created:** [March 24, 2022, 1:04pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669 "2022-03-24T13:04:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantu](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dantu](https://discourse.slicer.org/u/dantu)\
**Post date:** [March 24, 2022, 1:04pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/1 "2022-03-24T13:04:05Z")

</div>

Operating system:window10  
Slicer version:2.0.0  
Expected behavior:use the mesh created in comsol to compete image reconstruction  
Actual behavior:there’s no where to import the data

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 26, 2022, 3:32am UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/2 "2022-03-26T03:32:47Z")

</div>

What file formats can you export from comsol?

---

<div class="post-metadata">

**Author:** ![dantu](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dantu](https://discourse.slicer.org/u/dantu)\
**Post date:** [March 28, 2022, 5:37am UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/3 "2022-03-28T05:37:35Z")

</div>

it can impport the ‘txt’ which includes element and node, but the NIRFAST needs element,node and ‘param.’ which displays optical parameter distribution .

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 28, 2022, 12:24pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/4 "2022-03-28T12:24:04Z")

</div>

Do you want to load Slicer segmentation results into comsol, or you want to load comsol simulation results into Slicer?

---

<div class="post-metadata">

**Author:** ![dantu](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dantu](https://discourse.slicer.org/u/dantu)\
**Post date:** [March 28, 2022, 12:37pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/5 "2022-03-28T12:37:28Z")

</div>

i want to load comsol mesh into the software ‘NIRFAST’

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 28, 2022, 1:16pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/6 "2022-03-28T13:16:37Z")

</div>

Slicer can load volumetric meshes from VTK unstructured grid files (.vtk and .vtu extensions).

[NIRFAST Slicer](https://github.com/nirfast-admin/NIRFASTSlicer/tree/v2.0.0) (which is a customized build of Slicer with some additional modules) does not seem to have additional mesh importers.

Therefore, you probably need to use a mesh converter, such as [meshio](https://pypi.org/project/meshio/) to convert comsol output mesh to vtk/vtu file.

---

<div class="post-metadata">

**Author:** ![dantu](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dantu](https://discourse.slicer.org/u/dantu)\
**Post date:** [March 28, 2022, 1:32pm UTC](https://discourse.slicer.org/t/how-can-i-import-the-mesh-created-in-comsol-to-the-nirfast/22669/7 "2022-03-28T13:32:23Z")

</div>

i see! thank you very very much! i will have a try.
