Hi Luis,<br><br>Thanks so much for your kind reply. <br><br>I just have some small questions:<br><br>* For the following (Just for confirmation):<br><br>-  if (argc &lt; 7)<br>+ if (argc &lt; 8)<br><br>I should REMOVE <i>if(argc&lt;7)</i> and JUST write <i>if (argc &lt; 8)</i>?<br>

<br>So, in your modifications, I should REMOVE what has &quot;-&quot; and ADD what has &quot;+&quot;.<br><br>* For, the following:<br><br>smoothing-&gt;SetTimeStep( 0.025 );<br><br>Why did you add ( 0.025 ) and not ( 0.125 )<br>

<br>* For the following:<br><br>-  const InternalPixelType lowerThreshold = atof( argv[5] ); <br>-  const InternalPixelType upperThreshold = atof( argv[6] );<br>+  const InternalPixelType lowerThreshold = atof( argv[6] ); <br>

+  const InternalPixelType upperThreshold = atof( argv[7] );<br><br>Why had you to remove the first two lines and add [6] &amp; [7]?<br><br>Thanks a lot, and appreciate your kind efforts.<br><br>Abder-Rahman<br><br><br><br>

<br><br><div class="gmail_quote">On Sat, Mar 24, 2012 at 4:56 PM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Abder-Rahman,<br>
<br>
Please find below the diffs that you have to apply to<br>
this example in order to make it work for 3D images.<br>
<br>
<br>
   Thanks<br>
<br>
<br>
       Luis<br>
<br>
<br>
diff --git a/Examples/Segmentation/ConnectedThresholdImageFilter.cxx<br>
b/Examples/Segmentation/ConnectedThresholdImageFilter.cxx<br>
index 5fdfb24..38ef54c 100644<br>
--- a/Examples/Segmentation/ConnectedThresholdImageFilter.cxx<br>
+++ b/Examples/Segmentation/ConnectedThresholdImageFilter.cxx<br>
@@ -95,11 +95,11 @@<br>
<div class="im"><br>
 int main( int argc, char *argv[])<br>
 {<br>
</div>-  if( argc &lt; 7 )<br>
+  if( argc &lt; 8 )<br>
<div class="im">     {<br>
     std::cerr &lt;&lt; &quot;Missing Parameters &quot; &lt;&lt; std::endl;<br>
     std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];<br>
</div>-    std::cerr &lt;&lt; &quot; inputImage  outputImage seedX seedY lowerThreshold<br>
upperThreshold&quot; &lt;&lt; std::endl;<br>
+    std::cerr &lt;&lt; &quot; inputImage  outputImage seedX seedY seedZ<br>
<div class="im">lowerThreshold upperThreshold&quot; &lt;&lt; std::endl;<br>
     return 1;<br>
     }<br>
<br>
</div>@@ -114,7 +114,7 @@ int main( int argc, char *argv[])<br>
<br>
   // Software Guide : BeginCodeSnippet<br>
   typedef   float           InternalPixelType;<br>
-  const     unsigned int    Dimension = 2;<br>
+  const     unsigned int    Dimension = 3;<br>
   typedef itk::Image&lt; InternalPixelType, Dimension &gt;  InternalImageType;<br>
   // Software Guide : EndCodeSnippet<br>
<br>
@@ -217,7 +217,7 @@ int main( int argc, char *argv[])<br>
<br>
   // Software Guide : BeginCodeSnippet<br>
   smoothing-&gt;SetNumberOfIterations( 5 );<br>
-  smoothing-&gt;SetTimeStep( 0.125 );<br>
+  smoothing-&gt;SetTimeStep( 0.025 );<br>
   // Software Guide : EndCodeSnippet<br>
<br>
<br>
@@ -235,8 +235,8 @@ int main( int argc, char *argv[])<br>
   //<br>
   //  Software Guide : EndLatex<br>
<br>
-  const InternalPixelType lowerThreshold = atof( argv[5] );<br>
-  const InternalPixelType upperThreshold = atof( argv[6] );<br>
+  const InternalPixelType lowerThreshold = atof( argv[6] );<br>
+  const InternalPixelType upperThreshold = atof( argv[7] );<br>
<br>
   // Software Guide : BeginCodeSnippet<br>
   connectedThreshold-&gt;SetLower(  lowerThreshold  );<br>
@@ -275,6 +275,7 @@ int main( int argc, char *argv[])<br>
<br>
   index[0] = atoi( argv[3] );<br>
   index[1] = atoi( argv[4] );<br>
+  index[2] = atoi( argv[5] );<br>
<br>
<br>
   // Software Guide : BeginCodeSnippet<br>
<br>
<br>
<br>
---------------------------------<br>
<div><div></div><div class="h5">On Sat, Mar 24, 2012 at 11:14 AM, Abder-Rahman Ali<br>
&lt;<a href="mailto:abder.rahman.ali@gmail.com">abder.rahman.ali@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I just have a question and thought you may have an idea on it.<br>
&gt;<br>
&gt; Inside the `InsightToolkit` directory there is the<br>
&gt; `Examples/Segmentation/ConnectedThresholdImageFilter.xx` file.<br>
&gt;<br>
&gt; Now, I want to make it operate on a three dimensional image. In this case,<br>
&gt; will the changes that I have to do bee applied to those lines of code (lines<br>
&gt; 102-110):<br>
&gt;<br>
&gt;     int main( int argc, char *argv[])<br>
&gt;     {<br>
&gt;       if( argc &lt; 7 )<br>
&gt;         {<br>
&gt;         std::cerr &lt;&lt; &quot;Missing Parameters &quot; &lt;&lt; std::endl;<br>
&gt;         std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];<br>
&gt;         std::cerr &lt;&lt; &quot; inputImage  outputImage seedX seedY lowerThreshold<br>
&gt; upperThreshold&quot; &lt;&lt; std::endl;<br>
&gt;         return 1;<br>
&gt;         }<br>
&gt;<br>
&gt; And, in order to do that, should I add the following `seedZ` to:<br>
&gt;<br>
&gt;     std::cerr &lt;&lt; &quot; inputImage  outputImage seedX seedY lowerThreshold<br>
&gt; upperThreshold&quot; &lt;&lt; std::endl;<br>
&gt;<br>
&gt; And, what change should I perform to the arguments in this case?<br>
&gt;<br>
&gt; Thanks a lot and apologize for my disturbance.<br>
&gt;<br>
&gt; Abder-Rahman<br>
&gt;<br>
</div></div></blockquote></div><br>