[vtkusers] vtkImageData: Is it possible to define array VTK_BIT(image->AllocateScalars) instead of VTK_UNSIGNED_CHAR to mask a polydata?

sergio campo vacingforo at gmail.com
Wed Jul 25 04:28:12 EDT 2018


Sorry but it continues be confusing for me.  I don't understand the
reasons. is there no way to make a mask Image with 0 and 1(bits) in order
to mask polydata?

On Mon, Jul 23, 2018 at 5:37 PM, Dan Lipsa <dan.lipsa at kitware.com> wrote:

> No, it needs to be an unsigned char. This is because different bits from
> that unsigned char are used for different things.
>
> https://blog.kitware.com/ghost-and-blanking-visibility-changes/
>
> On Mon, Jul 23, 2018 at 3:01 AM vacingforo <vacingforo at gmail.com> wrote:
>
>> Hello,
>>
>> I have the following  code :
>>
>>     vtkSmartPointer<vtkImageData> image =
>> vtkSmartPointer<vtkImageData>::New();
>>     image->SetSpacing(spacing);
>>     image->SetDimensions(dim);
>>     image->SetExtent(-1, dim[0] + 1, -1 , dim[1] + 1, 0, dim[2] - 1);
>>     image->SetOrigin(origin);
>>     image->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
>>
>>     vtkIdType count = image->GetNumberOfPoints();
>>     for (vtkIdType i = 0; i < count; ++i)
>>     {
>>         image->GetPointData()->GetScalars()->SetTuple1(i, white);
>>     }
>>
>> Is it possible to define array VTK_BIT(image->AllocateScalars) instead of
>> VTK_UNSIGNED_CHAR to mask a polydata?. This is in order to reduce the size
>> of matrix.
>>
>> for more details check small application main.cpp in the
>> following link:
>>
>>
>> https://drive.google.com/file/d/1FBnJw96zz5uv33uh_
>> GYV71OAT05NngOR/view?usp=sharing
>>
>>
>> Best regards,
>>
>> Sergio
>>
>>
>>
>> --
>> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://public.kitware.com/mailman/listinfo/vtkusers
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180725/892e7b09/attachment.html>


More information about the vtkusers mailing list