[Paraview] Problem with Custom ParaView Reader
Kalin Kanov
kalin at cs.jhu.edu
Wed Feb 12 14:48:38 EST 2014
Hi Andy,
Thank you for taking a close look at this and for the comments. That
seems to have been indeed the issue.
Best,
Kalin
On 12.2.2014 г. 14:40, Andy Bauer wrote:
> Hi Kalin,
>
> I think the issue is that your extents are wrong. The extents should be
> the index of the first and last point in each logical direction so it
> should be [0, 15, 0, 15, 0, 15] if you have a square grid with 4096
> points. Note that this is the whole extent that the reader could provide
> even though subsequent filters may ask for a reduced extent. Also, in
> RequestData() you should get the requested extent with something like
> the following and take out the SetDimension() call:
>
> vtkInformation *outInfo = outputVector->GetInformationObject(outputPort);
> int subext[6];
> outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),subext);
> image->SetExtent(subext);
>
> Then use the subextent to fill in your scalars array since it may be
> less than what it could potentially provide (e.g. why read in all data
> when you only need a subset of that).
>
> I've filled in the vtkJHTDBReader.cxx code with some comments and
> changes. You should go through and review what I did since I can't test
> your code.
>
> Regards,
> Andy
>
>
>
> On Wed, Feb 12, 2014 at 1:47 PM, Kalin Kanov <kalin at cs.jhu.edu
> <mailto:kalin at cs.jhu.edu>> wrote:
>
> Hi Andy,
>
> Thanks for the quick response. I am setting the extent to be
> [0,16,0,16,0,16], as follows:
>
> in the constructor:
> this->extent[0] = 0;
> this->extent[1] = 16;
> this->extent[2] = 0;
> this->extent[3] = 16;
> this->extent[4] = 0;
> this->extent[5] = 16;
>
> in RequestInformation():
> outInfo->Set(
> vtkStreamingDemandDrivenPipeli__ne::
> WHOLE_EXTENT(),
> this->extent, 6);
>
> Attached is the .vti file and the code. In the test harness I also
> have a vtkRenderer, which also displays the data as a 3d cube.
>
>
>
>
> On 12.2.2014 г. 13:30, Andy Bauer wrote:
>
> Hi Kalin,
>
> I'm thinking that maybe there is ghost level information that is
> wrong,
> or maybe extent information. I'm assuming that you're running
> the server
> in serial so in that case you shouldn't have any ghost levels.
> If your
> grid has 16 points in each direction than than the extent for that
> should be [i, i+15, j, j+15, k, k+15] for a single process (note
> that
> extents don't need to start from 0 but usually do). If your grid
> is 16
> cells in each direction than the extent would be [i, i+16, j,
> j+16, k,
> k+16].
>
> If that isn't the problem, dan you share your code and your vti file
> from your test harness?
>
> Regards,
> Andy
>
>
> On Wed, Feb 12, 2014 at 1:11 PM, Kalin Kanov <kalin at cs.jhu.edu
> <mailto:kalin at cs.jhu.edu>
> <mailto:kalin at cs.jhu.edu <mailto:kalin at cs.jhu.edu>>> wrote:
>
> Dear All,
>
> I am developing a custom ParaView reader for my data. I have a
> working plugin for ParaView that reads and displays the data.
> However, what I am getting in the 3D view is not as
> expected. My
> reader subclasses vtkImageAlgorithm and produces a 3D
> structured
> grid. When I load the data in ParaView I only see 3 of the
> surfaces
> of the cube (attached is a screenshot). Any idea why this
> would be
> happening?
>
> When I view the data in spreadsheet form all 4096 point
> (the testing
> cube is 16x16x16) have associated scalar data and the
> coordinates
> look good, but the 3D view displays only the left, right
> and bottom
> walls of the cube. Additionally, I also have a small test
> harness
> that uses my custom reader as input for a
> vtkXMLImageDataWriter and
> the resulting .vti file when loaded into ParaView and
> visualized
> looks good.
>
> Thank you,
> Kalin Kanov
>
>
>
>
More information about the ParaView
mailing list