# Loading DeCA module

**URL:** <https://discourse.slicer.org/t/loading-deca-module/43237>\
**Category:** Support\
**Tags:** extensions-manager\
**Created:** [June 5, 2025, 3:35pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237 "2025-06-05T15:35:06Z")\
**Posts on this page:** 17\
**Page:** 2

<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:** [September 20, 2025, 5:47pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/21 "2025-09-20T17:47:50Z")

</div>

ANTs works with volumes, not 3D models. If you organize the original scans, and the landmarks that you created on the disk (not in the Slicer scene), you can create a volumetric template by using the Templates tab

I didn’t really have time to write a tutorial. There are some additional steps that are important to consider (e.g., selection of the initial template, or how to create one if there is no reference template). but give it a try as is, and if you think you find it useful, I can provide those points.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/1/912912d9db5c5dec3e819392b0ce16cbd51c1aae.png)

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 20, 2025, 5:52pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/22 "2025-09-20T17:52:13Z")

</div>

I will, because it looks good, and come back in touch  
Best

Envoyé de mon iPhone

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 20, 2025, 5:54pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/23 "2025-09-20T17:54:13Z")

</div>

If I succeed, I will write a tutorial 😄

Envoyé de mon iPhone

---

<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:** [September 20, 2025, 9:59pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/24 "2025-09-20T21:59:11Z")

</div>

Sounds good. Go ahead and proceed with using one of your actual samples as a reference. However, the more appropriate way would be to rigidly register all those samples into a common orientation (using groupwise tab), and average them at that space, and then use that to initialize the template building process.

That is not incorporated into the ANTsPY yet properly, but there is simple script that you can pretty much copy and edit the path to the rigidly aligned volumes, and paste it into the Python console in Slicer:

> <https://github.com/SlicerMorph/SlicerANTsPy/blob/main/Scripts/AverageImage.py>

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 21, 2025, 8:26am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/25 "2025-09-21T08:26:01Z")

</div>

Sorry I can’t find such a display as this one:

 ![PastedGraphic-1.png](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/d/cdb2e2bf3d4f068ef93ef7bbc32d1a0abbeff230.png)  
I tried to copy, as suggested , the above script, and paste it in the console, but I got an error message : hereafter you’ll find the log

import slicer

import ants

import os

import time

# Function to create a Slicer node from an ANTSImage

def nodeFromANTSImage(antsImage, name):

import ants

imageNode = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLScalarVolumeNode’, name)

tempFilePath = os.path.join(

slicer.app.temporaryPath,

“tempImage\_{0}.nii.gz”.format(time.time()),

)

ants.image\_write(antsImage, tempFilePath)

storageNode = slicer.vtkMRMLVolumeArchetypeStorageNode()

storageNode.SetFileName(tempFilePath)

storageNode.ReadData(imageNode, True)

os.remove(tempFilePath)

return imageNode

# Input directory of aligned images (such as from ANTs Registraion Groupwise Registration)

input\_directory = “D:/ANTsData/MouseOutputs”

# End pattern for selecting the transformed images from the input directory

filename\_end\_pattern = “transformed.nii.gz”

filePaths =

for file in os.listdir(input\_directory):

if file.endswith(filename\_end\_pattern):

filePaths.append(os.path.join(input\_directory, file))

averagedANTSImage = ants.math.average\_images(filePaths)

averagedImageNode = nodeFromANTSImage(averagedANTSImage, “AverageImage”)

slicer.util.setSliceViewerLayers(background=averagedImageNode, fit=True)

Traceback (most recent call last):

File “”, line 2, in

ModuleNotFoundError: No module named ‘ants’

> > >

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<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:** [September 21, 2025, 3:38pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/26 "2025-09-21T15:38:13Z")

</div>

What is the version of Slicer you are using and can you send a acreenshot of your antsRegistration module?

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 8:26am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/27 "2025-09-22T08:26:14Z")

</div>

I have previously tried with 3 different issues, and each time I get this menu(attached). Before I answer your mail, I downloaded the issue 5.9.0-2025-09-20 released yesterday, and I have the good menu. I will try to use it and will let you know.  
But, anyway, since the interest, for me, is to superpose the Normal skull with a skull of interest, only the models, with their edition and display abilities, are worthy, since the superposition of volume rendering is very difficult to read.  
If you wish to have a look at my work, you may have a good idea by watching this tutorial on YouTube [https://youtu.be/hJTWZDnqZ3k](https://youtu.be/hJTWZDnqZ3k)  
I may, as well, share a folder with the Atlas if you like. I wonder whether the Slicer community could be interested.  
Best regards, and, again, thanks for the nice tools that you provide. Best regards.

 ![5.9.0-2025-08-11.jpeg](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/5/250e16b8e19e25de36ba9594e029615a4899ed1e.jpeg)

philippe pellerin

[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 9:13am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/28 "2025-09-22T09:13:34Z")

</div>

I don’t understand. I had the good menu, then I restarted the application, and now it is back to the previous, incomplete menu!  
this is a grab screen

 ![PastedGraphic-1.png](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/5/e567df659c4c897ce7f587c9dfee13d1ed77ee61.png)

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 9:16am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/29 "2025-09-22T09:16:12Z")

