[Kiwiviewer] Load multiple part scene in KiwiViewer

Pat Marion pat.marion at kitware.com
Tue Feb 12 11:34:58 EST 2013


Great, glad you figured out the Calculator trick.  So, to get the colors
you want, rather than using integers to identify parts, you actually have
to add rgb data.  In vtk, this is done by creating an unsigned char array
(vtkUnsignedCharArray) that has 3 components, and number of tuples ==
number of points on the model.  Then set each tuple to the same rgb
255,255,255 for example.  You should name the array 'rgb_colors'.  Then
merge all the models together.

One way to do it is with the Python programmable filter in paraview.
Something like:

def makeArray(npoints):
    colors = vtk.vtkUnsignedCharArray()
    colors.SetName('rgb_colors')
    #... fill in the array
   return colors

self.GetOutput().GetPointData().AddArray(makeArray(self.GetOutput().GetNumberOfPoints()))

Pat


On Wed, Feb 13, 2013 at 2:27 AM, Frank Millo <frank.millo at gmail.com> wrote:

> Hi Pat,
>
> thanks for your quick reply and suggestions.
> I managed to package up my data and save it as .vtp and display it in Kiwi.
> However, the coloring is unclear to me. I used the calculator and added a
> scalar value (integer) for each part, it appears that it uses this value
> to index into a color map. I got a color per object but it is changing
> when I add objects or parts.
>
> It would be great if you could provide some insight on, how to specify a
> distinct color for each object.
> eg. part1 = red; part2 = blue ....
>
> Again, thanks for you help.
> Frank
>
>
>
>
> On Mon, Feb 11, 2013 at 11:22 PM, Pat Marion <pat.marion at kitware.com>wrote:
>
>> Hi Frank,
>>
>> KiwiViewer 0.0.2 for iOS doesn't support the .kiwi file extension, to use
>> the .kiwi extension you'll need to grab KiwiViewer v1.0 which is available
>> on Android devices.  The upcoming KiwiViewer v2.0 release for iOS will have
>> support .kiwi files, and .zip directories of files.
>>
>> For KiwiViewer 0.0.2, you can append all your .vtk files into a single
>> .vtk file using ParaView.  You can open all your files at once in ParaView,
>> select all of them, and then apply the Append Geometry filter which you can
>> find in the Filter --> Alphabetical menu.  Then save the data using File
>> --> Save Data.  You can choose .vtk, or .vtp as the file format to save to.
>>
>> If you want each piece to have a separate color, like the 'NAMIC Knee
>> Atlas' dataset, you can do that with ParaView too.  Let me know if that's
>> something you want to try.
>>
>> Pat
>>
>>
>>  On Tue, Feb 12, 2013 at 2:35 AM, Frank Millo <frank.millo at gmail.com>wrote:
>>
>>>  Hi all,
>>>
>>> how can I import a multi part scene into Kiwiviewer?
>>> I can upload thru dropbox single .vtk files from Paraview and display
>>> them in Kiwiviewer.
>>> However when using the method described in the WIKI e.g. filename,url
>>> I get the error 'No installed apps support opening this file'.
>>>
>>> Can anyone point me to resources describing how to package up polygonal
>>> meshes (.vtk format) so I can show them in Kiwiviewer? Basically I would
>>> like to create a scene with my data similar to the built in example:
>>> 'NAMIC Knee Atlas'.
>>> I used ParaView version 3.8 and KiwiViewer 0.0.2
>>>
>>> Thanks,
>>> Frank
>>>
>>> _______________________________________________
>>> Kiwiviewer mailing list
>>> Kiwiviewer at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/kiwiviewer
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/kiwiviewer/attachments/20130213/f9e23252/attachment.html>


More information about the Kiwiviewer mailing list