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 < 7)<br>+ if (argc < 8)<br><br>I should REMOVE <i>if(argc<7)</i> and JUST write <i>if (argc < 8)</i>?<br>
<br>So, in your modifications, I should REMOVE what has "-" and ADD what has "+".<br><br>* For, the following:<br><br>smoothing->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] & [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"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></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 < 7 )<br>
+ if( argc < 8 )<br>
<div class="im"> {<br>
std::cerr << "Missing Parameters " << std::endl;<br>
std::cerr << "Usage: " << argv[0];<br>
</div>- std::cerr << " inputImage outputImage seedX seedY lowerThreshold<br>
upperThreshold" << std::endl;<br>
+ std::cerr << " inputImage outputImage seedX seedY seedZ<br>
<div class="im">lowerThreshold upperThreshold" << 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< InternalPixelType, Dimension > InternalImageType;<br>
// Software Guide : EndCodeSnippet<br>
<br>
@@ -217,7 +217,7 @@ int main( int argc, char *argv[])<br>
<br>
// Software Guide : BeginCodeSnippet<br>
smoothing->SetNumberOfIterations( 5 );<br>
- smoothing->SetTimeStep( 0.125 );<br>
+ smoothing->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->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>
<<a href="mailto:abder.rahman.ali@gmail.com">abder.rahman.ali@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I just have a question and thought you may have an idea on it.<br>
><br>
> Inside the `InsightToolkit` directory there is the<br>
> `Examples/Segmentation/ConnectedThresholdImageFilter.xx` file.<br>
><br>
> Now, I want to make it operate on a three dimensional image. In this case,<br>
> will the changes that I have to do bee applied to those lines of code (lines<br>
> 102-110):<br>
><br>
> int main( int argc, char *argv[])<br>
> {<br>
> if( argc < 7 )<br>
> {<br>
> std::cerr << "Missing Parameters " << std::endl;<br>
> std::cerr << "Usage: " << argv[0];<br>
> std::cerr << " inputImage outputImage seedX seedY lowerThreshold<br>
> upperThreshold" << std::endl;<br>
> return 1;<br>
> }<br>
><br>
> And, in order to do that, should I add the following `seedZ` to:<br>
><br>
> std::cerr << " inputImage outputImage seedX seedY lowerThreshold<br>
> upperThreshold" << std::endl;<br>
><br>
> And, what change should I perform to the arguments in this case?<br>
><br>
> Thanks a lot and apologize for my disturbance.<br>
><br>
> Abder-Rahman<br>
><br>
</div></div></blockquote></div><br>