[Insight-users] VTKImageImport - Input Components Mayhem

Luis Ibanez luis.ibanez at kitware.com
Mon Feb 15 16:50:29 EST 2010


Hi Christian,

Does your image actually has 3 components ?

Are you instantiating the ITK image with a pixel
type that has 3 components ?

The typedef for the ITK image was not included
in your email.


    Please let us know,


           Thanks


               Luis


----------------------------------------------------
On Mon, Feb 15, 2010 at 4:04 PM, Christian Werner
<christian.werner at rwth-aachen.de> wrote:
> Hello!
>
> At first I want to thank Arunachalam and Wagner for their responses on my
> last thread, thanks! :-) I finally managed to implement my vtk2itk2vtk
> templated super-class. It works with one little flaw:
>
> I have to SetNumberOfScalarComponents my vtkImageData to 1 before going
> through the whole conversion loop...
> (ERROR: VTKImageImport(0x22900f0): Input number of components is 3 but
> should be 1)
>
> This is bad, because the image content is clearly corrupted that way. It
> goes well through my vtk2itk2vtk and I can save a result vtk image, but this
> is distorted, as I fiddled around with these scalar components. Also the ITK
> filters I want to use on my import complain about
>
> ERROR: In /opt/ParaView3/VTK/Filtering/vtkImageData.cxx, line 1473
> vtkImageData (0x228afd0): GetScalarPointer: Pixel (0, 0, 0) not in memory.
> Current extent= (0, -1, 0, -1, 0, 0)
>
>
> This is how my pipelines connect:
>
> template <typename VTK_Exporter, typename ITK_Importer>
> void ConnectPipelines(VTK_Exporter* exporter, ITK_Importer importer)
> {
>  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());
> }
>
> I hope this can easily be fixed as I am so happy that after working the
> whole day on that vtk2itk2vtk stuff I finally got a vtk image that goes
> through this conversion jungle. How can it be equipped to survive this
> adventure undistorted?
>
>
> Best regards,
> Christian
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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
>


More information about the Insight-users mailing list