<br>Hi Charlotte,<br><br>Thanks for the report.<br><br>This actually looks like a bug.<br><br>Could you please clarify how you are looking at the Min / Max<br>values of the resulting vtkImageData ?<br><br><br>Also, could you please create a bug report at:<br>
<a href="http://public.kitware.com/Bug/my_view_page.php">http://public.kitware.com/Bug/my_view_page.php</a><br><br><br>Providing a minimal example that illustrates <br>the incorrect behavior will be ideal.<br><br><br> Thanks<br>
<br><br> Luis<br><br><br>----------------------------------------------------------------------------------------<br><div class="gmail_quote">On Thu, Jun 25, 2009 at 12:35 PM, Charlotte Curtis <span dir="ltr"><<a href="mailto:c.f.curtis@gmail.com">c.f.curtis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">There seems to be a bit of an issue with itkImageToVTKImageFilter: the<br>
image information isn't entirely being updated when "Update" is called<br>
downstream. The image data itself does get updated, but (for example)<br>
the min/max intensity values do not. The odd thing is, it will update<br>
the third time (I'm running my pipeline from a GUI and if I click the<br>
"run" button 3 times, the image finally displays properly).<br>
<br>
This behaviour seems to have been reported several years ago<br>
(<a href="http://www.itk.org/pipermail/insight-users/2003-March/003110.html" target="_blank">http://www.itk.org/pipermail/insight-users/2003-March/003110.html</a>),<br>
but it doesn't look to have been resolved. I took a look at the<br>
source code for the filter, and it seems that the "Update" method just<br>
calls Update on the importer component. If I copy and paste exactly<br>
the code from the filter, as follows:<br>
<br>
vtkImageImport *importer = vtkImageImport::New();<br>
itk::VTKImageExport< ImageType2D >::Pointer exporter =<br>
itk::VTKImageExport< ImageType2D >::New();<br>
<br>
importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());<br>
importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());<br>
importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());<br>
importer->SetSpacingCallback(exporter->GetSpacingCallback());<br>
importer->SetOriginCallback(exporter->GetOriginCallback());<br>
importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());<br>
importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());<br>
importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());<br>
importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());<br>
importer->SetDataExtentCallback(exporter->GetDataExtentCallback());<br>
importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());<br>
importer->SetCallbackUserData(exporter->GetCallbackUserData());<br>
<br>
exporter->SetInput(image);<br>
exporter->Update();<br>
<br>
and then explicitly call Update on the importer as well:<br>
<br>
importer->Update();<br>
<br>
Everything works properly. I'm fine with just using this code in my<br>
program, but perhaps something should be fixed in<br>
itkImageToVTKImageFilter? I don't know if adding "importer->Update()"<br>
to the source would be the proper way of doing things (seems kind of<br>
like a workaround), or if the UpdateDataCallback method needs to be<br>
changed.<br>
<br>
Thanks,<br>
<br>
Charlotte<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>