[Insight-users] itkImageToVTKImageFilter not updating entirely

Charlotte Curtis c.f.curtis at gmail.com
Fri Jul 10 18:29:43 EDT 2009


Hi Luis,

Thanks for the reply.  I've created a minimal example and filed a bug report
(http://public.kitware.com/Bug/view.php?id=9259).  I'm looking at the
Min/Max values using vtkImage->GetScalarRange(), and I am then using the
resulting values for automatic window/leveling.

Hope this helps,

Charlotte

On Tue, Jun 30, 2009 at 11:51 AM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

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


More information about the Insight-users mailing list