# Unable to run PlaceSemiLMPatches due to missing function?

**URL:** <https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048>\
**Category:** Support\
**Tags:** markups-fiducials, slicermorph\
**Created:** [April 21, 2023, 2:20pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048 "2023-04-21T14:20:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria\_Feiler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/maria_feiler/32/17300_2.png) [@Maria\_Feiler](https://discourse.slicer.org/u/Maria_Feiler)\
**Post date:** [April 21, 2023, 2:20pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/1 "2023-04-21T14:20:26Z")

</div>

@muratmaga There seems to be an issue concerning the PlaceSemiLMPatches module in SlicerMorph. I have organized my files as described in the help files, but I receive the following errors when trying to place my patches on the rest of the specimens.

> Traceback (most recent call last):
> 
> File “C:/Users/maria/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerMorph/lib/Slicer-5.0/qt-scripted-modules/PlaceSemiLMPatches.py”, line 176, in onApplyButton
> 
> ```
> logic.run(self.meshDirectory.currentPath, self.landmarkDirectory.currentPath, self.gridFile.currentPath,
> 
> ```
> 
> File “C:/Users/maria/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerMorph/lib/Slicer-5.0/qt-scripted-modules/PlaceSemiLMPatches.py”, line 216, in run
> 
> ```
> landmarkNumber=landmarkNode.GetNumberOfControlPoints()
> 
> ```
> 
> AttributeError: ‘list’ object has no attribute ‘GetNumberOfControlPoints’

Here is a [google drive folder](https://drive.google.com/drive/folders/1je5I-RH2fXHzEYzQaK6m_iSQgmPq5j7y?usp=share_link) of a few representative specimens and landmarks organized as I have on my computer. The patch template was created on specimen W037. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 21, 2023, 3:00pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/2 "2023-04-21T15:00:01Z")

</div>

Thank you for reporting. I can repllicate the issue. Will post an update when we fix it.  
@smrolfe

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [April 21, 2023, 7:15pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/3 "2023-04-21T19:15:55Z")

</div>

@Maria_Feiler Thanks, we have fixed this issue on our [repo](https://github.com/SlicerMorph/SlicerMorph). You can update from there, or from the extension manager after the next nightly build.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 21, 2023, 7:26pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/4 "2023-04-21T19:26:36Z")

</div>

@Maria_Feiler

I noticed that you are using an old stable (5.0.3). Please switch to the newest stable (5.2.2) and then download the slicermorph extension tomorrow. With the stable versions, you can easily update the SlicerMorph to its latest version, but this is only available for the most recent stable build (which is 5.2.2).

---

<div class="post-metadata">

**Author:** ![Maria\_Feiler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/maria_feiler/32/17300_2.png) [@Maria\_Feiler](https://discourse.slicer.org/u/Maria_Feiler)\
**Post date:** [April 24, 2023, 11:50pm UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/5 "2023-04-24T23:50:53Z")

</div>

Thank you @muratmaga and @smrolfe for giving this a look! Unfortunately, there seem to be more problems with the program even with the most updated Slicer and SlicerMorph. When I run the program using the files in the folder shared previously, it runs but places the patches in seemingly random places. I even tried making a new grid connectivity file using patches near the incisors, but it placed the patches on the top of the head (even for the reference specimen). Any ideas?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 25, 2023, 2:20am UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/6 "2023-04-25T02:20:48Z")

</div>

This is what I got from your samples (W037). It seems correct to me. This is slicer 5.2.2 on windows, after updating the SlicerMorph extension.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/9/d9de7d5326c382ec08d014a3051e67038fdb1020.jpeg)

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 25, 2023, 2:21am UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/7 "2023-04-25T02:21:52Z")

</div>

Also if you are going to use this many semiLMs, perhaps consider using PseudoLMgenerator, which will allow you more uniformly sample. Then you can use the ProjectSemiLMPatches (insted of placepatches you are using) to transfer them.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 25, 2023, 2:30am UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/8 "2023-04-25T02:30:09Z")

</div>

We have an SlicerMorph online office hour tomorrow at 11 (PT), where we can take a look if it works for you. DM me or email for link if you want to attend.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 25, 2023, 4:13am UTC](https://discourse.slicer.org/t/unable-to-run-placesemilmpatches-due-to-missing-function/29048/9 "2023-04-25T04:13:27Z")

</div>

Here is an example. Takes about 3 minutes or so… You can sample more or less densely, and remove the unnecessary/unwanted points (such as on teeth) with markupsEditor plugin.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fcdd13c8b49c1b567f5e2081f0bd08cd0e7003e8.jpeg)
