[Insight-users] SpatialObjectToImageFilter
Abayiz
abayiz at yahoo.com
Wed Jun 13 10:32:03 EDT 2012
Hello,
I am using SpatialObjectToImageFilter to convert a spatial object mask to an image. My partial code is as follows:
*******************
SpatialToImageFilter->SetInput ( this->GetMask() );
SpatialToImageFilter->SetSize ( this->GetInputImage()->GetLargestPossibleRegion().GetSize() );
SpatialToImageFilter->SetSpacing ( this->GetInputImage()->GetSpacing() );
SpatialToImageFilter->SetDirection ( this->GetInputImage()->GetDirection() );
SpatialToImageFilter->SetUseObjectValue( true );
SpatialToImageFilter->SetOutsideValue( 0 );
SpatialToImageFilter->Update();
writer->SetInput ( SpatialToImageFilter->GetOutput() );
writer->Update();
*******************
Now the problem is, the pixel values of the output of this filter are all zeros, even in the mask region. What is wrong here??
Thank you for any suggestion.
Regards,
Abayiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120613/0bce887c/attachment.htm>
More information about the Insight-users
mailing list