# How to run cast scalar volume module from command line

**URL:** <https://discourse.slicer.org/t/how-to-run-cast-scalar-volume-module-from-command-line/17595>\
**Category:** SlicerDMRI\
**Created:** [May 12, 2021, 1:39pm UTC](https://discourse.slicer.org/t/how-to-run-cast-scalar-volume-module-from-command-line/17595 "2021-05-12T13:39:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shael](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@shael](https://discourse.slicer.org/u/shael)\
**Post date:** [May 12, 2021, 1:39pm UTC](https://discourse.slicer.org/t/how-to-run-cast-scalar-volume-module-from-command-line/17595/1 "2021-05-12T13:39:37Z")

</div>

Hi community,

I’m trying to run the Cast Scalar Volume module from the command line to convert a nifti brain mask into a uchar nrrd file format. I can successfully run the command from the Slicer GUI, and when I click on the red X button to see the commands Slicer ran, I get the following:

```auto

Found CommandLine Module, target is C:/Users/User/AppData/Local/NA-MIC/Slicer_4.11.20200930/bin/../lib/Slicer-4.11/cli-modules/CastScalarVolume.exe
ModuleType: CommandLineModule
Cast Scalar Volume command line: 

C:/Users/User/AppData/Local/NA-MIC/Slicer_4.11.20200930/bin/../lib/Slicer-4.11/cli-modules/CastScalarVolume.exe --type UnsignedChar C:/Users/User/AppData/Local/Temp/Slicer/BAHDC_vtkMRMLScalarVolumeNodeB.nrrd C:/Users/User/AppData/Local/Temp/Slicer/BAHDC_vtkMRMLScalarVolumeNodeB.nrrd 

Cast Scalar Volume completed without errors

```

I’m working on a 64bit Windows 10 machine, and using powershell for the command line. So if my path to the executable is path/to/exectuable/CastScalarVolume.exe, my input file is path/to/input/input.nii, and my desired output uchar file is path/to/output/output.nrrd, what should I run from the command line?

Thanks so much everyone!!

---

<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:** [May 12, 2021, 8:47pm UTC](https://discourse.slicer.org/t/how-to-run-cast-scalar-volume-module-from-command-line/17595/2 "2021-05-12T20:47:23Z")

</div>

Check out this example running [CastScalarVolume from the command line](https://www.slicer.org/wiki/Documentation/Nightly/Developers/FAQ#How_to_call_a_CLI_module_from_command-line.3F). You can also get the parameter names for CLI modules using a [few lines of Python](https://slicer.readthedocs.io/en/latest/developer_guide/python_faq.html#get-list-of-parameter-names) in the Python interactor.

---

<div class="post-metadata">

**Author:** ![shael](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@shael](https://discourse.slicer.org/u/shael)\
**Post date:** [May 14, 2021, 6:53pm UTC](https://discourse.slicer.org/t/how-to-run-cast-scalar-volume-module-from-command-line/17595/3 "2021-05-14T18:53:21Z")

</div>

Hi Sara,

Worked like a charm! Thanks so much.

Best,  
Shael
