[Insight-users] extracting a vector from an 3D image stack (2)
Karthik Krishnan
karthik.krishnan at kitware.com
Mon Feb 5 13:06:01 EST 2007
On 2/5/07, Andre Bongers <a.bongers at mediri.com> wrote:
>
> Hi,
>
> refering to my last mail: To extract a vector from an 3D image stack I
> found this filter in the itk documentation:
>
> itkImageToVectorImageFilter.h
>
> Maybe a good way would be to convert the 3D image stack to a 2D vector
> image with this filter and then access the pixels of the vectorImage
> and stor them in an std::vector ?! Could anybody tell me if this idea could
> work ?
>
No. The filter is meant to convert k N-Dimensional images to a
N-Dimensional itk::VectorImage, where each pixel is an
itk::VariableLengthVector of length "k". So it will not serve your purpose.
Your best bet is to either write
1. Your own filter that does the job for you. It isn't much work. See
itk::ExtractImageFilter as an example.
2. Or Write your own ImageIterator that acts as a facade, really iterating
over a 2D region and returning vector pixels on the stack.
I would advise against option (2). Its very tricky. And it would be really
slow (since it ends up doing non-contiguous memory access at every pixel)..
One problem with the filter above is: In my folder of ITK version
3.0.1this header file does not exist. Where can I find it ?
>
It was a recent addition. You won't find it in ITK CVS Main branch.
Would really appreciate any help!
>
> Thanks
>
> Andre
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--
Karthik Krishnan
R&D Engineer,
Kitware Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070205/cbc270c8/attachment.html
More information about the Insight-users
mailing list