# Denosing filter gives different result based on volume size

**URL:** <https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275>\
**Category:** Support\
**Created:** [November 23, 2019, 2:15am UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275 "2019-11-23T02:15:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [November 23, 2019, 2:15am UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/1 "2019-11-23T02:15:07Z")

</div>

Hi, in an attempt to get a preview of what CurvatureAnisotropicDiffusion will produce with less processing time i tried to run it in on a cropped volume to serve as a sample, however the final result on the complete volume (with the same parameters) is a lot stronger and produces a blurry image.  
is there any way to predict the target parameters(conductance and time step) relative to those of a smaller volume based on their size difference? or is there any way to preview what a filter will produce?  
The only way i could produce a sufficiently close preview was by setting the cropping roi to cover the full axial plane and a thick (40+ voxel) vertical axis, wich still takes a lot of time to compute  
Thanks for any inputs.

 ![Capture](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/6/f6db27073f75892757c4a51a66af847c078d122d.jpeg)

---

<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 23, 2019, 9:08pm UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/2 "2019-11-23T21:08:11Z")

</div>

I suspect that’s probably inherent in the algorithm itself. Slicer just exposes the basic ITK class, so you might try asking on the ITK forum. Perhaps there’s a way to compensate.

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [November 23, 2019, 10:54pm UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/3 "2019-11-23T22:54:05Z")

</div>

Thanks for your answer.  
Indeed, only hoped that someone here would have experience with this issue first, i asked on itk forum.  
If this works well it could help many users. I made a module to preview more than 40 different filter strenghts using a slider to interactively evaluate the output blurriness then apply the most appropriate one on the full volume (and the computing time is less than a minute for all of them).  
Applying the selected stenght is the only remaining issue.

---

<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 26, 2019, 1:30am UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/4 "2019-11-26T01:30:33Z")

</div>

Sounds like a neat module! I saw your post on the ITK list. I hope you get a good response there.

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [November 26, 2019, 12:47pm UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/5 "2019-11-26T12:47:59Z")

</div>

Hopefully, otherwise it would be unusable, here is a preview of how the module works if you’re interested: [https://youtu.be/ODBjnNSwsQo](https://youtu.be/ODBjnNSwsQo)

---

<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 26, 2019, 1:43pm UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/6 "2019-11-26T13:43:06Z")

</div>

Yes, that looks really nice and should be helpful.

It would be nice if someone from the ITK community is already familiar with the algorithm and the implementation, but if not you could probably go back to the original publications and look at the code to see if it’s expected that the volume size should be a factor in the result. With your tool you should have the basis to explore the impact of this - that could help people in parameter selection.

---

<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:** [November 26, 2019, 3:40pm UTC](https://discourse.slicer.org/t/denosing-filter-gives-different-result-based-on-volume-size/9275/7 "2019-11-26T15:40:07Z")

</div>

> [@Amine](#):
>
> a thick (40+ voxel) vertical axis

Requiring padding around the region of interest may be normal. I’ve added some more details to the [discussion on ITK forum](https://discourse.itk.org/t/curvatureanisotropicdiff-creates-different-result-relative-to-volume-size/2437/4?u=lassoan).
