[Insight-users] FastMarchingImageFilter extremely slow for a 3D image data

nadan zhu nadan.zhu at gmail.com
Thu Apr 29 21:28:31 EDT 2010


Hi,
   In your program, you just comment
 fastMarching->SetInput(image);
it will works since you have set the constant speed.

The input image is speed image for fast marching filter, if you want use it,
you should initialize it.

hope it helps


nadan



On Fri, Apr 30, 2010 at 8:23 AM, Haiyong Xu <haiyeong at gmail.com> wrote:

> Hi List,
>
> I tried to use FastMarchingImageFilter with a constant speed to
> generate initial levelsets. It works very well in 2D but very slow in
> 3D. For a relative small 3D image data (60x60x60), I run the program
> for 3~5 minutes and there is no result. Is that intrinsic property of
> FastMarchingImageFilter or my mistake in programing?
>
> Below is a test program:
>
> int main( int argc, char *argv[] )
> {
>  typedef itk::Image<float, 3> ImageType;
>
>  // set up input image
>  ImageType::Pointer image = ImageType::New();
>  ImageType::RegionType region;
>  ImageType::IndexType index;
>  index[0] = index[1] = index[2] = 0;
>  ImageType::SizeType  size;
>  size[0] = 60; size[1] = 60; size[2] = 60;
>  region.SetIndex(index);
>  region.SetSize(size);
>  image->SetRegions(region);
>  image->Allocate();
>
>  // create filter and set initial point
>  typedef  itk::FastMarchingImageFilter< ImageType, ImageType >
> FastMarchingFilterType;
>  FastMarchingFilterType::Pointer  fastMarching =
> FastMarchingFilterType::New();
>
>  ImageType::IndexType  seedPosition;
>  seedPosition[0] = 30;  seedPosition[1] = 30; seedPosition[2] = 30;
>
>  typedef FastMarchingFilterType::NodeContainer  NodeContainer;
>  NodeContainer::Pointer seeds = NodeContainer::New();
>
>  FastMarchingFilterType::NodeType node;
>  node.SetValue( 0 );
>  node.SetIndex( seedPosition );
>  seeds->Initialize();
>  seeds->InsertElement( 0, node );
>
>  fastMarching->SetInput(image);
>  fastMarching->SetOutputSize(size);
>  fastMarching->SetTrialPoints(  seeds  );
>  fastMarching->SetSpeedConstant(1.0);
>  //fastMarching->SetStoppingValue(10);
>
>  fastMarching->Update();
>
>  return 0;
> }
>
>
> The program was built upon ITK 3.16 and run on Windows XP.
>
> Thanks for help.
>
> --Haiyong
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100430/5a6bf114/attachment.htm>


More information about the Insight-users mailing list