Do segmentation on dicom volume

I have found some similar post here, but they are not clear me enough, so forgive me if I put here a too simple question.

I have a VC++ app that read dicom images (with VTK DICOM library). I am using for that vtkDICOMReader. Excellent class. Work good. And from dicom images I build a vtkVolume. Now it comes the hard work (for me). How can I use on this vtkVolume a SimpleITK segmentation in such a way to still read the segmentation outcome with my vtkDICOMReader and then vtkVolume ?

Why I ask that ? The SimpleITK/ITK examples are using simple images like input, and use the same simple image format for output … in my case I need to do segmentation on my dicom images. At least, how can I do repeat segmentation on every dicom image in order to loaded again into my vc++ app ?

I don’t know how to find a solution to my task, so please help me.

If you want to transfer an image from VTK to SimpleITK you will have to import the buffer and set the image metadata (spacing/origin/direction cosine) explicitly.

Please see this SimpleITK example for buffer importing and this stack overflow discussion for exporting the buffer from VTK (the discussion talks about importing into an ITK image and the approach is similar for a SimpleITK image).

1 Like

@flaviu2 have you considered reading the DICOM series using SimpleITK’s classes? Example.

@dzenanz I don’t know if is good idea, because my VC++ app already read input data with vtk classes. I only need to migrate vtk data into SimpleITK for segmentation operation and I have to translate it back for visual representation. I meant, will be more complicated to read data with ITK and represent it with VTK …

AFIK using VTK IO one can only read a slice !? You do need itk/gdcm for a 3D volume !?

VTK can also read a DICOM series, see example.