Thanks so much Luis. That really helps.<br><br>I'm a bit new to this, and now trying to run a filter, say for example, the "Examples/Segmentation/ConnectedThresholdImageFilter.cxx". I tried to use CMake after copying this file along with the CMakeLists.txt to a new directory. I made the new directory (i.e; NewDir) as "source" and the "build" as (i.e; NewDirBin).<br>
<br>When I try to "generate", I get the following message: Error in generation process, project files may be invalid<br><br>So, the bottom line is, how can I test this filter?<br><br>Thanks a lot.<br><br>Abder-Rahman<br>
<br><div class="gmail_quote">On Sat, Mar 24, 2012 at 9:58 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">
<div class="im">On Sat, Mar 24, 2012 at 2:19 PM, Abder-Rahman Ali<br>
<<a href="mailto:abder.rahman.ali@gmail.com">abder.rahman.ali@gmail.com</a>> wrote:<br>
><br>
> So, in your modifications, I should REMOVE what has "-" and ADD what has<br>
> "+".<br>
><br>
<br>
</div>Yes.<br>
<br>
This is the typical format that you will<br>
see when you do a diff between two files.<br>
<div class="im"><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>
<br>
</div>Because when you go from 2D to 3D the computation<br>
of the time step in the smoothing filter needs to be<br>
adjusted. Otherwise you will get a warning about the<br>
time step at 0.125 being unstable in 3D.<br>
<div class="im"><br>
<br>
> * For the following:<br>
><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>
<br>
</div>Because the insertion of the seedZ argument<br>
in the command line displaces the two last<br>
arguments by one.<br>
<div><div></div><div class="h5"><br>
<br>
> Thanks a lot, and appreciate your kind efforts.<br>
><br>
> Abder-Rahman<br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Sat, Mar 24, 2012 at 4:56 PM, Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>><br>
> wrote:<br>
>><br>
>> 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>
>><br>
>> int main( int argc, char *argv[])<br>
>> {<br>
>> - if( argc < 7 )<br>
>> + if( argc < 8 )<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>
>> + std::cerr << " inputImage outputImage seedX seedY seedZ<br>
>> lowerThreshold upperThreshold" << std::endl;<br>
>> return 1;<br>
>> }<br>
>><br>
>> @@ -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>
>> 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<br>
>> > case,<br>
>> > will the changes that I have to do bee applied to those lines of code<br>
>> > (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<br>
>> > 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>
><br>
><br>
</div></div></blockquote></div><br>