[Paraview] Labelling Cell Data

2018-01-29 Thread Dean, Kevin
Hello All,

I am currently writing a plugin for ml labelling purposes. I split
different volumes into slices, grid them, and label them. I currently use
the properties panel one grid (pixel) at a time (which for time purposes
isn't the best obviously). Is it possible to incorporate ParaView's
Selection Widget to get the cells that are currently highlighted in order
to change their cell labels? Thank you,

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://paraview.org/mailman/listinfo/paraview


[Paraview] Fwd: Fwd: Updating Properties Panel

2017-05-24 Thread Dean, Kevin
-- Forwarded message --
From: Dean, Kevin <kevin.d...@decisionsciencescorp.com>
Date: Wed, May 24, 2017 at 10:59 AM
Subject: Re: [Paraview] Fwd: Updating Properties Panel
To: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>


Ok, Some Information will probably stay the same, such as the Scene
Identification, Object Index, etc.

However, I have the plugin set up to perform a vtkExtractBlock when
selecting the object in the MB dataset I want to adjust. (These are truth
coordinates for SVMs and Convolutional Neural Nets) So if I am to adjust
the position of the object within the SceneID, I would like for those new
coordinates to be dispalyed in the Properties Panel.

But most of the properties will probably be information only.

Kevin

On Wed, May 24, 2017 at 8:09 AM, Utkarsh Ayachit <
utkarsh.ayac...@kitware.com> wrote:

> Kevin,
>
> Before we discuss how this can be done (or can't be done), let's try
> to figure out what we want here.
>
> Is the user ever expected to change "Scene ID", "Object Index" etc.,
> the parameters that you are expecting to change their value when the
> "Current Object" is changed, or are they just for information purposes
> only?
>
> Utkarsh
>
> On Tue, May 23, 2017 at 1:48 PM, Dean, Kevin
> <kevin.d...@decisionsciencescorp.com> wrote:
> >
> > -- Forwarded message --
> > From: Dean, Kevin <kevin.d...@decisionsciencescorp.com>
> > Date: Mon, May 22, 2017 at 12:37 PM
> > Subject: Re: Updating Properties Panel
> > To: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>
> >
> >
> > So I have one more question. I have added a dropdown box in order to
> switch
> > between objects in my MB DataSet. Is it the same kind of Idea where I
> need
> > to Update the metadata in order for the values of the block information
> to
> > change in the panel again? Here are pictures of how it is currently.
> (Also,
> > when I print out the "current" values to the command line, they are
> correct
> > (they just aren't correct in the properties panel).
> >
> > Thanks,
> >
> > Kevin
> >
> > P.S. - you can see that Current Object Differs, but the other information
> > remains the same)
> >
> > On Thu, May 18, 2017 at 10:59 AM, Dean, Kevin
> > <kevin.d...@decisionsciencescorp.com> wrote:
> >>
> >> Thanks Utkarsh, I really appreciate it! If I have any questions I'll get
> >> back to you. Thanks again.
> >>
> >> Kevin
> >>
> >> On Thursday, May 18, 2017, Utkarsh Ayachit <utkarsh.ayac...@kitware.com
> >
> >> wrote:
> >>>
> >>> Kevin,
> >>>
> >>> Here's a new example for filling up properties with default values read
> >>> from file meta-data.
> >>>
> >>> https://gitlab.kitware.com/paraview/paraview/merge_requests/1655
> >>>
> >>> Hope that gives you enough pointers to make progress.
> >>>
> >>> Utkarsh
> >>>
> >>> On Wed, May 17, 2017 at 9:39 AM, Utkarsh Ayachit
> >>> <utkarsh.ayac...@kitware.com> wrote:
> >>>>
> >>>> Kevin,
> >>>>
> >>>> Are you asking how to add a way for your reader to allow the the user
> to
> >>>> interactively place a (x,y,z) location? If so, look at "Point Source"
> [1].
> >>>> The "Center" property, together with the  XML snippet
> should
> >>>> add the interactive widget.
> >>>>
> >>>> Utkarsh
> >>>>
> >>>> [1]
> >>>> https://gitlab.kitware.com/paraview/paraview/blob/master/Par
> aViewCore/ServerManager/SMApplication/Resources/sources.xml#L1113-1153
> >>>>
> >>>> On Tue, May 16, 2017 at 5:53 PM, Dean, Kevin
> >>>> <kevin.d...@decisionsciencescorp.com> wrote:
> >>>>>
> >>>>> Hey Guys,
> >>>>>
> >>>>> I was wondering if there's an example for me to look at for updating
> >>>>> values in the fields of the properties panel. I am writing a Plugin
> that has
> >>>>> the option of reading in values from a CSV, but I would like to have
> the
> >>>>> values update in the properties panel... similar to how if you use a
> probe
> >>>>> location filter, it adjusts (x, y, z) interactivley. Thanks for the
> help.
> >>>>>
> >>>>> Kevin
> >>>>>
> >>>>> This ema

[Paraview] Fwd: Updating Properties Panel

2017-05-23 Thread Dean, Kevin
-- Forwarded message --
From: Dean, Kevin <kevin.d...@decisionsciencescorp.com>
Date: Mon, May 22, 2017 at 12:37 PM
Subject: Re: Updating Properties Panel
To: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>


So I have one more question. I have added a dropdown box in order to switch
between objects in my MB DataSet. Is it the same kind of Idea where I need
to Update the metadata in order for the values of the block information to
change in the panel again? Here are pictures of how it is currently. (Also,
when I print out the "current" values to the command line, they are correct
(they just aren't correct in the properties panel).

Thanks,

Kevin

P.S. - you can see that Current Object Differs, but the other information
remains the same)

On Thu, May 18, 2017 at 10:59 AM, Dean, Kevin <kevin.dean@
decisionsciencescorp.com> wrote:

> Thanks Utkarsh, I really appreciate it! If I have any questions I'll get
> back to you. Thanks again.
>
> Kevin
>
> On Thursday, May 18, 2017, Utkarsh Ayachit <utkarsh.ayac...@kitware.com>
> wrote:
>
>> Kevin,
>>
>> Here's a new example for filling up properties with default values read
>> from file meta-data.
>>
>> https://gitlab.kitware.com/paraview/paraview/merge_requests/1655
>>
>> Hope that gives you enough pointers to make progress.
>>
>> Utkarsh
>>
>> On Wed, May 17, 2017 at 9:39 AM, Utkarsh Ayachit <
>> utkarsh.ayac...@kitware.com> wrote:
>>
>>> Kevin,
>>>
>>> Are you asking how to add a way for your reader to allow the the user to
>>> interactively place a (x,y,z) location? If so, look at "Point Source" [1].
>>> The "Center" property, together with the  XML snippet
>>> should add the interactive widget.
>>>
>>> Utkarsh
>>>
>>> [1] https://gitlab.kitware.com/paraview/paraview/blob/master
>>> /ParaViewCore/ServerManager/SMApplication/Resources/sources.
>>> xml#L1113-1153
>>>
>>> On Tue, May 16, 2017 at 5:53 PM, Dean, Kevin <
>>> kevin.d...@decisionsciencescorp.com> wrote:
>>>
>>>> Hey Guys,
>>>>
>>>> I was wondering if there's an example for me to look at for updating
>>>> values in the fields of the properties panel. I am writing a Plugin that
>>>> has the option of reading in values from a CSV, but I would like to have
>>>> the values update in the properties panel... similar to how if you use a
>>>> probe location filter, it adjusts (x, y, z) interactivley. Thanks for the
>>>> help.
>>>>
>>>> Kevin
>>>>
>>>> This email and its contents are confidential. If you are not the
>>>> intended recipient, please do not disclose or use the information within
>>>> this email or its attachments. If you have received this email in error,
>>>> please report the error to the sender by return email and delete this
>>>> communication from your records.
>>>> ___
>>>> 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 ParaView Wiki at:
>>>> http://paraview.org/Wiki/ParaView
>>>>
>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>>
>>>>
>>>
>>

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Updating Properties Panel

2017-05-16 Thread Dean, Kevin
Hey Guys,

I was wondering if there's an example for me to look at for updating values
in the fields of the properties panel. I am writing a Plugin that has the
option of reading in values from a CSV, but I would like to have the values
update in the properties panel... similar to how if you use a probe
location filter, it adjusts (x, y, z) interactivley. Thanks for the help.

Kevin

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Multi Block Data Set

2017-05-12 Thread Dean, Kevin
Hello,

Is there a way to select a block from a multiblock dataset and update its
position independent of the rest of the dataset?

Kevin Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Interactive Plugin Examples

2017-05-02 Thread Dean, Kevin
Hello All,

I was wondering if there are any examples on how to make an interactive
plugin. What that means is I would like to have the ability to adjust
(let's say) the size of a box and move it along an image to define an
object's (object is within image) extents.

Thanks,

Kevin

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Labeling Polydatas

2017-02-02 Thread Dean, Kevin
Hey Guys,

So I understand how to utilize the selection display inspector to visualize
a cell id number. However, is there a way to have the labels associated
with the polydata (or all inside of an vtkAppendPolyData) so that when I
load my .vtp, I automatically see the Cell Ids?

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] vtkTableAlgorithm

2016-10-11 Thread Dean, Kevin
I am currently trying to compose a plugin that updates a 2D histogram of my
data. I was wondering if vtkTableAlgorithm is the base that I should use?

Kevin

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Calling Request Data for Plugin

2016-05-11 Thread Dean, Kevin
Hey guys,

so I have a plugin that acquires data across a DDS socket in real-time.
However, I am having trouble calling request data continuously. I can see
the data being piped into ParaView no problem. However, I would like to do
something similar to the PCL Plugin as to when there is a new packet of
data, I would like ParaView to Render the polydata. Is there an example of
something similar to this?

I guess what I am asking, is there an example that shows how to easily
control the Proxy for constant rendering?? Any help is much appreciated.
Thanks guys.

Kevin Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Writing Filter Plugin

2016-05-02 Thread Dean, Kevin
Is there a way to do multiclass inheritance while writing your xml for a
Plugin?

Kevin Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] ParaView Plugin Idea

2016-04-30 Thread Dean, Kevin
Hey guys,

I am trying to write a paraview filter that utilizes "Extract Subset."
However, I want to base it off of a slider methodology as opposed to typing
in the extents. Are there any examples that could get me started on
manipulating the render view based off sliders?

This is the end goal of what I would like. Something similar at least (for
xmin, xmax, ymin, ymax, zmin, zmax)

Any help would be appreciated! Cheers!

Kevin Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] ParaView numpy interface question

2016-04-04 Thread Dean, Kevin
Hey all,

I have a quick question about setting scalar values with the python macro
inside paraview.

So I have two images that I want to do scalar manipulation with.

*example code:*

from paraview import simple

from vtk.util import numpy_support as npvtk


import vtk.numpy_interface.dataset_adapter as dsa
import pandas as pd

import vtk


scaling_vti = simple.XMLImageDataReader(FileName=[scaling_filename])

scaling_rawData = simple.servermanager.Fetch(scaling_vti)

scaling_data = dsa.WrapDataObject(scaling_rawData)

scaling_array =
pd.DataFrame(npvtk.vtk_to_numpy(data.GetPointData().GetScalars()),
columns=
['scaling_error'])

humans_vti = simple.FindSource(humans_filename)
humans_vti.PointArrayStatus = ['Scattering Density']
humans_rawData = simple.servermanager.Fetch(humans_vti)
humans_data = dsa.WrapDataObject(humans_rawData)
humans_array = 
pd.DataFrame(npvtk.vtk_to_numpy(humans_data.GetPointData().GetScalars()),
columns=['scalar_intensity'])

new_scalars = pd.DataFrame(humans_array.scalar_intensity * scaling_array.
scaling_error)

data.GetPointData().SetScalars(npvtk.numpy_to_vtk(new_scalars))


After I do this, I can bypass the pipeline (because I haven't figure
out how to use it yet) by

writing this image to a new file then load it again to render it.

Is there a way I can set the paraview image with the new scalar values
and have it render without
having to write it to a file first?

Or, is there a way to convert the
vtk.numpy_interface.dataset_adapter.DataSetAttributes type back
to paraview.servermanager.FieldDataInformation?

Thanks,

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Finding Resultant Polydata

2016-03-25 Thread Dean, Kevin
Hi all,

I was wondering if there was a way to find a resultant polydata by subtract
one polydata from another? I have an vtkAppenPolyData with about 19 inputs,
and I would like to specify the area that doesn't exist within the append.
Is there a way to subtract this append from a polydata specifying the
bounds of all of the objects together?

Kevin

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] QLineEdit & proxy()->InvokeCommand()

2016-01-04 Thread Dean, Kevin
I am writing a plugin that, theoretically, should be able to change inputs
as I apply them through a QLineEdit. The file that I am using to create the
UI portions of the plugin is similar to that of the PointCloudLibrary.
However, I was wondering if there is a way to pass along the "changed
value" to the command I want to invoke?

Here is a snippet of what I am doing:

##
connect_to_dds.h
##

QLineEdit* xmin = new QLineEdit("XMin");
this->connect(xmin,
SIGNAL(textChanged(QString&)),SLOT(setXMinValue(QString&)));
layout->addWidget(xmin);

public slots:
void SetXMin(const QString& text)
{
vtkSMSourceProxy* sourceProxy =
vtkSMSourceProxy::SafeDownCast(this->proxy());

if (!sourceProxy)
{
return;
}

sourceProxy->InvokeCommand("SetXMin");
}


###
Image_Reconstruction_DDSReader.cxx
###

void Image_Reconstruction_DDSReader::SetXMin()
{
// double XMin = ;
}


Is there a way to pass along the changed value within the Proxy? Or is
there a better way of doing this?

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Conversions

2015-07-24 Thread Dean, Kevin
Thanks Cory, that did get me a little further. However, at the moment, I am
trying to stream (multiple) vtkPolyData Objects. For Some reason, I can't
get them to update by pieces/blocks (i tried referring to
http://www.vtk.org/Wiki/VTK/Streaming 
http://www.kitware.com/blog/home/post/797).

So I ended up converting them to vtkImageData (but could only load one of
the two). I put them into a vtkAppendFilter() and converted them to a
structured grid and Utilized vtkStructuredGridAlgorithm. I can visualize
either the entire block which contains the two separate Objects, or the
points of each object instead of the Surface Representation of each block.
I'll keep trying to figure it out :-), I'm getting closer (and this helped
so thank you).

Thanks,

Kevin

On Thu, Jul 23, 2015 at 6:05 PM, Cory Quammen cory.quam...@kitware.com
wrote:

 Hi Kevin,

 Here's one way you can get a structured (actually uniform rectilinear)
 grid from an unstructured grid:

 - start ParaView
 - load your unstructured grid
 - create a Wavelet source with the extent set to the extent of your
 desired structured grid
 - Filters - Resample With Dataset. Set the Input to your unstructured
 grid and Source to the Wavelet. Click OK.

 HTH,
 Cory


 On Thu, Jul 23, 2015 at 6:56 PM, Dean, Kevin 
 kevin.d...@decisionsciencescorp.com wrote:

 Is there an example for converting an UnstructuredGrid to a
 StructuredGrid?

 Kevin E. Dean

 This email and its contents are confidential. If you are not the intended
 recipient, please do not disclose or use the information within this email
 or its attachments. If you have received this email in error, please report
 the error to the sender by return email and delete this communication from
 your records.
 ___
 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 ParaView Wiki at:
 http://paraview.org/Wiki/ParaView

 Search the list archives at: http://markmail.org/search/?q=ParaView

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/paraview




 --
 Cory Quammen
 RD Engineer
 Kitware, Inc.


-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Conversions

2015-07-23 Thread Dean, Kevin
Is there an example for converting an UnstructuredGrid to a StructuredGrid?

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Executive Not calling RequestData

2015-06-30 Thread Dean, Kevin
Well, after moving the writer to my RequestData function, I found that the
output is not properly copying the multi-block dataset for some reason.  I
have to try and figure that out...

Kevin E. Dean

On Tue, Jun 30, 2015 at 4:22 PM, Dean, Kevin 
kevin.d...@decisionsciencescorp.com wrote:

 So I got a little further. Instead I used a multi block data set to load
 my polydata(s). When i update my pipeline, all the information gets
 transferred to ParaView except for the block data. I set up a writer that
 records the data, and that information is exactly the same as the streaming
 data (but it can actually render the blocks). So, I guess you could say I
 am perplexed, ha. Do you have any suggestions?

 Thanks Man!

 Kevin E. Dean

 here's the snippet:

 void MultiBlockDataSetDDSReader::UpdatePipeline(vtkMultiBlockDataSet* mb)
 {
 printf(%s\n, __PRETTY_FUNCTION__);

   MultiBlockDataSetDDSReader::UpdateInformation();
   vtkStreamingDemandDrivenPipeline* executive =
 vtkStreamingDemandDrivenPipeline::SafeDownCast(MultiBlockDataSetDDSReader::GetExecutive());

   this-multi_block = mb;

   for (int i = 0; i  this-multi_block-GetNumberOfBlocks(); i++)
   {
 executive-SetUpdateExtent(0, i,
 this-multi_block-GetNumberOfBlocks(), 0);
 MultiBlockDataSetDDSReader::Update();
   }
 }

 and my request data:

 /**/
 int MultiBlockDataSetDDSReader::RequestData(
   vtkInformation *vtkNotUsed(request),
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
 {
 printf(%s\n, __PRETTY_FUNCTION__);
   vtkInformation* outInfo = outputVector-GetInformationObject(0);
   vtkMultiBlockDataSet *output =
 vtkMultiBlockDataSet::GetData(outputVector);

   if (this-multi_block != NULL)
   {
 output-ShallowCopy(this-multi_block);

 vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING();
   }

   return 1;
 }

 On Fri, Jun 26, 2015 at 9:30 AM, Dean, Kevin 
 kevin.d...@decisionsciencescorp.com wrote:

 Ok, so I looked through this yesterday and tried implementing some of the
 code. I now have the poly data information (# of cells, # of points, and
 Bounds updating in ParaView) However, for poly data objects to be rendered
 (and their data arrays to be copied to the output), is the best way to set
 the update extents by:

 executive-SetUpdateExtent( vtkInformation *, int piece, int numPieces,
 int ghostLevel );

 I'm not that familiar with updating unstructured datasets. Image data is
 simple because the extents are based off the size of the image. Also, for
 understanding the description of pieces, since they are subsets of
 unstructured datasets, does a piece correspond to individual cells or other
 information held within the poly data? And just one more question, is there
 a good place to find an explanation of what is / how to set up a PRODUCER,
 because I read that the producer determines what a piece means...

 Thanks for the help!

 Kevin

 On Thu, Jun 25, 2015 at 6:42 AM, Utkarsh Ayachit 
 utkarsh.ayac...@kitware.com wrote:

 RequestData doesn't get called unless the pipeline determines that
 something has changed. This is at core of VTK's demand driven execution
 pipeline. You may want to checkout Berk's blog (
 http://www.kitware.com/blog/home/post/831) about how you can use
 `CONTINUE_EXECUTING` key for streaming.

 Utkarsh

 On Wed, Jun 24, 2015 at 2:32 PM Dean, Kevin 
 kevin.d...@decisionsciencescorp.com wrote:

 I was wondering if anyone has run into this problem before. I am
 streaming vtkPolyData objects into ParaView, but for some reason (after my
 UpdatePipeline function is called), the executive does not call RequestData
 upon an Update command. Could there be any reasons for this?

 Here is my snippet:

 *void* *VTKPolyDataObjectsDDSReader::UpdateMyPipeline*(vtkPolyData*
 poly_data)
 {
   // DEBUG:
   // printf(%s\n, __PRETTY_FUNCTION__);

   VTKPolyDataObjectsDDSReader::*UpdateInformation*();
   vtkStreamingDemandDrivenPipeline* executive =
 vtkStreamingDemandDrivenPipeline::*SafeDownCast*(
 VTKPolyDataObjectsDDSReader::*GetExecutive*());

   *if* (!executive)
   {
 *return*;
   }

   *this*-poly_data = poly_data;

   *for* (*int* i = 0; i  *this*-poly_data-*GetNumberOfPieces*();
 i++)
   {
 executive-*SetUpdateExtent*(0, i, *this*-poly_data-
 *GetNumberOfPieces*(), 0);
 VTKPolyDataObjectsDDSReader::*Update*();
   }
 }

 Any help is appreciated! Thanks guys.

 Kevin E. Dean

 P.S. - also attached is a screenshot of what some of the output looks
 like.

 This email and its contents are confidential. If you are not the
 intended recipient, please do not disclose or use the information within
 this email or its attachments. If you have received this email in error,
 please report the error to the sender by return email and delete this
 communication from your records.





-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose

Re: [Paraview] Update Request Data / Information

2015-06-17 Thread Dean, Kevin
Ok, I figured out how to update the Pipeline. However, I now have another
interesting problem. I can't see the volume view update automatically. I
have to switch between Volume View and Outline View (for example) in order
to see the updated image. Is there a way to update just the volume view?

Thanks.

Kevin E. Dean

On Tue, Jun 16, 2015 at 12:23 PM, Dean, Kevin 
kevin.d...@decisionsciencescorp.com wrote:

 Hey guys.

 I have a dilemma.

 I have a script that publishes some reconstruction image (which I then
 convert to vtkImageData) to a DDS port; and I have ParaView connecting to
 that within my properties plugin.

 However, I cannot figure out how to update request data when trying to
 render the image within the main window. Is there a way to figure out how I
 can update the data with vtkStreamingDemandDrivenPipeline from my image
 conversion function??

 sorry if the explanation is vague. If you have any questions, I will
 gladly share what I can.

 Thanks guys!!

 Kevin E. Dean


-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Update Request Data / Information

2015-06-16 Thread Dean, Kevin
Hey guys.

I have a dilemma.

I have a script that publishes some reconstruction image (which I then
convert to vtkImageData) to a DDS port; and I have ParaView connecting to
that within my properties plugin.

However, I cannot figure out how to update request data when trying to
render the image within the main window. Is there a way to figure out how I
can update the data with vtkStreamingDemandDrivenPipeline from my image
conversion function??

sorry if the explanation is vague. If you have any questions, I will gladly
share what I can.

Thanks guys!!

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] pvserver

2015-06-01 Thread Dean, Kevin
Hey, How's it going?

I am currently trying to figure out how to acquire real-time image
reconstruction updates across a cluster configuration. I have several
reader (plugins) that convert from my types to vtk types.

I have also utilized pvserver minimally; but should it be able to
read/handle data that is being published to a specified port?

Also, I will probably have to create a communication layer that handles
CoreDX DDS communication. Would it be proper to create this layer as a
plugin or do I need to link it to some pvserver backend?

Thanks again!

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Utilizing ParaView Server

2015-05-27 Thread Dean, Kevin
Hey what's up?

I have a couple questions about using ParaView server?

1. I have figured out how to connect to the localhost as an example. I am
trying to understand/figure out how paraview can actually update live
images once data is being published to whatever port is specified? Is there
any documentation that you can lead me to? I'd appreciate it.

2. Also, I have to deal with CoreDX DDS socket communication. Is there any
support with that from ParaView or is there a way to create a plugin that
can manipulate the middleground between my  types and paraview's types
over the server?

Thanks again Guys!

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Switching Between Readers

2015-05-17 Thread Dean, Kevin
I was wondering if there was a way to instantiate a superclass that, let's
say, can switch between vtkPolyDataAlgorithm and vtkImageAlgorithm.

I have a reader that (as of now) converts the data within a protobuf file
to image data.

But currently, I have multiple protobuf files with different information.
However, the file extension is still .pbuf, and it seems that the reader
xml parsers the files based off this input.

So would it be easier to change the filename? Or is there a way to switch
between the two algorithm classes?

Thanks for your time!

Kevin E. Dean

-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
___
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Fwd: Image Doesn't load correctly

2015-05-05 Thread Dean, Kevin
ok, now I am getting new and exciting error messages for loading the
plugin... it doesn't seem to enjoy this line from the XML

FileListDomain name=files/

errors:

ERROR: In
/home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
line 483
vtkPVXMLParser (0x35d8d20): Error parsing XML in stream at line 18, column
8, byte index 632: not well-formed (invalid token)


ERROR: In
/home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
line 483
vtkPVXMLParser (0x238f5a0): Error parsing XML in stream at line 18, column
8, byte index 632: not well-formed (invalid token)


ERROR: In
/home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx,
line 565
vtkSIProxyDefinitionManager (0x1815770): No proxy that matches:
group=sources and proxy=vtkPVPROTOImageReader were found.

Error opening file  .../protobuf.

Kevin E. Dean

On Tue, May 5, 2015 at 10:12 AM, Burlen Loring blor...@lbl.gov wrote:

  at the moment I do not implement that.

 this may be the source of your issues, I thought that if you don't return
 1 from this function PV will assume your reader is not the right one and
 skip it(ie never call SetFileName). But if that were really true I don't
 get how RequestData is getting called...



 On 05/05/2015 10:00 AM, Dean, Kevin wrote:

 at the moment I do not implement that. I am assuming that may be the
 reason why I get this message every time i load the shared object file...

 ERROR: In
 /home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerManager/Core/vtkSMProperty.cxx,
 line 552
 vtkSMStringVectorProperty (0x3cb10f0): Could not create object of type:
 vtkSMFileListDoman. Did you specify wrong xml element?

 On Tue, May 5, 2015 at 9:14 AM, Burlen Loring blor...@lbl.gov wrote:

  ParaView should set it after it determines if the reader can read it.
 Did you also implement CanReadFile? Maybe the problem is in that function.


 On 05/05/2015 09:09 AM, Dean, Kevin wrote:


 -- Forwarded message --
 From: Dean, Kevin kevin.d...@decisionsciencescorp.com
 Date: Mon, May 4, 2015 at 5:10 PM
 Subject: Re: [Paraview] Image Doesn't load correctly
 To: Burlen Loring burlen.lor...@gmail.com


  awesome, thanks, that did it.

 One more question. Is there a way to debug the FileName aspect of the
 reader. I can't figure out how it's supposed to get set. The only way I can
 get the image to show is by hard
 coding it within the RequestData() function.

  Thanks Again

  Kevin E. Dean

 On Mon, May 4, 2015 at 11:33 AM, Burlen Loring burlen.lor...@gmail.com
 wrote:

  Hi Kevin.

 Your RequestInformation looks a little bare. Unless things have changed
 recently, you might need to set WHOLE_EXTENT, ORIGIN, SPACING,
 CAN_PRODUCE_SUB_EXTENT keys there. and if you support parallel IO honor the
 requested extent in RequestData.

 Burlen


 On 05/04/2015 09:52 AM, Dean, Kevin wrote:

   So I am still having a few issues with the reader. I have checked the
 output from the information Panel. And it seems as if all the information
 is the same. So maybe the data is getting deleted somehow (I'm not
 sure, but here is a snippet of my code);

 int vtkPVPROTOImageReader::RequestInformation (
vtkInformation*,
vtkInformationVector**,
vtkInformationVector* outputVector)
 {
vtkInformation* outInfo = outputVector-GetInformationObject(0);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo,
 VTK_UNSIGNED_CHAR, 1);

return 1;
 }

 int vtkPVPROTOImageReader::RequestData(vtkInformation
 *vtkNotUsed(request),
vtkInformationVector
 **inputVector,
vtkInformationVector
 *outputVector)
 {
 ... conversion code from protobuf

   /* Convert from protobuf to vtkImageData */
   vtkSmartPointervtkImageData image = function converting to
 protobuf;

   vtkDataArray* scalars = image-GetPointData()-GetScalars();
   scalars-SetName(ReconstructionData);

   /* Get the info object */
   vtkInformation *outInfo = outputVector-GetInformationObject(0);
   outInfo-Set(vtkDataObject::DATA_TYPE_NAME(), vtkImageData);

   /* Get the output */
   vtkImageData* output = vtkImageData::GetData(outputVector);

 //  output-SetSpacing(image-GetSpacing());
 //  output-SetOrigin(image-GetOrigin());
 //  output-AllocateScalars(outInfo);
 //
 output-GetPointData()-SetScalars(image-GetPointData()-GetScalars());
 //  output-SetDimensions(image-GetDimensions());

   output-ShallowCopy(image);

   int* dimensions = output-GetDimensions();

   std::cout  \nNumber of points:   output-GetNumberOfPoints() 
 std::endl;
   std::cout  Number of cells:   output-GetNumberOfCells()  \n
  std::endl;

  // print out the pixel values to see if they are actually present
   for (int z = 0; z  dimensions[2]; z++)
   {
 for (int y = 0; y  dimensions[1]; y++)
 {
   for (int x = 0; x  dimensions[0]; x++)
   {
 double* pixel =
 static_castdouble

Re: [Paraview] Fwd: Image Doesn't load correctly

2015-05-05 Thread Dean, Kevin
nevermind, I figured it out.

the xml I had didn't like having a documentation section within the string
vector property

Kevin

On Tue, May 5, 2015 at 4:31 PM, Dean, Kevin 
kevin.d...@decisionsciencescorp.com wrote:

 ok, now I am getting new and exciting error messages for loading the
 plugin... it doesn't seem to enjoy this line from the XML

 FileListDomain name=files/

 errors:

 ERROR: In
 /home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
 line 483
 vtkPVXMLParser (0x35d8d20): Error parsing XML in stream at line 18, column
 8, byte index 632: not well-formed (invalid token)


 ERROR: In
 /home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
 line 483
 vtkPVXMLParser (0x238f5a0): Error parsing XML in stream at line 18, column
 8, byte index 632: not well-formed (invalid token)


 ERROR: In
 /home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx,
 line 565
 vtkSIProxyDefinitionManager (0x1815770): No proxy that matches:
 group=sources and proxy=vtkPVPROTOImageReader were found.

 Error opening file  .../protobuf.

 Kevin E. Dean

 On Tue, May 5, 2015 at 10:12 AM, Burlen Loring blor...@lbl.gov wrote:

  at the moment I do not implement that.

 this may be the source of your issues, I thought that if you don't return
 1 from this function PV will assume your reader is not the right one and
 skip it(ie never call SetFileName). But if that were really true I don't
 get how RequestData is getting called...



 On 05/05/2015 10:00 AM, Dean, Kevin wrote:

 at the moment I do not implement that. I am assuming that may be the
 reason why I get this message every time i load the shared object file...

 ERROR: In
 /home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerManager/Core/vtkSMProperty.cxx,
 line 552
 vtkSMStringVectorProperty (0x3cb10f0): Could not create object of type:
 vtkSMFileListDoman. Did you specify wrong xml element?

 On Tue, May 5, 2015 at 9:14 AM, Burlen Loring blor...@lbl.gov wrote:

  ParaView should set it after it determines if the reader can read it.
 Did you also implement CanReadFile? Maybe the problem is in that function.


 On 05/05/2015 09:09 AM, Dean, Kevin wrote:


 -- Forwarded message --
 From: Dean, Kevin kevin.d...@decisionsciencescorp.com
 Date: Mon, May 4, 2015 at 5:10 PM
 Subject: Re: [Paraview] Image Doesn't load correctly
 To: Burlen Loring burlen.lor...@gmail.com


  awesome, thanks, that did it.

 One more question. Is there a way to debug the FileName aspect of the
 reader. I can't figure out how it's supposed to get set. The only way I can
 get the image to show is by hard
 coding it within the RequestData() function.

  Thanks Again

  Kevin E. Dean

 On Mon, May 4, 2015 at 11:33 AM, Burlen Loring burlen.lor...@gmail.com
 wrote:

  Hi Kevin.

 Your RequestInformation looks a little bare. Unless things have changed
 recently, you might need to set WHOLE_EXTENT, ORIGIN, SPACING,
 CAN_PRODUCE_SUB_EXTENT keys there. and if you support parallel IO honor the
 requested extent in RequestData.

 Burlen


 On 05/04/2015 09:52 AM, Dean, Kevin wrote:

   So I am still having a few issues with the reader. I have checked
 the output from the information Panel. And it seems as if all the
 information is the same. So maybe the data is getting deleted somehow (I'm
 not sure, but here is a snippet of my code);

 int vtkPVPROTOImageReader::RequestInformation (
vtkInformation*,
vtkInformationVector**,
vtkInformationVector* outputVector)
 {
vtkInformation* outInfo = outputVector-GetInformationObject(0);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo,
 VTK_UNSIGNED_CHAR, 1);

return 1;
 }

 int vtkPVPROTOImageReader::RequestData(vtkInformation
 *vtkNotUsed(request),
vtkInformationVector
 **inputVector,
vtkInformationVector
 *outputVector)
 {
 ... conversion code from protobuf

   /* Convert from protobuf to vtkImageData */
   vtkSmartPointervtkImageData image = function converting to
 protobuf;

   vtkDataArray* scalars = image-GetPointData()-GetScalars();
   scalars-SetName(ReconstructionData);

   /* Get the info object */
   vtkInformation *outInfo = outputVector-GetInformationObject(0);
   outInfo-Set(vtkDataObject::DATA_TYPE_NAME(), vtkImageData);

   /* Get the output */
   vtkImageData* output = vtkImageData::GetData(outputVector);

 //  output-SetSpacing(image-GetSpacing());
 //  output-SetOrigin(image-GetOrigin());
 //  output-AllocateScalars(outInfo);
 //
 output-GetPointData()-SetScalars(image-GetPointData()-GetScalars());
 //  output-SetDimensions(image-GetDimensions());

   output-ShallowCopy(image);

   int* dimensions = output-GetDimensions();

   std::cout  \nNumber of points:   output-GetNumberOfPoints() 
 std::endl;
   std::cout  Number of cells:   output-GetNumberOfCells() 
 \n  std::endl;

  // print out the pixel

[Paraview] Fwd: Image Doesn't load correctly

2015-05-05 Thread Dean, Kevin
-- Forwarded message --
From: Dean, Kevin kevin.d...@decisionsciencescorp.com
Date: Mon, May 4, 2015 at 5:10 PM
Subject: Re: [Paraview] Image Doesn't load correctly
To: Burlen Loring burlen.lor...@gmail.com


awesome, thanks, that did it.

One more question. Is there a way to debug the FileName aspect of the
reader. I can't figure out how it's supposed to get set. The only way I can
get the image to show is by hard
coding it within the RequestData() function.

Thanks Again

Kevin E. Dean

On Mon, May 4, 2015 at 11:33 AM, Burlen Loring burlen.lor...@gmail.com
wrote:

  Hi Kevin.

 Your RequestInformation looks a little bare. Unless things have changed
 recently, you might need to set WHOLE_EXTENT, ORIGIN, SPACING,
 CAN_PRODUCE_SUB_EXTENT keys there. and if you support parallel IO honor the
 requested extent in RequestData.

 Burlen


 On 05/04/2015 09:52 AM, Dean, Kevin wrote:

  So I am still having a few issues with the reader. I have checked the
 output from the information Panel. And it seems as if all the information
 is the same. So maybe the data is getting deleted somehow (I'm not
 sure, but here is a snippet of my code);

 int vtkPVPROTOImageReader::RequestInformation (
vtkInformation*,
vtkInformationVector**,
vtkInformationVector* outputVector)
 {
vtkInformation* outInfo = outputVector-GetInformationObject(0);
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR,
 1);

return 1;
 }

 int vtkPVPROTOImageReader::RequestData(vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
 {
 ... conversion code from protobuf

   /* Convert from protobuf to vtkImageData */
   vtkSmartPointervtkImageData image = function converting to protobuf;

   vtkDataArray* scalars = image-GetPointData()-GetScalars();
   scalars-SetName(ReconstructionData);

   /* Get the info object */
   vtkInformation *outInfo = outputVector-GetInformationObject(0);
   outInfo-Set(vtkDataObject::DATA_TYPE_NAME(), vtkImageData);

   /* Get the output */
   vtkImageData* output = vtkImageData::GetData(outputVector);

 //  output-SetSpacing(image-GetSpacing());
 //  output-SetOrigin(image-GetOrigin());
 //  output-AllocateScalars(outInfo);
 //
 output-GetPointData()-SetScalars(image-GetPointData()-GetScalars());
 //  output-SetDimensions(image-GetDimensions());

   output-ShallowCopy(image);

   int* dimensions = output-GetDimensions();

   std::cout  \nNumber of points:   output-GetNumberOfPoints() 
 std::endl;
   std::cout  Number of cells:   output-GetNumberOfCells()  \n
  std::endl;

  // print out the pixel values to see if they are actually present
   for (int z = 0; z  dimensions[2]; z++)
   {
 for (int y = 0; y  dimensions[1]; y++)
 {
   for (int x = 0; x  dimensions[0]; x++)
   {
 double* pixel =
 static_castdouble*(output-GetScalarPointer(x,y,z));
 // do something with v
 std::cout  pixel value:   pixel[0]  \n;
   }
   std::cout  std::endl;
 }
 std::cout  std::endl;
   }

   // write output to file and compare in visualization window...
   vtkSmartPointervtkXMLImageDataWriter vtk_writer =
 vtkSmartPointervtkXMLImageDataWriter::New();
   vtk_writer-SetInputData(output);
   vtk_writer-SetFileName( /home/kdean/tmp/foo.vti );
   vtk_writer-Update();
   vtk_writer-Write();

   return 1;
 }


  Another Problem I ran into:
  So I had to hardcode a file for the char *FileName into the RequestData
 Function in order to read any protobuf file. I ran a debugger on the code,
 and it seems like these functions from the header file (of the reader):

 vtkGetStringMacro(FileName);
 vtkSetStringMacro(FileName);

  they are never getting called.

  Thanks,

  Kevin

  here are my xml too... it looks right, but maybe I am missing something.

 On Sun, May 3, 2015 at 7:04 AM, Utkarsh Ayachit 
 utkarsh.ayac...@kitware.com wrote:

 You can also use the Information panel to see what arrays are being
 read in and what their ranges are.

 On Sat, May 2, 2015 at 7:06 PM, Dean, Kevin
 kevin.d...@decisionsciencescorp.com wrote:
  looked at the spreadsheet view in the GUI, and it looks like none of the
  Point Data is actually being copied...
 
  On Sat, May 2, 2015 at 3:44 PM, Dean, Kevin
  kevin.d...@decisionsciencescorp.com wrote:
 
  What's up Utkarsh?
 
  So I was able to write that plugin and convert my image to the
  vtkImageData. However, I am having trouble visualizing the image.
 However,
  when I write out the output from my reader, the image gets written
  correctly... Here are some pictures to show the differences. (All the
  information for the images is exactly the same) Do you have an idea of
 how I
  can try to fix it? Thanks.
 
  Kevin E. Dean
 
 
 
  This email and its contents are confidential. If you are not the
 intended
  recipient, please do not disclose or use the information within

Re: [Paraview] Image Doesn't load correctly

2015-05-04 Thread Dean, Kevin
So I am still having a few issues with the reader. I have checked the
output from the information Panel. And it seems as if all the information
is the same. So maybe the data is getting deleted somehow (I'm not
sure, but here is a snippet of my code);

int vtkPVPROTOImageReader::RequestInformation (
   vtkInformation*,
   vtkInformationVector**,
   vtkInformationVector* outputVector)
{
   vtkInformation* outInfo = outputVector-GetInformationObject(0);
   vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_UNSIGNED_CHAR,
1);

   return 1;
}

int vtkPVPROTOImageReader::RequestData(vtkInformation *vtkNotUsed(request),
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
{
   ... conversion code from protobuf

  /* Convert from protobuf to vtkImageData */
  vtkSmartPointervtkImageData image = function converting to protobuf;

  vtkDataArray* scalars = image-GetPointData()-GetScalars();
  scalars-SetName(ReconstructionData);

  /* Get the info object */
  vtkInformation *outInfo = outputVector-GetInformationObject(0);
  outInfo-Set(vtkDataObject::DATA_TYPE_NAME(), vtkImageData);

  /* Get the output */
  vtkImageData* output = vtkImageData::GetData(outputVector);

//  output-SetSpacing(image-GetSpacing());
//  output-SetOrigin(image-GetOrigin());
//  output-AllocateScalars(outInfo);
//  output-GetPointData()-SetScalars(image-GetPointData()-GetScalars());
//  output-SetDimensions(image-GetDimensions());

  output-ShallowCopy(image);

  int* dimensions = output-GetDimensions();

  std::cout  \nNumber of points:   output-GetNumberOfPoints() 
std::endl;
  std::cout  Number of cells:   output-GetNumberOfCells()  \n 
std::endl;

// print out the pixel values to see if they are actually present
  for (int z = 0; z  dimensions[2]; z++)
  {
for (int y = 0; y  dimensions[1]; y++)
{
  for (int x = 0; x  dimensions[0]; x++)
  {
double* pixel =
static_castdouble*(output-GetScalarPointer(x,y,z));
// do something with v
std::cout  pixel value:   pixel[0]  \n;
  }
  std::cout  std::endl;
}
std::cout  std::endl;
  }

  // write output to file and compare in visualization window...
  vtkSmartPointervtkXMLImageDataWriter vtk_writer =
vtkSmartPointervtkXMLImageDataWriter::New();
  vtk_writer-SetInputData(output);
  vtk_writer-SetFileName( /home/kdean/tmp/foo.vti );
  vtk_writer-Update();
  vtk_writer-Write();

  return 1;
}


Another Problem I ran into:
So I had to hardcode a file for the char *FileName into the RequestData
Function in order to read any protobuf file. I ran a debugger on the code,
and it seems like these functions from the header file (of the reader):

vtkGetStringMacro(FileName);
vtkSetStringMacro(FileName);

they are never getting called.

Thanks,

Kevin

here are my xml too... it looks right, but maybe I am missing something.

On Sun, May 3, 2015 at 7:04 AM, Utkarsh Ayachit utkarsh.ayac...@kitware.com
 wrote:

 You can also use the Information panel to see what arrays are being
 read in and what their ranges are.

 On Sat, May 2, 2015 at 7:06 PM, Dean, Kevin
 kevin.d...@decisionsciencescorp.com wrote:
  looked at the spreadsheet view in the GUI, and it looks like none of the
  Point Data is actually being copied...
 
  On Sat, May 2, 2015 at 3:44 PM, Dean, Kevin
  kevin.d...@decisionsciencescorp.com wrote:
 
  What's up Utkarsh?
 
  So I was able to write that plugin and convert my image to the
  vtkImageData. However, I am having trouble visualizing the image.
 However,
  when I write out the output from my reader, the image gets written
  correctly... Here are some pictures to show the differences. (All the
  information for the images is exactly the same) Do you have an idea of
 how I
  can try to fix it? Thanks.
 
  Kevin E. Dean
 
 
 
  This email and its contents are confidential. If you are not the intended
  recipient, please do not disclose or use the information within this
 email
  or its attachments. If you have received this email in error, please
 report
  the error to the sender by return email and delete this communication
 from
  your records.


-- 
This email and its contents are confidential. If you are not the intended 
recipient, please do not disclose or use the information within this email 
or its attachments. If you have received this email in error, please report 
the error to the sender by return email and delete this communication from 
your records.
ServerManagerConfiguration
  ProxyGroup name=sources

!--  --
SourceProxy name =vtkPVPROTOImageReader class=vtkPVPROTOImageReader label=vtkPVPROTOImageReader
  Documentation
long_help=Read a DSC Reconstruction Data protobuf file.
short_help=Read a DSC Reconstruction Data protobuf file.
  /Documentation
  StringVectorProperty