[Insight-users] ManagedITK + vtkdotnet
Dan Mueller
dan.muel at gmail.com
Wed Dec 5 12:39:14 EST 2007
Hi Gareth,
Sorry for the belated reply, I am overseas and out of the office at
the moment. As such I don't have access to all the relevant
information, but I'll try to give you a few pointers to get you
started before I take a closer look once back home.
On 03/12/2007, Gareth Price <Gareth.Price at physics.cr.man.ac.uk> wrote:
>
> Hi there,
>
> Sorry for re-activating an old thread, but this seems to be exactly the
> subject I'm having problems with.
>
> I've been messing about with vtkdotnet and ManagedITK for a couple of weeks
> now with C++/CLI and can read images into ITK, process them and then send
> them to VTK using the vtkImageImport class as demonstrated in the previous
> message.
>
> I've been trying the reverse recently, i.e. writing out the data buffer from
> vtkImageData (using vtkImageExport) but have been unable to pass it to a
> vtkImage instance. I'm able to extract all the size, spacing, scalar type
> information fine, and create an empty itkImage, just can't figure out a way
> to transfer the pixel buffer.
>
> Does anyone know how I might be able to do this?
You should be able to set the itkImage.Buffer value with the void
pointer from the vtkdotnet object. However, if memory serves me
correctly, you will have to ensure the itkImage is allocated (by
calling Allocate) before doing this.
> From reading about, it seems that the native ImageToVTKImageFilter and
> VTKImageToImageFilter are the easiest way of accomplishing this task. I have
> no experience of wrapping itk classes (other than the little I have read in
> the ManagedITK documentation and in compiling said software using the
> supplied cMake files), but with a few pointers I am happy to dedicate some
> time to trying to wrap these.
Becuase of the interest in these classes, I will add them to the
enhancement list and give them high priority. However, I've got alot
on my plate at the moment, so don't expect them for a week or two. If
you can't wait and want to wrap them yourself, then let me know and I
can give you a few pointers when I've got the code base in front of
me.
BTW: If you are finding ManagedITK helpful, perhaps you can leave a
review at the Insight Journal, so the project can be improved. (Note
that the journal website is down at the moment, so you may have to
visit in a few days time when its back online.)
HTH
Dan
More information about the Insight-users
mailing list