# Alpaca template selection K-means

**URL:** <https://discourse.slicer.org/t/alpaca-template-selection-k-means/45963>\
**Category:** Support\
**Tags:** slicermorph\
**Created:** [January 28, 2026, 8:50am UTC](https://discourse.slicer.org/t/alpaca-template-selection-k-means/45963 "2026-01-28T08:50:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_Collins](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stephan_collins/32/81446_2.png) [@Stephan\_Collins](https://discourse.slicer.org/u/Stephan_Collins)\
**Post date:** [January 28, 2026, 8:50am UTC](https://discourse.slicer.org/t/alpaca-template-selection-k-means/45963/1 "2026-01-28T08:50:28Z")

</div>

Dear all, there’s something I did not understand in the ALPACA workflow.  
The plos one paper clearly explains the benefits of doing K means clustering and choosing templates that best match subgroups of data relative to a completely blind approach using multiple source models.  
But once you have identified the groups and which samples you should use for malpaca, malpaca will figure out wich samples to choose for both source and target automatically or are you supposed to create folders and run malpaca manually for each subgroup (I suppose so) ?

And again, well done to all for an amazing software (slicer) and module (slicermorph) !

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [January 28, 2026, 3:52pm UTC](https://discourse.slicer.org/t/alpaca-template-selection-k-means/45963/2 "2026-01-28T15:52:21Z")

</div>

> [@Stephan\_Collins](#):
>
> you supposed to create folders and run malpaca manually for each subgroup (I suppose so) ?

Yes, You need to copy and paste those models and corresponding set of landmarks into appropriate folder structure (Source\_LMs, and Source\_Models) and set MALPACA that way.
