Abayiz | 13 Jun 2012 16:32
Picon
Favicon

SpatialObjectToImageFilter

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
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Gmane