I guess I have transferred vtkImageData to SimpleITK object with code from here: Transfer from VTK to SimpleITK
After I imported data into a sitk::Image in order apply some filter. Now, after this filter has been applied I intend to transfer data back to VTK vtkImageData object in order to render it. This procedure I didn’t found it nowhere. From what I saw by now, that sitk::Image can be saved on disk … but seem to be less efficient than to transfer data inside my application …
Is there possible to transfer my SimpleITK data into a vtkImageData ? If it is, can you tell me how ?
I have found here a little example: https://vtk.org/Wiki/VTK/ExamplesBoneYard/Cxx/VolumeRendering/itkVtkImageConvert
I hope I can use it in my case. I will come back here with feedback for the ones who have the same question.
Is there any method to transfer data from SimpleITK to VTK ? Because I have tried to use:
(from example above)
but is not recognized. I guess I have to include ITK too in my project … but I am sure that SimpleITK know this transfer … I don’t know myself how …
I have prepared everything for segmentation, I only need this transfer, from SimpleITK (sitk::Image) to VTK (vtkImageImport) …
You seem to have the right idea with using
vtkImportImage. You can copy the meta-data over and then use the
sitk:Image::GetBufferAs... method. Should be pretty straight forward.