<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div><br></div><div>I am using SpatialObjectToImageFilter to convert a spatial object mask to an image. My partial code is as follows:</div><div><br></div><div>*******************</div><div> SpatialToImageFilter->SetInput ( this->GetMask() );<br> SpatialToImageFilter->SetSize ( this->GetInputImage()->GetLargestPossibleRegion().GetSize() );<br> SpatialToImageFilter->SetSpacing ( this->GetInputImage()->GetSpacing() );<br> SpatialToImageFilter->SetDirection ( this->GetInputImage()->GetDirection() );<br> SpatialToImageFilter->SetUseObjectValue( true );<br> SpatialToImageFilter->SetOutsideValue( 0 );<br> SpatialToImageFilter->Update();</div><div><br></div><div> writer->SetInput (
SpatialToImageFilter->GetOutput() );</div><div> writer->Update();<br></div><div>******************* <br></div><div><br></div><div>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??</div><div>Thank you for any suggestion. <br></div><div><br></div><div>Regards,</div><div>Abayiz <br></div></div></body></html>