[ITK-users] Conversion of itk::Image to other formats

Lambert Zijp ljzijp at gmail.com
Thu Mar 10 10:48:52 EST 2016


Hi Matt,

Thank you for responding and for responding so quickly!
I guess I did no make myself clear. I want to convert itk image* to* my own
format in memory; fileformats are not involved. I have got the conversion
to itk more or less working, but I need a function that accepts *any* kind
of itk images, and converts it to my own datastructure. I'm asking about
the function-prototype; preferably not templated, because as an old school
C programmer, I prefer a switch statement on the pixeltype and number of
dimensions...

Greetings,
Lambert

On Thu, Mar 10, 2016 at 4:28 PM, Matt McCormick <matt.mccormick at kitware.com>
wrote:

> Hi Lambert,
>
> This example shows how to read in an unknown image type. It
> demonstrates how to go between run-time type specification and the
> compile-image type specification of ITK.
>
>
> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html
>
> This approach could be used for your problem.
>
> HTH,
> Matt
>
> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp <ljzijp at gmail.com> wrote:
> > Dear itk users,
> > I'm new to itk and also not very proficient in C++...
> > I want to try some deformable registration methods implemented in itk,
> and
> > need to convert my own format of images and volumes to itk, and back.
> > For conversion to itk, I use 'ImportImageFilter', because I do not want
> to
> > make a copy of the pixels/voxels.
> > Converting itk images and volumes back to my own format, is giving me a
> > headache; I'm confused about 'Image', SmartPointer and ConstPointer and
> > template stuff.
> > Could you get me started by suggesting me a function prototype?
> >
> > Something like:
> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage);
> >
> > The ItkImage can be any pixeltype, any dimension, and vector images
> should
> > also be accepted by the conversion routine. In that conversion function,
> and
> > need to be able to put a switch on pixeltype and number of dimensions.
> >
> > Greetings,
> > Lambert
> >
> > _____________________________________
> > 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.php
> >
> > 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://public.kitware.com/mailman/listinfo/insight-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160310/ba9f344a/attachment.html>


More information about the Insight-users mailing list