View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011993ITKITKpublic2011-03-21 13:002011-03-21 15:44
ReporterSimon Rit 
Assigned ToBradley Lowekamp 
PrioritynormalSeveritymajorReproducibilityalways
StatusassignedResolutionopen 
PlatformWindowsOSWindowsOS Version7
Product VersionITK-3-20 
Target VersionFixed in Version 
Summary0011993: Streaming and InPlaceImageFilter
DescriptionProblem with InPlaceImageFilter when using streaming. When connecting the input of an InPlaceImageFilter to a filter that has been updated and try to write the output of this filter with SetNumberOfStreamDivisions set e.g. to 2, only the first half of the filter is updated.
Steps To ReproduceCompile the test program:
//////////////////////////////////////////////////////////////
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkMultiplyByConstantImageFilter.h>

int main(int argc, char * argv[])
{
 typedef double PixelType;
 const unsigned int Dimension = 3;
 typedef itk::Image< PixelType, Dimension > ImageType;

 typedef itk::ImageFileReader<ImageType> ReaderType;
 ReaderType::Pointer reader = ReaderType::New();
 reader->SetFileName(argv[1]);
 reader->Update();

 typedef itk::MultiplyByConstantImageFilter< ImageType, PixelType,
ImageType > FilterType;
 FilterType::Pointer filter = FilterType::New();
 filter->SetInput(reader->GetOutput());
 filter->SetConstant(0.);
 filter->SetInPlace(atoi(argv[2]));

 typedef itk::ImageFileWriter< ImageType > WriterType;
 WriterType::Pointer writer = WriterType::New();
 writer->SetInput(filter->GetOutput());
 writer->SetFileName(argv[3]);
 writer->SetNumberOfStreamDivisions(2);
 writer->Update();

 return EXIT_SUCCESS;
}
//////////////////////////////////////////////////////////////

Use a test image input.mha and run successively:
$ testPgm input.mha 0 output0.mha
$ testPgm input.mha 1 output1.mha

output0.mha and output1.mha should be the same but are not: only half of output1.mha is set to 0 instead of the full image.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0025849)
Bradley Lowekamp (developer)
2011-03-21 15:44

I believe this issue is related to the InPlaceImageFilter not checking that the input buffered region, equals the output buffer.

 Issue History
Date Modified Username Field Change
2011-03-21 13:00 Simon Rit New Issue
2011-03-21 15:42 Bradley Lowekamp Assigned To => Bradley Lowekamp
2011-03-21 15:42 Bradley Lowekamp Status new => assigned
2011-03-21 15:44 Bradley Lowekamp Note Added: 0025849


Copyright © 2000 - 2018 MantisBT Team