[ITK-dev] itk::ImportImageFilter buffer

Matt McCormick matt.mccormick at kitware.com
Mon Jul 27 10:48:56 EDT 2015


Hi Marco,

std::vector is usually contiguous in memory, so you can pass the
buffer directly.  However, you will want to set

  importImageFilterWillOwnTheBuffer = false;

since the std::vector will de-allocate the memory when it goes out of scope.

HTH,
Matt

PS.  Please reply-to-all so the message goes on the mailing lists.

On Mon, Jul 27, 2015 at 10:28 AM, Marco Dev <marco.dev.open at gmail.com> wrote:
> I have a question about numberofpixel I have a 113mb pixel so how can I
> allocate the a standard c array ?
> I parsed this file on IO then hold the content of file in std::vector<char>
> and I have to chunk the space and pass to localBuffer
> Is my idea is correct ?
> I want to add a big source file as a buffer into a Itk image
> Thanks in advance
>
> On Mon, Jul 27, 2015 at 6:35 PM, Matt McCormick <matt.mccormick at kitware.com>
> wrote:
>>
>> Hi Marco,
>>
>> Is numberOfPixels correct?
>>
>> Matt
>>
>> On Mon, Jul 27, 2015 at 7:49 AM, Marco Dev <marco.dev.open at gmail.com>
>> wrote:
>> > Hi dears,
>> > How can I pass the string as unsigned char to importimagefilter I casted
>> > but
>> > Just for one character
>> >
>> >    const bool importImageFilterWillOwnTheBuffer = true;
>> >
>> >    importFilter->SetImportPointer( localBuffer, numberOfPixels,
>> >
>> >                                    importImageFilterWillOwnTheBuffer );
>> >
>> >
>> > thanks in advance
>> >
>> >
>> > _______________________________________________
>> > 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://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-developers
>> >
>
>


More information about the Insight-developers mailing list