[ITK-users] Vectorize/Linearize itk::Image
Scapegoat Sarthak
scapegoat.sarthak at gmail.com
Tue May 24 10:05:28 EDT 2016
Hi Bradley, Dzenan,
Thanks for your replies. The main idea is the following:
1. Read image from file -- inputImage
2. Generate a mask to remove background information (either using Otsu or
reading another image with this information) -- inputMask
3. Vectorize the inputImage in the region defined by inputMask --
tempColMat or tempRowMat
4. Concatenate multiple tempColMat/tempRowMat -- trainingData
5. Pass trainingData to classifier of choice.
I have tried both the solutions presented and neither work as optimally as
I would like. Ideally, I would like to use a single multi-threaded filter
which takes a mask as input along with the mask and extracts pixel values
as a vector in return.
Best,
Sarthak
On 24 May 2016 at 09:55, Lowekamp, Bradley (NIH/NLM/LHC) [C] <
blowekamp at mail.nih.gov> wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160524/03d24284/attachment.html>
More information about the Insight-users
mailing list