[Insight-users] Error while trying to read a vector image using VariableLengthVector

Karthik Krishnan karthik.krishnan at kitware.com
Sun Nov 20 02:49:23 EST 2011


There is nothing that will give you that. You can use a itk::Image<
VariableLengthVector< TScalarType > >. You'll need your custom reader that
reads each pixel and sets the vector length on a per pixel basis.

That said, you can't use the standard itk ImageIO classes, since there is
nothing to read in this kind of a file. You can't use the standard ITK
imaging filters, since there is nothing that will run on such images.

--
karthik

On Sun, Nov 20, 2011 at 6:59 AM, David Doria <daviddoria at gmail.com> wrote:

> On Sat, Nov 19, 2011 at 8:22 PM, ravikiranj <ravikiran.j.127 at gmail.com>
> wrote:
> >
> > Actually the number of values I need to write per pixel varies from
> 0..5000
> > but the average number of components per pixel maybe like 20-30 (highly
> > sparse, compared to max component = 5000). If I understand correctly,
> Vector
> > Image will first allocate 5000 components per pixel irrespective of I
> use it
> > or not (I think I know this because I'm getting out of memory error
> during
> > allocation of image). Is there a way I can write say 1 component for
> first
> > pixel, 20 components for second pixel and then 1000 components for 3rd
> pixel
> > and so on.. ?
> >
> > I set an initial vector length and try pixelValue.SetSize(newsize, false)
> > for variable components and write the vector image, but after reading it
> > back, it has the same no. of components as initial vector length.
> >
> > Regards,
> >  Ravikiran
>
> Ah, I see what you're saying. As far as I know that is not possible -
> I'll let the experts take it from here if it is.
>
> David
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111120/9c3128bf/attachment.htm>


More information about the Insight-users mailing list