The reason for expressing maximum distance as a percentage(fraction) of the bound box is to avoid specifying absolute distances.<div><br></div><div>Your patch should not be applied.<br><br><div class="gmail_quote">On Wed, Jul 11, 2012 at 12:59 PM, Roman Grothausmann <span dir="ltr"><<a href="mailto:roman.grothausmann@helmholtz-berlin.de" target="_blank">roman.grothausmann@helmholtz-berlin.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11.07.2012 17:19, Bill Lorensen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The * should remain.<br>
</blockquote>
<br>
But does that not lead to a MaximumDistance^4 in the actual calculation? At least that is the maximum value I find in the output if stored in 32-bit real.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The value of MaximumDistance is clamped between 0 and<br>
1. You can set it to 1000000 if you want, but internally it will be set to<br>
1.0.<br>
</blockquote>
<br></div>
I know, that's why I changed vtkSetClampMacro(<u></u>MaximumDistance,double,0.0,1.<u></u>0);<br>
to<br>
vtkSetMacro(MaximumDistance,<u></u>double);<br>
(see patch below) and recompiled VTK. It works as I'd expect it, e.g. the maximum value I find in the output is very close to 10 if stored in 32-bit real and using SetMaximumDistance(10).<br>
<br>
-- VTK_orig/Hybrid/<u></u>vtkImplicitModeller.cxx 2012-05-12 13:59:27.000000000 +0200<br>
+++ VTK/Hybrid/<u></u>vtkImplicitModeller.cxx 2012-07-10 16:22:21.060066823 +0200<div class="im"><br>
@@ -967,7 +967,7 @@<br>
}<br>
}<br>
<br>
- maxDist *= this->MaximumDistance;<br>
+ maxDist = this->MaximumDistance;<br>
<br>
// Set volume origin and data spacing<br></div>
output->SetOrigin(this-><u></u>ModelBounds[0],<br>
--- VTK/Hybrid/<u></u>vtkImplicitModeller.h 2012-05-12 13:59:27.000000000 +0200<br>
+++ /home/grothama/sda8/programme/<u></u>VTK/Hybrid/<u></u>vtkImplicitModeller.h 2012-07-11 16:27:36.203103443 +0200<br>
@@ -119,7 +119,8 @@<br>
// Description:<br>
// Set / get the distance away from surface of input geometry to<br>
// sample. Smaller values make large increases in performance.<br>
- vtkSetClampMacro(<u></u>MaximumDistance,double,0.0,1.<u></u>0);<br>
+ //vtkSetClampMacro(<u></u>MaximumDistance,double,0.0,1.<u></u>0);<br>
+ vtkSetMacro(MaximumDistance,<u></u>double);<br>
vtkGetMacro(MaximumDistance,<u></u>double);<br>
<br>
// Description:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Wed, Jul 11, 2012 at 10:38 AM, Roman Grothausmann <<br>
<a href="mailto:roman.grothausmann@helmholtz-berlin.de" target="_blank">roman.grothausmann@helmholtz-<u></u>berlin.de</a>> wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hello!<br>
<br>
It is clamped to be between 0 and 1 but in my tests does not behave as<br>
being relative. If it were relative, it should surely not be squared.<br>
Anyway, if You remove the '*' at line 967, the output contains only values<br>
up to the absolute value specified with SetMaximumDistance.<br>
To my understanding, the value stored in MaximumDistance is used as an<br>
absolute value in the code and corresponds to the units of the input.<br>
I just tested removing the clamping and allowing any double value yields<br>
an output reaching up to 10 if SetMaximumDistance(10) is used.<br>
If You agree, I'd therefore suggest not only to remove the '*' but also<br>
the clamping in the header file.<br>
<br>
Thanks for Your comments on this<br>
Roman<br>
<br>
<br>
<br>
On 11.07.2012 14:37, Jothybasu Selvaraj wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
If the bounds are (for simplicity) equal on all side of 5.0, then if I set<br>
the MaxDistacne to 0.2 ; how it will be aclculated?<br>
<br>
Will it be 0.5+ (0.5*0.2)=0.6?<br>
<br>
Thanks<br>
<br>
Jothy<br>
<br>
<br>
<br></div>
On Wed, Jul 11, 2012 at 1:35 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>*<br>
*wrote:<div class="im"><br>
<br>
The bounds of the model, either computed or supplied.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
On Wed, Jul 11, 2012 at 8:24 AM, Jothybasu Selvaraj <<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
</blockquote>
<br>
"MaximumDistance is a percentage"<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
% of what?<br>
<br>
Jothy<br>
<br>
<br>
<br>
On Wed, Jul 11, 2012 at 1:10 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
**wrote:<br>
</blockquote><div class="im">
<br>
MaximumDistance is clamped to be within 0 and 1.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
On Wed, Jul 11, 2012 at 8:07 AM, Jothybasu Selvaraj <<br>
<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
<br>
</blockquote>
<br>
So, for instance what does 10.0 mean?<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
Is it multiplication of the bounds of vtkPolyData?<br>
<br>
with bounds [-5,5,-5,5,-5,5] the operation will be applied in<br>
[-50,50,-50,50,-50,50]<br>
<br>
Thanks<br>
<br>
Jothy<br>
<br>
On Wed, Jul 11, 2012 at 1:03 PM, Bill Lorensen <<br>
<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
<br>
</blockquote>
<br>
MaximumDistance is a percentage, not an absolute distance. The<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
documentation is not clear about this.<br>
<br>
<br>
On Wed, Jul 11, 2012 at 3:45 AM, Roman Grothausmann <<br></div>
roman.grothausmann@helmholtz-*<u></u>*<a href="http://berlin.de" target="_blank">berlin.de</a><<a href="mailto:roman.grothausmann@helmholtz-berlin.de" target="_blank">roman.grothausmann@<u></u>helmholtz-berlin.de</a>>><div class="im">
<br>
wrote:<br>
<br>
Dear mailing list members,<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
Could it be that in vtkImplicitModeller.cxx there is a bug that<br>
causes the maximum distance (that is calculated and saved in the<br>
image) to<br>
be bigger than specified with SetMaximumDistance()?<br>
<br>
From the description of the filter and its parameters and also from<br>
the comments in the source I would expect that the output stored in<br>
32-bit<br>
real does not contain values above SetMaximumDistance() except for<br>
the<br>
"background" value.<br>
<br>
Having checked the source it seems to me that the squared distance<br>
was always very carefully assigned to a variable name ending with 2<br>
(e.g.<br>
maxDistance2). However at line 967 there is a *= assignment (see<br>
patch<br>
below). Removing the '*', the output image of the filter then<br>
fulfils my<br>
expectations mentioned above.<br>
<br>
Could the '*' be a bug?<br>
<br></div>
--- VTK_orig/Hybrid/****<u></u>vtkImplicitModeller.cxx 2012-05-12<br>
13:59:27.000000000 +0200<br>
+++ VTK/Hybrid/****<u></u>vtkImplicitModeller.cxx 2012-07-10<div class="im"><br>
<br>
16:22:21.060066823 +0200<br>
@@ -967,7 +967,7 @@<br>
}<br>
}<br>
<br>
- maxDist *= this->MaximumDistance;<br>
+ maxDist = this->MaximumDistance;<br>
<br>
// Set volume origin and data spacing<br></div>
output->SetOrigin(this->****<u></u>ModelBounds[0],<div class="im"><br>
<br>
<br>
<br>
<br>
Happy coding<br>
Roman<br>
<br>
--<br>
Dr. Roman Grothausmann<br>
<br>
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH<br>
Bereich Funktionale Materialien<br>
Institut für angewandte Materialforschung<br>
Hahn-Meitner-Platz 1<br>
D-14109 Berlin<br>
<br>
(früher Hahn-Meitner-Institut und BESSY)<br>
<br>
<br>
Tel.: <a href="tel:%2B49-%280%2930-8062-42816" value="+4930806242816" target="_blank">+49-(0)30-8062-42816</a><br>
Fax.: <a href="tel:%2B49-%280%2930-8062-43059" value="+4930806243059" target="_blank">+49-(0)30-8062-43059</a><br>
<br>
Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim<br>
Treusch<br>
Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph<br>
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich<br>
Breuer<br>
Sitz der Gesellschaft: Berlin<br>
Handelsregister: AG Charlottenburg, 89 HRB 5583<br>
<br>
<br></div>
______________________________<u></u>****_________________<div class="im"><br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/**" target="_blank">http://www.kitware.com/**</a><br></div>
opensource/opensource.html<<u></u>htt**p://<a href="http://www.kitware.com/**" target="_blank">www.kitware.com/**</a><div class="im"><br>
opensource/opensource.html<<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">htt<u></u>p://www.kitware.com/<u></u>opensource/opensource.html</a>><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
<br>
<br>
Please keep messages on-topic and check the VTK FAQ at:<br>
</div><a href="http://www.vtk.org/Wiki/VTK_****FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_**<u></u>**FAQ</a><<a href="http://www.vtk.org/Wiki/VTK_**FAQ" target="_blank">http://www.vtk.org/Wiki/<u></u>VTK_**FAQ</a>><<div class="im">
<br>
<a href="http://www.vtk.org/Wiki/VTK_**FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_**<u></u>FAQ</a> <<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>FAQ</a>><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</div><a href="http://www.vtk.org/mailman/****listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/***<u></u>*listinfo/vtkusers</a><<a href="http://www.vtk.org/mailman/**listinfo/vtkusers" target="_blank">http://www.<u></u>vtk.org/mailman/**listinfo/<u></u>vtkusers</a>><br>
<<a href="http://www." target="_blank">http://www.</a>**<a href="http://vtk.org/mailman/listinfo/**vtkusers" target="_blank">vtk.org/mailman/<u></u>listinfo/**vtkusers</a><<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://<u></u>www.vtk.org/mailman/listinfo/<u></u>vtkusers</a>><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
</blockquote>
<br>
<br>
</blockquote><div class="im">
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br></div><div class="im">
______________________________<u></u>**_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
</div><a href="http://www.kitware.com/**opensource/opensource.html" target="_blank">http://www.kitware.com/**<u></u>opensource/opensource.html</a><<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">htt<u></u>p://www.kitware.com/<u></u>opensource/opensource.html</a>><div class="im">
<br>
<br>
Please keep messages on-topic and check the VTK FAQ at:<br>
<a href="http://www.vtk.org/Wiki/VTK_**FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_**<u></u>FAQ</a> <<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>FAQ</a>><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/**listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/**<u></u>listinfo/vtkusers</a><<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.<u></u>vtk.org/mailman/listinfo/<u></u>vtkusers</a>><br>
<br>
<br>
<br>
</div></blockquote>
<br>
--<div><div class="h5"><br>
Jothybasu Selvaraj<br>
PhD Student<br>
University of Liverpool<br>
UK<br>
<br>
<br>
<br>
</div></div></blockquote><div><div class="h5">
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
</div></div></blockquote><div><div class="h5">
<br>
--<br>
Jothybasu Selvaraj<br>
PhD Student<br>
University of Liverpool<br>
UK<br>
<br>
<br>
<br>
</div></div></blockquote><div><div class="h5">
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
<br>
</blockquote><div><div class="h5">
--<br>
Roman Grothausmann<br>
<br>
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH<br>
Bereich Funktionale Materialien<br>
Institut für angewandte Materialforschung<br>
Hahn-Meitner-Platz 1<br>
D-14109 Berlin<br>
<br>
(früher Hahn-Meitner-Institut und BESSY)<br>
<br>
<br>
Tel.: <a href="tel:%2B49-%280%2930-8062-42816" value="+4930806242816" target="_blank">+49-(0)30-8062-42816</a><br>
Fax.: <a href="tel:%2B49-%280%2930-8062-43059" value="+4930806243059" target="_blank">+49-(0)30-8062-43059</a><br>
<br>
Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim Treusch<br>
Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph<br>
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich Breuer<br>
Sitz der Gesellschaft: Berlin<br>
Handelsregister: AG Charlottenburg, 89 HRB 5583<br>
<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
<br>
</blockquote>
<br>
-- <br><div class="HOEnZb"><div class="h5">
Roman Grothausmann<br>
<br>
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH<br>
Bereich Funktionale Materialien<br>
Institut für angewandte Materialforschung<br>
Hahn-Meitner-Platz 1<br>
D-14109 Berlin <br>
<br>
(früher Hahn-Meitner-Institut und BESSY)<br>
<br>
<br>
Tel.: <a href="tel:%2B49-%280%2930-8062-42816" value="+4930806242816" target="_blank">+49-(0)30-8062-42816</a><br>
Fax.: <a href="tel:%2B49-%280%2930-8062-43059" value="+4930806243059" target="_blank">+49-(0)30-8062-43059</a><br>
<br>
Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim Treusch<br>
Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph<br>
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich Breuer<br>
Sitz der Gesellschaft: Berlin<br>
Handelsregister: AG Charlottenburg, 89 HRB 5583<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div>