[vtkusers] vtkImageData: Is it possible to define array VTK_BIT(image->AllocateScalars) instead of VTK_UNSIGNED_CHAR to mask a polydata?
Dan Lipsa
dan.lipsa at kitware.com
Mon Jul 23 11:37:47 EDT 2018
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/20180723/17c5b2be/attachment.html>
More information about the vtkusers
mailing list