[Insight-users] Trouble using the TileImageFilter
Erik Tuerke
tuerke at cbs.mpg.de
Wed Oct 28 14:28:08 EDT 2009
Hi!
I have some trouble using the itk::TileImageFilter. :-(
What i want to do is creating an 4d image with the help of this filter.
Here is my approach:
const unsigned int Dimension = 3;
const unsigned int fmriDimension = 4;
typedef itk::Image<PixelType, Dimension> OutputImageType;
typedef itk::Image<PixelType, fmriDimension> FMRIOutputType;
typedef itk::ImageFileWriter<FMRIOutputType> FMRIImageWriterType;
typedef itk::TileImageFilter<OutputImageType, FMRIOutputType>
TileImageFitlerType;
FMRIImageWriterType::Pointer fmriWriter = FMRIImageWriterType::New();
TileImageFitlerType::Pointer tileImageFilter = TileImageFitlerType::New();
itk::FixedArray<unsigned int, 4> layout;
layout[0] = 1;
layout[1] = 1;
layout[2] = 1;
layout[3] = 0;
tileImageFilter->SetLayout(layout);
for(unsigned int timestep = 0; timestep < numberOfTimeSteps; timestep++) {
std::cout << "Resampling timestep: " << timestep << "...\r" <<
std::flush;
timeStepExtractionFilter->SetRequestedTimeStep(timestep);
timeStepExtractionFilter->Update();
resampler->SetInput(timeStepExtractionFilter->GetOutput());
resampler->Update();
//here it would be possible to save each image obtained from the
resampler. I have tested that...so this should not be the source of error
tileImageFilter->PushBackInput(resampler->GetOutput());
}
tileImageFilter->Update();
fmriWriter->SetInput(tileImageFilter->GetOutput());
fmriWriter->Update();
What i am getting is a 4d image with dimension[3] =
numberOfTimeSteps...as expected.
The problem is, that each timestep shows the same image (the last one).
Has someone an idea what i am doing wrong here ??
Thanks for yout help!!
More information about the Insight-users
mailing list