# Image calculator

**URL:** <https://discourse.slicer.org/t/image-calculator/40035>\
**Category:** Development\
**Tags:** extensions\
**Created:** [November 5, 2024, 11:46am UTC](https://discourse.slicer.org/t/image-calculator/40035 "2024-11-05T11:46:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashkanpakzad](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ashkanpakzad/32/77482_2.png) [@ashkanpakzad](https://discourse.slicer.org/u/ashkanpakzad)\
**Post date:** [November 5, 2024, 11:46am UTC](https://discourse.slicer.org/t/image-calculator/40035/1 "2024-11-05T11:46:48Z")

</div>

Hi all,

My first post, thanks for all the good work. I’m keen to get involved.

I was wondering if anyone has developed in Slicer something like ImageJ/FIJI’s ‘image calculator’?

 ![images](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/f/af44e8779061d8e5ddad9d1067ce183c3f41b56d.jpeg)

Which would allow the user to manipulate images by mathematical operators with a scalar or image? (I appreciate image and image operations are not necessarily trivial e.g. different array sizes and orientations etc.)

I suppose users with know-how would just do this programmatically.

I’m only so far aware of a module that allows to multiply 2 images together “Multiply Scalar Volumes”.

If it dosen’t exist, I would make a mock up. is it something that the community would consider useful?

Cheers,  
Ashkan

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [November 5, 2024, 1:12pm UTC](https://discourse.slicer.org/t/image-calculator/40035/2 "2024-11-05T13:12:14Z")

</div>

There are several modules like this in Slicer. Let us know if there’s a specific operation you can’t find.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/6/86734c5382bbb6357ed155a8f66a9ed7c0fae680.jpeg)

SimpleFilters exposes a huge list of operations.

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

---

<div class="post-metadata">

**Author:** ![ashkanpakzad](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ashkanpakzad/32/77482_2.png) [@ashkanpakzad](https://discourse.slicer.org/u/ashkanpakzad)\
**Post date:** [November 5, 2024, 11:16pm UTC](https://discourse.slicer.org/t/image-calculator/40035/3 "2024-11-05T23:16:08Z")

</div>

This is great thank you and I can see exposes SimpleITK filters for image and image operations. However, it dosent seem to allow image and scalar operations e.g. `Image * 10`.

Though it appears possible by the [documentation](https://simpleitk.org/doxygen/v2_4/html/classitk_1_1simple_1_1MultiplyImageFilter.html) `Execute (const Image &image1, double constant)`

---

<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:** [November 5, 2024, 11:45pm UTC](https://discourse.slicer.org/t/image-calculator/40035/4 "2024-11-05T23:45:34Z")

</div>

Most people use python for that:

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#add-noise-to-image](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#add-noise-to-image)
