[Insight-users] itkCannyEdgeDetectionImageFilter behavior question.

Zachary Pincus zpincus at stanford.edu
Thu, 29 Apr 2004 19:09:42 -0700


(1) It doesn't look like you set a threshold for the Canny filter. This 
might be the reason you see what you do -- you're not excluding the 
lower-valued "fringes" of edge that I think one gets when computing the 
image derivative with a derivative-of-gaussian convolution over a hard 
edge (as, I'm sure you know, the canny filter does). (Also, could you 
please send an actual image file of a slice through the output so I 
could check this theory.)

(2) What is the runtime error you get with SetMaximumError?

Zach

On Apr 29, 2004, at 5:51 PM, Julien Mercenier wrote:

>
> Here is the part of the code.
>
> The input image is a *.img file (100X100X100) wtih a cube (in = 255 
> and out
> = 0)
> of side length 30.
>
> Normaly, I think the detector should find 6 faces (a cube having 6 
> faces).
> But, in place, the CannyMap.img (see the code) give me, at 
> approximately the
> location of each
> face of the cube, not one face, but three parallel face.
>
> Thus, the result is not (a little drawing of a cut through the result)
>
>             -----------
>             |               |
>             |               |
>             -----------
>
> but is like (don't look at proportions)
>
>             -----------------------------------------------
>             -----------------------------------------------
>             -----------------------------------------------
>        | | |
> | | |
>        | | |
> | | |
>        | | |
> | | |
>        | | |
> | | |
>        | | |
> | | |
>            ------------------------------------------------
>            ------------------------------------------------
>            ------------------------------------------------
>
> One more thing, when I use SetMaximumError, the execution
> gives me a RunTime error.
>
> Thanks for your answers.
>
>
>
> CannyEdgeFilterType::Pointer cannyEdgeFilter = 
> CannyEdgeFilterType::New();
>
>  cannyEdgeFilter->SetInput(imageReader->GetOutput());
>  cannyEdgeFilter->SetOutsideValue(255.0);
>  ArrayType cannyVariance;
>  cannyVariance[0]=1.0;
>  cannyVariance[1]=1.0;
>  cannyVariance[2]=1.0;
>  cannyEdgeFilter->SetVariance(cannyVariance);
>  //ArrayType cannyMaxError;
>  //cannyMaxError[0]=1.0;
>  //cannyMaxError[1]=1.0;
>  //cannyMaxError[2]=1.0;
>  //cannyEdgeFilter->SetMaximumError(cannyMaxError);
>  cannyEdgeFilter->Update();
>
>  typedef itk::ImageFileWriter< ImageType > WriterType2;
>   WriterType2::Pointer writer2 = WriterType2::New();
>
>  writer2->SetFileName( "CannyMap.img");
>  writer2->SetInput(cannyEdgeFilter->GetOutput());
>
>  try
>  {
>   writer2->Update();
>  }
>  catch( itk::ExceptionObject & exp )
>  {
>   std::cerr << "Exception caught !" << std::endl;
>   std::cerr << exp << std::endl;
>  }
>
>
>
> ----- Original Message -----
> From: "Zachary Pincus" <zpincus at stanford.edu>
> To: "Julien Mercenier" <itk_julienmercenier at hotmail.com>
> Cc: <insight-users at itk.org>
> Sent: Friday, April 30, 2004 12:21 AM
> Subject: Re: [Insight-users] itkCannyEdgeDetectionImageFilter behavior
> question.
>
>
> I'm not sure if I understand particularly what you mean by "in place a
> having one plan by side of the cube, I have three plans." Could you
> send some more information about what you're seeing? (input, output,
> parameters, etc.)
>
> I'm pretty familiar with how this filter works, so I'd be happy to help
> diagnose what's going on here.
>
> Zach Pincus
>
> Department of Biochemistry and Program in Biomedical Informatics
> Stanford University School of Medicine
>
>
>
> On Apr 29, 2004, at 11:23 AM, Julien Mercenier wrote:
>
>> Hi,
>>
>> I have a question about the CannyEdgeDetectionImageFilter
>> behavior.
>>
>> In fact, I've tested it on a simple cube image (255 is inside and 0
>> outside).
>>  The result is quite surprising : in place a having one plan by side
>> of the cube,
>> I have three plans.
>>
>> If someone knows the reason, please tell me.
>>
>> Thanks in advance.
>>
>> Julien, BELGIUM
>