# Script for resampling scalar volumes

**URL:** <https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717>\
**Category:** Support\
**Tags:** python, resample, cli\
**Created:** [November 22, 2021, 12:01am UTC](https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717 "2021-11-22T00:01:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nthach17](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nthach17](https://discourse.slicer.org/u/nthach17)\
**Post date:** [November 22, 2021, 12:01am UTC](https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717/1 "2021-11-22T00:01:26Z")

</div>

Hello,

I’m new to the developer aspect of 3D Slicer and would like to compile a Python script for resampling batch of scalar volumes. While looking at the documentation for the ResampleVolume module, [Modules:ResampleVolume-Documentation-3.6 - Slicer Wiki](https://www.slicer.org/wiki/Modules:ResampleVolume-Documentation-3.6), I noticed that it was written in C++ and its module type is CLI. So my question is: How can I have access to this module from my Python script? Or probably a more suitable question: How should I compile script for CLI modules in general?

Best regards

---

<div class="post-metadata">

**Author:** ![Alex\_Vergara](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alex_vergara/32/15205_2.png) [@Alex\_Vergara](https://discourse.slicer.org/u/Alex_Vergara)\
**Post date:** [November 22, 2021, 9:52am UTC](https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717/2 "2021-11-22T09:52:45Z")

</div>

You can do something similar to what I do in my module. See [OpenDose3D/Logic/OpenDose3DLogic.py · develop · OpenDose / SlicerOpenDose3D · GitLab](https://gitlab.com/opendose/opendose3d/-/blob/develop/OpenDose3D/Logic/OpenDose3DLogic.py#L571)
