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

Scapegoat Sarthak scapegoat.sarthak at gmail.com
Tue May 24 11:11:04 EDT 2016


Hi Tim,

Thanks for your reply.

That is what I could expect - I was planning on starting with
ResampleFilter and put in the option of setting a mask in the filter and do
modifications accordingly...

The thing is, since I know the image to be fairly large (in the order of
150x250x120), having this as a multi-threaded filter would be an efficient
solution instead of checking for threshold linearly. Also, I would like the
flexibility to input the mask from a separate image and not having to do
the computation in the main filter, if it can be avoided.

Best,
Sarthak

On 24 May 2016 at 10:56, Timothee Evain <tevain at telecom-paristech.fr> wrote:

> Hi Sarthak,
>
> That's not really a generic framework so I doubt you will find a
> ready-to-use filter to do that.
> If you want to hide all the processing code you may want to write your own
> filter.
> On a side note, if you're only interested in intensities as output, and
> willing to discard the correspondance between position and value, why not
> just compute the otsu threshold, then parse the buffer, adding the value to
> your vector when it's over/under this threshold (depending on what you
> consider as background)?
> That would be less hassle than a full mask image.
>
> HTH
> Tim
>
>
> ----- Mail original -----
> De: "Scapegoat Sarthak" <scapegoat.sarthak at gmail.com>
> À: "Bradley Lowekamp (NIH/NLM/LHC) [C]" <blowekamp at mail.nih.gov>,
> dzenanz at gmail.com
> Cc: insight-users at itk.org
> Envoyé: Mardi 24 Mai 2016 16:05:28
> Objet: Re: [ITK] [ITK-users] Vectorize/Linearize itk::Image
>
> 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
>
>
>
> _____________________________________
> 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
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160524/e554f64a/attachment.html>


More information about the Insight-users mailing list