<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>SpatialObjectToImageFilter work with Vessels Tubes Spatial objects?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi,<BR>
<BR>
I generate a spatial object of type vessel tube in my app. When I use the itkSpatialObjectWriter and save it to a meta file for instance it works. However when I use a itk::SpatialObjectToImageFilter filter, my file.vtk for instance is empty, just the header is written.<BR>
<BR>
Here a snippet of my code:<BR>
<BR>
vesselsTracingFilter is a filter producing the vessels structure. The output of the filter is an image, currently empty,<BR>
but whose properties spacing, orign and region are correct.<BR>
<BR>
typedef itk::SpatialObjectToImageFilter< VesselTracingFilter::VesselTubeSpatialType, InputImageType > SpatialObjectToImageFilter;<BR>
<BR>
typedef itk::RescaleIntensityImageFilter< SpatialObjectToImageFilter::OutputImageType, OutputImageType > CastFilterType;<BR>
<BR>
SpatialObjectToImageFilter::Pointer vesselsToImageFilter = SpatialObjectToImageFilter::New();<BR>
vesselsToImageFilter->SetInput( vesselsTracingFilter->GetVessels().GetPointer() );<BR>
vesselsToImageFilter->SetSpacing( vesselsTracingFilter->GetOutput()->GetSpacing() );<BR>
vesselsToImageFilter->SetOrigin( vesselsTracingFilter->GetOutput()->GetOrigin() );<BR>
vesselsToImageFilter->SetSize( vesselsTracingFilter->GetOutput()->GetRequestedRegion().GetSize() );<BR>
<BR>
CastFilterType::Pointer castFilter = CastFilterType::New();<BR>
castFilter->SetOutputMinimum( 0 );<BR>
castFilter->SetOutputMaximum( 255 );<BR>
castFilter->SetInput( vesselsToImageFilter->GetOutput() );<BR>
<BR>
writer->SetFileName( outputFilename );<BR>
writer->SetInput( castFilter->GetOutput() );<BR>
<BR>
<BR>
try<BR>
{<BR>
writer->Update();<BR>
}<BR>
catch( itk::ExceptionObject & err )<BR>
{<BR>
std::cerr << "ExceptionObject caught !" << std::endl;<BR>
std::cerr << err << std::endl;<BR>
system("pause");<BR>
return -1;<BR>
}<BR>
<BR>
<BR>
Any clues?<BR>
<BR>
Thanks!<BR>
<BR>
Best Regards,<BR>
<BR>
Jerome Schmid<BR>
</FONT>
</P>
</BODY>
</HTML>