# Could use a model like \*.vtk or \*.obj as the input of SPHARM?

**URL:** <https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599>\
**Category:** SlicerSALT\
**Created:** [July 17, 2020, 2:28pm UTC](https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599 "2020-07-17T14:28:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoda0612](https://avatars.discourse-cdn.com/v4/letter/y/a8b319/32.png) [@Yoda0612](https://discourse.slicer.org/u/Yoda0612)\
**Post date:** [July 17, 2020, 2:28pm UTC](https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599/1 "2020-07-17T14:28:53Z")

</div>

I would like to obtain the spherical harmonic coefficients for a model.  
However, SPHARM ask me to input the binary image or vtk model with para model.  
I just have a model without para model.  
How could I obtain spherical harmonic coefficients by using SPHARM?

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [July 17, 2020, 5:16pm UTC](https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599/2 "2020-07-17T17:16:26Z")

</div>

You will need to first generate label voxel representation from your surface mesh using the “Model to Label Map” or “Mesh To Label Map” module (they operate slightly differently, and I have found that if one does not work well, then the other does, but neither works for all settings).

Martin

---

<div class="post-metadata">

**Author:** ![Yoda0612](https://avatars.discourse-cdn.com/v4/letter/y/a8b319/32.png) [@Yoda0612](https://discourse.slicer.org/u/Yoda0612)\
**Post date:** [July 20, 2020, 7:51am UTC](https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599/3 "2020-07-20T07:51:39Z")

</div>

Dear Martin,

Thanks.

I used “Mesh To Label Map” and used the output volume as the input of GenParaMesh, I received errors.

I checked the output volume, nothing inside.  
Regarding “Model to Label Map”, it ask me to specify another volume as the input.  
I don’t know how to specify this volume.

Regards  
Cheng

Martin Styner via 3D Slicer Community \<[slicer@discoursemail.com](mailto:slicer@discoursemail.com)\> 於 2020年7月18日 週六 上午2:26寫道：

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [July 27, 2020, 9:15pm UTC](https://discourse.slicer.org/t/could-use-a-model-like-vtk-or-obj-as-the-input-of-spharm/12599/4 "2020-07-27T21:15:51Z")

</div>

For “Model to Label Map”, you need to first create (e.g. using Slicer) an input volume that fits with your surface.  
You may actually be able to generate that input volume via the “Mesh To Label Map” module. Load the volume that was generated (and is empty, according to your email) and see whether the surface is inside the volume (using Slicer and select “show slice intersections” in the “models” module). Also, did you make sure to use appropriate settings for “Model to Label Map" (i.e. sufficiently fine spacing)?

Martin
