# Smooth object along only vertical axis

**URL:** <https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892>\
**Category:** Support\
**Created:** [December 5, 2020, 5:51am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892 "2020-12-05T05:51:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuckyLuke](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luckyluke/32/8756_2.png) [@LuckyLuke](https://discourse.slicer.org/u/LuckyLuke)\
**Post date:** [December 5, 2020, 5:51am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/1 "2020-12-05T05:51:20Z")

</div>

I saw this post a month ago or so and I am wondering about the same thing:

> [@Smoothing effect only in 1 axis](https://discourse.slicer.org/t/smoothing-effect-only-in-1-axis/14613):
>
> is it possible to have smoothing effect only affect the one axis, the one that vertically goes through slices. In other words, if the resolution of a slice is good but slices were spaced a lot, if the 2mm or 3mm smooth is applied, it affects all directions, that way resolution in the slice is sadly lost. so is there an option to smooth only 1 direction? for example add extra slices between these and make a voxel through interplation Or somehow manouver 3D models to be smoothen only in 1 di…

I have horizontal images in really nice resolution but they are spaced quite a lot 2mm!

Now interest is to preserve the horizontal details but somehow smoothen the transition in one axis from one slice to another.

That way it will not look like a stacked one upon another high res images but indeed will look like 1 model. Sure details will theoretically alwazs be missing in that axis but who cares if it looks nice?! right?

However this what Mustafa wrote is not understandable for me.

HE mentioned some “simple filters” what is that?

And what does he mean by a “scalar” volume?

---

<div class="post-metadata">

**Author:** ![LuckyLuke](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luckyluke/32/8756_2.png) [@LuckyLuke](https://discourse.slicer.org/u/LuckyLuke)\
**Post date:** [December 5, 2020, 5:51am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/2 "2020-12-05T05:51:26Z")

</div>

As Murat has suggested I am trying to use smart filters but I have no idea which median or gaussian filter to choose in order to smooth object in one axis only.

also have no idea where do I select the axis?

muratmaga, please assist!?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/2/42be5bcc83eac7b18b689e1d58d55431b09aa87f.png)

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 6:09am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/3 "2020-12-05T06:09:59Z")

</div>

I think you are from the same dormitory as I am.

I think I figured out the way in 3ds max how to do this… to lock the information in 2 axis and just modify objects in 1 axis. But one would require license and where I do internship not allowed to use illegal license software.

Are you doing the same internship?

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 6:10am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/4 "2020-12-05T06:10:33Z")

</div>

I am not sure what muratmaga was saying about croping volume is true.

---

<div class="post-metadata">

**Author:** ![LuckyLuke](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luckyluke/32/8756_2.png) [@LuckyLuke](https://discourse.slicer.org/u/LuckyLuke)\
**Post date:** [December 5, 2020, 6:18am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/5 "2020-12-05T06:18:03Z")

</div>

yes I am on the third floor.

I think we were given similar datasets

---

<div class="post-metadata">

**Author:** ![LuckyLuke](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luckyluke/32/8756_2.png) [@LuckyLuke](https://discourse.slicer.org/u/LuckyLuke)\
**Post date:** [December 5, 2020, 6:19am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/6 "2020-12-05T06:19:44Z")

</div>

Problem with that is quite a lot of effort to imoprt and export modify.

Maybe something about filters he was saying would be of help.

Also I don’t like 3ds max paid solutions, I prefer open source alternatives if they exist. Always support open source.

---

<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:** [December 5, 2020, 6:30am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/7 "2020-12-05T06:30:17Z")

</div>

As you can see there are three radius fields, one for each axis. If you want to smooth only in the Z direction. Enter 0,0, and whatever the radius you want for Z.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 5, 2020, 6:42am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/8 "2020-12-05T06:42:54Z")

</div>

I gave a solution [here](https://discourse.slicer.org/t/smoothing-effect-only-in-1-axis/14613/13) that preserves all details in-plane and interpolates smoothly in between. I would recommend to use this very carefully, because it may make the result look higher resolution than it actually is and therefore potentially mislead users.

The correct solution is to acquire proper images that contain all the details you need.

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:04am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/9 "2020-12-05T07:04:52Z")

</div>

I am trying to do this but volume is missing in the drop down menu

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/0/10d2cc90edb6bbdc5156108fe301c2fbe8b32147.png)

In the data I have loaded it in twice though

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/c/dc410d2e8af13b95f1c172d06c1dd561eaaa6451.png)

What could be the problem?

---

<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:** [December 5, 2020, 7:05am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/10 "2020-12-05T07:05:57Z")

</div>

You chose a binaryFilter, which I presume expects a labelmap. Is your volume a labelmap?

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:08am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/11 "2020-12-05T07:08:03Z")

</div>

Helo Lassoan, since I was unable to get the SmartFilters to work yet, I can not tell exactly if I want this solution or not.

My main objective is exactly that, once exported as OBJ, it should look prettier. Whether information in between is missing or not is completely irrelevant for this case.

But I don’t know what these “filters” are since can’t get them to run. Maybe they are just some illusion and once exported as OBJ it would still look the same?!

First have to try to make this SmartFilters work but yes, what you have described is exactly what I need, the problem is that images are not segmented manually but with threshold. We cannot tell threshold to skip the slices gained through interpolation.

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:11am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/12 "2020-12-05T07:11:00Z")

</div>

no, it is a simple png sequences processed somewhere to have only the organ of interest and background is white.

I loaded it tried it nothing appears.  
Loaded it as nrrd tried it nothing appears  
changed filter to image filter, still not there

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 5, 2020, 7:12am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/13 "2020-12-05T07:12:55Z")

</div>

Don’t worry about the filters, you don’t need them (they would produce much worse looking result). Just insert blank slices between the segmented ones, convert to segmentation, and fill the gaps using “Fill between slices”.

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:13am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/14 "2020-12-05T07:13:55Z")

</div>

sounds like a good idea! I would need a script that would create blank slices! That is a great solution but can be achieved!! Thank you so much. That will be it indeed.

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:16am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/15 "2020-12-05T07:16:04Z")

</div>

I can not choose which slice spacing to make because these scans were already made and images processed somehow for some purposes. I am just doing my part here and then have to present a couple of dozens of segmentations somewhere and that is it. Normally I do not need to make them look pretty.

---

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [December 5, 2020, 7:24am UTC](https://discourse.slicer.org/t/smooth-object-along-only-vertical-axis/14892/16 "2020-12-05T07:24:45Z")

</div>

I will do what you said but it would require much more ram and dealing with preprocessing those pngs 🙂 but yes what you have shown is exactly what I need, thank you million times over.
