[Insight-users] itkCannyEdgeDetectionImageFilter behavior question.

Julien Mercenier itk_julienmercenier at hotmail.com
Fri, 30 Apr 2004 02:51:51 +0200


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