[vtkusers] How do i port an image from ITK to VTK

Prename Surname bsd.diverse at gmail.com
Wed Oct 11 07:48:49 EDT 2006


Hello Omar. Thank you for your response. I am having a problem getting it to
work though.
My program looks like this :

//Used for the analyze reader
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkExtractImageFilter.h"

//Used for the vtk examples
#include "vtkSphereSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkRenderWindowInteractor.h"

#include "itkVTKImageExport.h"
#include "vtkImageImport.h"

int main( int , char * argv[])
{

 return 0;
}
void ConnectVTKToITK(itkVTKImageExport* in, vtkvtkImageImport* out)
{

out->SetUpdateInformationCallback(in->GetUpdateInformationCallback());

       out->SetPipelineModifiedCallback(in->GetPipelineModifiedCallback());
       out->SetWholeExtentCallback(in->GetWholeExtentCallback());
       out->SetSpacingCallback(in->GetSpacingCallback());
       out->SetOriginCallback(in->GetOriginCallback());
       out->SetScalarTypeCallback(in->GetScalarTypeCallback());

out->SetNumberOfComponentsCallback(in->GetNumberOfComponentsCallback());

out->SetPropagateUpdateExtentCallback(in->GetPropagateUpdateExtentCallback());
       out->SetUpdateDataCallback(in->GetUpdateDataCallback());
       out->SetDataExtentCallback(in->GetDataExtentCallback());
       out->SetBufferPointerCallback(in->GetBufferPointerCallback());
       out->SetCallbackUserData(in->GetCallbackUserData());
}



It gives me the following compiler errors:

Error 1 error C2065: 'itkVTKImageExport' : undeclared
identifier d:\skole\thesis\Implementation\cpp_impl\src\VIS_Brain\main.cxx 32
Error 2 error C2065: 'in' : undeclared
identifier d:\skole\thesis\Implementation\cpp_impl\src\VIS_Brain\main.cxx 32
Error 3 error C2065: 'vtkvtkImageImport' : undeclared
identifier d:\skole\thesis\Implementation\cpp_impl\src\VIS_Brain\main.cxx 32
Error 4 error C2065: 'out' : undeclared
identifier d:\skole\thesis\Implementation\cpp_impl\src\VIS_Brain\main.cxx 32
Error 5 error C2448: 'ConnectVTKToITK' : function-style initializer appears
to be a function
definition d:\skole\thesis\Implementation\cpp_impl\src\VIS_Brain\main.cxx 33



So i think i cannot access those objects. Am i missing something?



Many regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061011/df1e7b81/attachment.htm>


More information about the vtkusers mailing list