[vtkusers] vtkDataArray: Memory allocation problem

michiel mentink michael.mentink at st-hughs.ox.ac.uk
Mon Feb 1 10:40:00 EST 2010


I tried using that example to write a metaImage volume, but I kept on
failing to write it properly.
Then I found out I had to tell vtk about the data type. It would help if the
example made people aware of that:
For instance,

  imageData->SetScalarTypeToUnsignedShort()


cheers, Michael


On Mon, Feb 1, 2010 at 3:04 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Mon, Feb 1, 2010 at 9:22 AM, Liam Kurmos <quantum.leaf at googlemail.com>wrote:
>
>> Hi,
>>
>> I figured out how to do this recently too. Previously I was loading a 1D
>> array and then using setScalars for the whole volume (as per another
>> example). Eventually i found  SetScalarComponentFromDouble in the
>> documentation.
>>
>> This example would have been helpful but I didn't find it. At first i
>> didn't appreciate that ImageData could be a volume. I'm not sure a beginner
>> would know that IterateImageData<http://www.cmake.org/Wiki/VTK/Examples/IterateImageData>is what theyre looking for.
>>
>> not sure how this could be best improved, but thought i'd give feedback,
>>
>> Liam
>>
>>
> Liam,
>
> This type of feedback is extremely important, thanks.
>
> I added a sentence to the section:
>
> *Working with Stuctured (grid aligned) 3D Data (vtkImageData)*
> "ImageData" is not the traditional "flat, 2D image" you are used to. It is
> a special VTK data structure in the collection of 3D data structures
> provided by VTK. Here is an overview of these data structures: [1]. Image
> data can represent at typical 2D image, but also, a 3D volume.
>
> I also added:
> "Set and access locations in a 3D image."
> on the main examples page with the example you referred to, and
>
> "This example demonstrates how to set and access locations in a 3D image."
> On the example itself.
>
> Would this have helped you find what you were looking for? Any further
> suggestions?
>
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100201/b9dd1936/attachment.htm>


More information about the vtkusers mailing list