[Insight-users] [insight-users] Only binary output of itkFastMarchingImageFilter?

Dan Mueller dan.muel at gmail.com
Tue Apr 21 14:01:42 EDT 2009


Hi DING Feng,

Try setting the output spacing and origin *before* updating the filter:

>    marcher->SetTrialPoints( points );
>    marcher->SetSpeedConstant( 1.0 );
>    marcher->SetStoppingValue( 100.0 );
>    marcher->SetOutputSize( size );

marcher->SetOutputSpacing( spacing );
marcher->SetOutputOrigin( origin );

This may be the source of your problem... FYI I use this filter
regularly without issue.

Hope this helps.

Regards, Dan

2009/4/21 Feng Ding <carlding at gmail.com>:
> Dear list,
>
> I'm trying to use itkFastMarchingImageFilter by following the examples in
> the ITK source tree. Instead of getting a time arrival image which is
> similar to a distance map in this case, I only got a binary image with 0
> inside (a sphere) and 1.70141e+38 outside. I have tested my code on both
> 3.10 and 3.12 releases of ITK, and got the same results. Following is part
> of my code:
>
> // >>>>>>>>>> begin >>>>>>>>>>
>    index[0] = index[1] = index[2] = 100;
>    node.SetIndex( index );
>    node.SetValue( 0 );
>    points->InsertElement( 0, node );
>
>    marcher->SetTrialPoints( points );
>    marcher->SetSpeedConstant( 1.0 );
>    marcher->SetStoppingValue( 100.0 );
>    marcher->SetOutputSize( size );
>    marcher->DebugOn();
>    marcher->Update();
>    marcher->GetOutput()->SetOrigin( origin );
>    marcher->GetOutput()->SetSpacing( spacing );
>
>    volumeWriter->SetInput( marcher->GetOutput() );
>    volumeWriter->SetFileName( "volume.mha" );
>    volumeWriter->Write();
> // <<<<<<<<<<<<<<<<<<<<<<<<<
>
> Anyone can give me some suggestion on that? Thanks!
>
> Best regards,
> DING Feng


More information about the Insight-users mailing list