[ITK] [ITK-users] Vectorize/Linearize itk::Image

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Tue May 24 09:55:18 EDT 2016


Hello,

You want to look at the ImportImageContainer[1]. Every itk::Image has one of these object to hold the buffer. The fastest way to “convert” the image, is not to do any work and just get a pointer to the buffer.

HTH,
Brad

[1] https://itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html

> On May 24, 2016, at 9:48 AM, Scapegoat Sarthak <scapegoat.sarthak at gmail.com> wrote:
> 
> Hello All,
> 
> What would be the fastest way to convert an itk::Image< DataType, Dimensions > to a single vector of intensities? Ideally, I would like to concatenate multiple such vectors and pass them to machine learning algorithms.
> 
> Thanks,
> Sarthak 
> _____________________________________
> 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

_____________________________________
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


More information about the Community mailing list