[Insight-users] Problem with ResampleImageFilter

Markus Mehrwald mehrwald at ira.uka.de
Fri Feb 8 10:13:13 EST 2008


Hello,

my ResampleImageFilter only produces black Images. If I write the input 
of the filter in an image it looks like as it should but the output is 
only black.
Here is the code I use:

typedef double    PixelType;
//! Dimension of the image
static const unsigned int      Dimension = 2;
//! Definition of an ITK image
typedef itk::Image< PixelType, Dimension > ImageType;
//! Linear transformation of the pixel intensities between two values
typedef itk::RescaleIntensityImageFilter<ImageType> RescaleFilterType;
ReaderType::Pointer reader;
RescaleFilterType::Pointer rescaleFilterX;
//! Definition of the connector class between ITK and VTK
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
//! Pointer to the connector class between ITK and VTK
ConnectorType::Pointer connectorX;

[..]

extractorX->SetInput(reader->GetOutput());
resamplerX->SetInput(extractorX->GetOutput());
rescaleFilterX->SetInput(resamplerX->GetOutput());
ResampleType::SizeType size;
size[0] = 300;
size[1] = 300;
resamplerX->SetSize(size);
ResampleType::OriginPointType origin;
origin[0] = 0;
origin[1] = 0;
resamplerX->SetOutputOrigin(origin);
TransformType::Pointer transform = TransformType::New();
transform->SetIdentity();
resamplerX->SetTransform(transform);
rescaleFilterX->Update();
connectorX->GetExporter()->SetInput(rescaleFilterX->GetOutput());

The pipeline is created before any filepathes are known but this should 
not be the problem. Update is called by a slider which tells the 
extractor which slice of my DICOM-Image should be taken.

Are there any suggestions what might be the problem with this code?
Thanks,
Markus


More information about the Insight-users mailing list