[Insight-users] Use of advection image to guide geodesic level set

Amardeep Singh amar.singh at gmx.de
Mon Feb 23 06:27:43 EST 2009


Dear Karthik

Thanks a lot for the hint. You are right. With the following set of 
commands it works:
    
1.   geodesicActiveContour->SetAutoGenerateSpeedAdvection(false);

2.   geodesicActiveContour->SetInput(initialLevelSet->GetOutput());
3.   geodesicActiveContour->SetFeatureImage(speedImageReader->GetOutput());
4.   geodesicActiveContour->GenerateSpeedImage();
5.   geodesicActiveContour->SetAdvectionImage(castFilter->GetOutput());

6.   geodesicActiveContour -> SetPropagationScaling( atof(argv[3]) );
7.   geodesicActiveContour -> SetCurvatureScaling( atof(argv[4]) );
8.   geodesicActiveContour -> SetAdvectionScaling( atof(argv[5]) );

9.   geodesicActiveContour -> SetMaximumRMSError( atof(argv[6]) );
10  geodesicActiveContour -> SetNumberOfIterations( atoi(argv[7]) );

However, using "SetSpeedImage(...)" instead of lines 3 and 4 of the code 
above does not work, as I get the following error message:
Exception caught !
itk::ExceptionObject (0x884a420)
Location: "virtual void 
itk::ProcessObject::UpdateOutputData(itk::DataObject*)"
File: /InsightToolkit-3.10.2/Code/Common/itkProcessObject.cxx
Line: 985
Description: itk::ERROR: 
GeodesicActiveContourLevelSetImageFilter(0x86cbd20): At least 2 inputs 
are required but only 1 are specified.

This only works if I set the number of required inputs to 1 in the 
constructor of the SegmentationLevelSetImageFilter. Using the SetFeature 
Image works as fine, however, as it is copied directly to the  speed 
image, anyway.

Can you tell me why "InterpolateSurfaceLocationOff()" is called in the 
constructor of the geodesic active contour filter?
Thank you very much!

Best regards
Amar


Karthik Krishnan wrote:
> I've used the method to set an external advection field. So, although 
> untested, its unlikely that its a bug.
>
> Make sure that you sure  you are setting the flag below in addition to 
> setting the advection field
>
>   gac->AutoGenerateSpeedAdvectionOff()
>   gac->SetAdvectionField(....)
>
> Note that this flag disables internal compuatation of both the 
> advection and propagation terms.
>
> That means that you will need to explicitly set the speed 
> (propagation) image. You may call GenerateSpeedImage() or 
> SetSpeedImage(..), if you have the speed image handy
>
>
> -- 
> Karthik Krishnan
> R&D Engineer,
> Kitware Inc.
>
> On Fri, Feb 20, 2009 at 12:16 PM, Amardeep Singh <amar.singh at gmx.de 
> <mailto:amar.singh at gmx.de>> wrote:
>
>     Dear ITK Users
>
>     I think, I have found the reason of my problem and I would like to
>     post my solution, in case others encounter the same situation.
>
>     After digging through the code, it seems to me that the
>     SetAdvectionImage() method does not have any effect on the
>     GeodesicActiveContourLevelSetImageFilter. The advection image is
>     always calculated from the feature image in the
>     CalculateAdvectionImage() method of the filter,  independently of
>     having set an advection image before.
>     Is this supposed to be the desired behaviour in all cases? I
>     hacked the code and now use a flag in order to ensure that my own
>     advection image is used, in case the SetAdvectionImage() function
>     has been called. Everything works fine now and the level set locks
>     to the inside of the ring.
>     In case the SetAdvectionImage() is supposed to have an effect:
>     Shall I file a bug report?
>     Perhaps someone can comment on this.
>
>     Best regards
>     Amar
>
>
>     Amardeep Singh wrote:
>
>         Dear ITK Users,
>
>         first of all, thank you very much, Luis, for answering my
>         questions on the gradient vector flow (GVF). This
>         really helped to lift some confusion. Unfortunately, I am
>         stuck again with my experiments on (at the moment) synthetic
>         images and so I would like to ask for the help of the mailing
>         list.
>         My scenario is the following:
>         I am dealing with 2D images and consider a bright ring on a
>         dark background. I use the ring as  an edge map and
>         calculate the gradient vector flow from it. I start with a
>         circle that is inside of the ring and want to propagate it to
>         the center of the ring by using the gradient vector flow as an
>         advection term by using SetAdvectionImage.
>         My speed image is 1 inside of the ring, 0 in the area of the
>         ring and -1 outside so that the level set is simply guided by
>         the advection term on the ring.
>         My problem is that the level set locks to the outer border of
>         the ring, not to its center, which is really confusing me.
>         I know that deformable models are very sensitive to the
>         parameter settings, but in my case I would think that this
>         sensitivity should be a little less important as the speed
>         image is 0 on the ring and only the advection term is
>         important. I checked that the 0 isoline of the GVF is where I
>         want it to be, in the middle of the ring.
>         All images have direction cosines of a unit matrix.
>         My parameters:
>         GVF:
>         noise level: 20000 (in order to get a very small time step)
>         iterations: 500
>         LevelSet:
>         iterations: 1000
>         RMS error: 0.01
>         propagation scaling: 1
>         curvature scaling: 0
>         advection scaling: 1
>
>         I would be very happy if anyone could shed light on the
>         question why the circle does not lock to inside of the ring.
>         I have attached my source code and all images.
>         Thank you very much!
>
>         Best regards
>         Amar
>         ------------------------------------------------------------------------
>
>         _____________________________________
>         Powered by www.kitware.com <http://www.kitware.com>
>
>         Visit other Kitware open-source projects at
>         http://www.kitware.com/opensource/opensource.html
>
>         Please keep messages on-topic and check the ITK FAQ at:
>         http://www.itk.org/Wiki/ITK_FAQ
>
>         Follow this link to subscribe/unsubscribe:
>         http://www.itk.org/mailman/listinfo/insight-users
>          
>
>     _____________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the ITK FAQ at:
>     http://www.itk.org/Wiki/ITK_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>


More information about the Insight-users mailing list