[Insight-users] [insight-users] Only binary output of itkFastMarchingImageFilter?
Feng Ding
carlding at gmail.com
Wed Apr 22 04:37:59 EDT 2009
I figured out the problem. It has nothing to do with the fast marching
algorithm. The resulting image appeared to be a binary image when I
visualized it using ITK-SNAP, but actually it was not.
On Wed, Apr 22, 2009 at 10:30 AM, Feng Ding <carlding at gmail.com> wrote:
> Hi Dan,
>
> Thank you for your suggestion. Unfortunately, this didn't help. I got the
> same binary output. Do you know any other possible reasons?
>
>
> On Wed, Apr 22, 2009 at 2:01 AM, Dan Mueller <dan.muel at gmail.com> wrote:
>
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090422/2d779123/attachment.htm>
More information about the Insight-users
mailing list