[vtkusers] 3D mesh

Nicolas Gallego nicgallego at gmail.com
Fri Sep 5 05:27:06 EDT 2014


Hi Selcuk,

So your question is about interfacing your data to VTK formats. I was in a
similar situation recently, not with image data but with surface data and
what I did was to write in my application, glue code to structure data in
some vtk format.

It shouldn't be that hard. I guess you could try to build from your program
something like a vtkImage similar to what the readers in the examples are
providing, or just save your data, in some of the supported image formats
the files as inputs to the processing pipeline proposed in the examples.
Check this formats in the inheritance diagram of the vtkImageReader for
example [1].

Hope that helps,
ps. keep the discussion on the forum so that you can get help from others
also. Don't forget to check if vtkusers at vtk.org is either in the to: or the
cc: fields of your message.


[1] http://www.vtk.org/doc/release/6.1/html/classvtkImageReader.html

Nicolás Gallego-Ortiz
Université catholique de Louvain, Belgium


2014-09-04 15:50 GMT+02:00 Selcuk ÇALLI <selcukcalli at gmail.com>:

> Hi Nicolas, thank you for your answer.
> vtkcontourfilt can meet my needs. But I have found examples on the
> internet by reading data from the file takes place. I want to use dummy dat
> on memory not use file. can you help in this regard.
> For example:
>
> vtkVolume16Reader *reader = vtkVolume16Reader::New();
> reader->SetDataDimensions (70,50); reader->SetImageRange (1,20);
> reader->SetFilePrefix (filePath); int thresholdValue = 100;
> vtkContourFilter *filter = vtkContourFilter::New();
> filter->SetInputConnection(reader->GetOutputPort()); // I don't want read
> file, I want to generate point data on memory filter->SetValue(0,
> thresholdValue); vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
> normals->SetInputConnection(filter->GetOutputPort()); vtkPolyDataMapper
> *mapper = vtkPolyDataMapper::New(); mapper->SetInputConnection(normals->GetOutputPort());
> mapper->ScalarVisibilityOff(); vtkActor *mesh = vtkActor::New();
> mesh->SetMapper(mapper);
>
> // I don't want read file, I want to generate point data on memory
> example:
> vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
> unsigned int x_cnt = 100; unsigned int y_cnt = 4; unsigned int z_cnt = 60;
> for(unsigned int x = 0; x < x_cnt; x++) { for(unsigned int y = 0; y <
> y_cnt; y++) { for(unsigned int z = 0; z < z_cnt; z++) {
> points->InsertNextPoint(x, y, z); } } }
>
>
>
>
> 2014-09-04 15:31 GMT+03:00 Nicolas Gallego <nicgallego at gmail.com>:
>
>> Hi Selcuk,
>>
>> If you data is already binary, you could use vtkContourFilter [1] or
>> equivanlently itkBinaryMask3DMeshSource[2]
>>
>> [1] http://www.vtk.org/doc/release/6.1/html/classvtkContourFilter.html
>> [2]
>> http://itk.org/ITKExamples/src/Core/Mesh/ExtractIsoSurface/Documentation.html?highlight=itkbinarymask3dmeshsource
>>
>> hope that helps,
>>
>> Nicolás Gallego-Ortiz
>> Université catholique de Louvain, Belgium
>>
>>
>> 2014-09-04 13:19 GMT+02:00 Selcuk ÇALLI <selcukcalli at gmail.com>:
>>
>>>  Can we obtain a mesh from 3D array with floating values? What kind of
>>> filters/functions do we need to do this process? Sample output images are
>>> below.
>>>
>>>
>>>
>>>
>>>
>>>
>>>>>>
>>>
>>>>>>
>>> _______________________________________________
>>> 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://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140905/785ef89e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ornek_1.jpg
Type: image/jpeg
Size: 40735 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140905/785ef89e/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ornek_2.jpg
Type: image/jpeg
Size: 56781 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140905/785ef89e/attachment-0001.jpg>


More information about the vtkusers mailing list