</div>

I got the right menu back when I disable the other extensions…

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 22, 2025, 9:25am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/30 "2025-09-22T09:25:03Z")

</div>

Can you enable again the other extensions, start the application, and see what errors are in the Python console? It is possible that a previous error of another module prevented this one from being set up properly.

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 9:30am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/31 "2025-09-22T09:30:12Z")

</div>

This is what I copy from the console:

Python 3.12.10 (main, Sep 21 2025, 23:13:54) [Clang 14.0.6 ([https://github.com/tru/llvm-release-build](https://github.com/tru/llvm-release-build) 686807a176470032c208f27 on darwin

> > >

[VTK] Warning: In vtkSlicerTerminologiesModuleLogic.cxx, line 3351

[VTK] vtkSlicerTerminologiesModuleLogic (0x600000659400): LoadAnatomicContextFromFile is deprecated. Use LoadRegionContextFromFile instead.

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 9:44am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/32 "2025-09-22T09:44:39Z")

</div>

The problem is fixed when I disable the SlicerANTs extension

 ![PastedGraphic-1.png](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/5/f58941b19744ea619c94a0b340a45dda4cd55bb3.png)

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 22, 2025, 11:39am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/33 "2025-09-22T11:39:07Z")

</div>

This warning is harmless, it will not prevent anything.

Did you copy this with SlicerANTs enabled? There was nothing else?

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 22, 2025, 1:33pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/34 "2025-09-22T13:33:27Z")

</div>

Another error log in the console, if it could help

Python 3.12.10 (main, Sep 21 2025, 23:13:54) [Clang 14.0.6 ([https://github.com/tru/llvm-release-build](https://github.com/tru/llvm-release-build) 686807a176470032c208f27 on darwin

> > >

Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-33957/SlicerANTsPy/lib/Slicer-5.9/qt-scripted-modules/ANTsRegistration.py”, line 341, in setup  
self.ui.outputForwardTransformComboBox.connect(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
AttributeError: ‘’ object has no attribute ‘outputForwardTransformComboBox’. Did you mean: ‘outputTransformComboBox’?  
Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-33957/SlicerANTsPy/lib/Slicer-5.9/qt-scripted-modules/ANTsRegistration.py”, line 522, in enter  
self.initializeParameterNode()  
File “/Applications/Slicer.app/Contents/Extensions-33957/SlicerANTsPy/lib/Slicer-5.9/qt-scripted-modules/ANTsRegistration.py”, line 564, in initializeParameterNode  
self.setParameterNode(  
File “/Applications/Slicer.app/Contents/Extensions-33957/SlicerANTsPy/lib/Slicer-5.9/qt-scripted-modules/ANTsRegistration.py”, line 605, in setParameterNode  
self.updateGUIFromParameterNode()  
File “/Applications/Slicer.app/Contents/Extensions-33957/SlicerANTsPy/lib/Slicer-5.9/qt-scripted-modules/ANTsRegistration.py”, line 630, in updateGUIFromParameterNode  
self.ui.outputForwardTransformComboBox.setCurrentNode(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
AttributeError: ‘’ object has no attribute ‘outputForwardTransformComboBox’. Did you mean: ‘outputTransformComboBox’?

philippe pellerin  
[philippepellerin@me.com](mailto:philippepellerin@me.com)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [September 22, 2025, 2:35pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/35 "2025-09-22T14:35:33Z")

</div>

What is the difference between SlicerAnts and SlicerAntsPy? They both contain a qt-scripted-module that is a file name `antsregistration.py`. I could see how that may mess up some loading module logic.

I am able to replicate the above mentioned traceback where it is getting confused of `outputTransformComboBox` from SlicerAnts and `outputForwardTransformComboBox` of SlicerAntsPy.

---

<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:** [September 22, 2025, 3:09pm UTC](https://discourse.slicer.org/t/loading-deca-module/43237/36 "2025-09-22T15:09:47Z")

</div>

There is no reason to have AntsPy and Ants extensions simultaneously installed and I suspect thats the problem.

Antspy bring the full antspy package which is image quantification and segmentation libraries built on top of Ants. Ants extension only provides the AntsRegistration function.

While antspy does provide the same registration function we did not expose all possible parameters that one can possinbly pass to an ants registration call. So if the focus is single.pairwise registration, SlicerAnts extension is preferred.

If you need additional features such aa template building, groupwise, jacobian etc, you may use Antspy.

Having said that it might be good to have a check for ants extension checl in antspy and ask user to uninstall to use install antspy

@Sam_Horvath what do you think?

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [September 23, 2025, 9:21am UTC](https://discourse.slicer.org/t/loading-deca-module/43237/37 "2025-09-23T09:21:54Z")

</div>

I built a template with ANTsPY. It worked fine, but the final result, even after iterations, is a bit blurred, and I can’t find my usual landmarks to orient the volume. Thus, for my research, going through skull segmentation and model creation is a better path to analysing craniofacial malformation. But thanks for suggesting this idea.

[Previous page](https://discourse.slicer.org/t/loading-deca-module/43237.md?page=1)
