MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0012684 | VTK | (No Category) | public | 2011-10-28 12:02 | 2013-12-19 07:24 |
Reporter | John Stark | ||||
Assigned To | Bill Lorensen | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | 6.1.0 | |||
Project | TBD | ||||
Type | incorrect functionality | ||||
Summary | 0012684: vtkImageImport has problems with PipelineMtime and upstream changes. | ||||
Description | I have been using the ImageToVTKImageFilter, but have found a bug that the downstream pipeline does not correctly detect changes upstream of the filter. In the sample below, an ITK image is constructed and filled with the value 127. This value is correctly extracted as float using a vtkImageCast filter. However, when I change the data buffer, filling it with zeros, the output initially reports the image value as unchanged, even after Update() is called. It appears to explicitly require the ITK converter to be updated, which should not be necessary. I think the bug relates to vtkImageImport, which does not correctly report the PipelineMtime, but I am not sure. I am using a git version of VTK, based on dbb88cda6b6d703b237b431629562ff275aae000 from July this year. Code sample: #include <itkImage.h> #include <itkImageToVTKImageFilter.h> #include <vtkImageCast.h> #include <vtkImageData.h> #include <vtkSmartPointer.h> int main() { const int dims[3] = { 64, 64, 64 }; // Image size in pixels typedef itk::Image<unsigned char, 3> ImageType; ImageType::RegionType region; for ( int i(0); i<3; ++i ) { region.SetSize(i, dims[i] ); region.SetIndex(i,0); } ImageType::Pointer image = ImageType::New(); image->SetLargestPossibleRegion(region); image->SetBufferedRegion(region); image->Allocate(); image->FillBuffer( 127 ); typedef itk::ImageToVTKImageFilter< ImageType > ConverterType; ConverterType::Pointer myConverter = ConverterType::New(); myConverter->SetInput ( image ); myConverter->UpdateOutputInformation(); vtkSmartPointer<vtkImageCast> imCast = vtkSmartPointer<vtkImageCast>::New(); imCast->SetOutputScalarTypeToFloat(); imCast->SetInput(myConverter->GetOutput()); vtkImageData * tstImg = imCast->GetOutput(); tstImg->Update(); float fval0 = ((const float*)tstImg->GetScalarPointer())[0]; image->FillBuffer(0); image->Modified(); image->GetPixelContainer()->Modified(); tstImg->Update(); float fval1 = ((const float*)tstImg->GetScalarPointer())[0]; myConverter->GetOutput()->UpdateInformation(); tstImg->Update(); float fval2 = ((const float*)tstImg->GetScalarPointer())[0]; if ( (fval0 == 127.) && (fval1 == 0.) && (fval2 == 0.) ) { return EXIT_SUCCESS; } else { return EXIT_FAILURE; } } | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://www.vtk.org/Bug/file/9331/ComputePipelineMTime.patch ![]() https://www.vtk.org/Bug/file/9332/sampleCrash.cxx ![]() https://www.vtk.org/Bug/file/9575/CMakeLists.txt ![]() https://www.vtk.org/Bug/file/9576/main.cxx | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-10-28 12:02 | John Stark | New Issue | |||
2011-10-28 12:07 | John Stark | Note Added: 0027620 | |||
2012-11-06 08:23 | John Stark | File Added: ComputePipelineMTime.patch | |||
2012-11-06 08:31 | John Stark | Note Added: 0029655 | |||
2012-11-06 08:38 | John Stark | Note Edited: 0029655 | bug_revision_view_page.php?bugnote_id=29655#r519 | ||
2012-11-06 08:38 | John Stark | File Added: sampleCrash.cxx | |||
2012-12-12 07:52 | John Stark | Note Edited: 0029655 | bug_revision_view_page.php?bugnote_id=29655#r534 | ||
2012-12-12 07:55 | John Stark | Note Added: 0029870 | |||
2013-12-16 12:57 | Dave DeMarle | Assigned To | => Bill Lorensen | ||
2013-12-16 12:57 | Dave DeMarle | Status | backlog => tabled | ||
2013-12-16 12:58 | Dave DeMarle | Status | tabled => backlog | ||
2013-12-16 16:41 | John Stark | Note Edited: 0029870 | bug_revision_view_page.php?bugnote_id=29870#r690 | ||
2013-12-18 17:13 | John Stark | File Added: CMakeLists.txt | |||
2013-12-18 17:13 | John Stark | File Added: main.cxx | |||
2013-12-18 17:16 | John Stark | Note Added: 0032026 | |||
2013-12-18 17:21 | John Stark | Note Edited: 0032026 | bug_revision_view_page.php?bugnote_id=32026#r696 | ||
2013-12-19 07:24 | Dave DeMarle | Note Added: 0032027 | |||
2013-12-19 07:24 | Dave DeMarle | Status | backlog => closed | ||
2013-12-19 07:24 | Dave DeMarle | Resolution | open => fixed | ||
2013-12-19 07:24 | Dave DeMarle | Fixed in Version | => 6.1.0 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|