Re: [vtkusers] contour lines not closed with vtkUnstructuredGrid

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [vtkusers] contour lines not closed with vtkUnstructuredGrid

David Thompson
> Hi, I have an issue with contours of some multiresolution data. The data is
> comprised of adjacent "boxes" that don't overlap represented using
> vtkImageData. ... The
> problem I'm having is that contours of the resulting dataset aren't closed,
> and I can see that where they separate is where the grid spacing changes. I
> think this is a result of less acurate interpolation in the coarser spaced
> regions. even so shouldn't the contours be closed? Is this an issue with the
> contouring algorithm in vtk or do I have to admit defeat and forget about
> visualizing multi resolution datasets?
This is not an error. It is a property of the interpolants you are
using. If you have a large cell dx=3, it might have endpoint values of
f=0 at x=0 and f=3 at x=3. But a neighboring region with dx=1 might have
values of f=0 at x=0, f=2 at x=1, f=3 at x=2 and f=3 at x=3. If you ask
for a contour showing where all cells take on the value x=1.5, this
occurs in the large cell region at x=1.5. However, in the small cell
region it occurs at x=0.75 (between nodes at x=0 and x=1). But why would
discontinuities in your isocontours cause you to admit defeat and stop
visualizing your solutions? The solutions weren't any better before you
drew pictures of them. :-)

        David

_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

contour lines and scalar color plot issues with vtkUnstructuredGrid

santana
Hi, Thanks for your reply.
I put the image I originally sent here for reference:
http://quaoar.sr.unh.edu/images/contours_not_closed.png

There may be more to this problem than interpolation error. I say this because
in the past we have used rectilinear grids with non constant grid spacing and
experienced no such issues. If my present problem were caused by
interpolation error I would expect the same problem when using the
irregularly spaced rectilinear grids.

It seems to me that the problem of open contours might be caused by the
algorithm(s) used with unstructuredGrids built with the append filter. Could
it have somehting to do with the fact that the boxes in my case are appended
in a "willy nilly" order? adjacent boxes aren't necessarily appended one
after the other.

In the vtk text it says something to the effect that there are two ways for
the contouring process to terminate, 1) when a contour closes on itself, 2)
when the edge of the dataset is reached. Since in the example I sent, the
contours aren't closed, the contour generation process must have reached the
edge of the dataset. So Maybe even though I appeneded the original
vtkImageData into one vtkUnstructuredGrid vtk sees them as mulitiple
datasets?

Another reason I think the problems are caused by the vtkUnstructuredGrid
algorithms is because I have experienced a similar issue when using the
append filter on vtkImageData producing a vtkUnstructureGrid when the grid
spacing is the same. In the resulting visualization one can make out the box
boundaries. I have image illustrating this problem here:
http://quaoar.sr.unh.edu/images/boxes_problem.png

maybe I'm using the append filter in a way that it wasn't intended to be used?
I'm hoping to find out a way to construct a dataset from a collection of
multi resolution data in such a way that visualization leaves no indication
of the underlying structure used to store/generate the data.

again, thanks for reply, any ideas are greatly appreciated.
Burlen


On Tuesday 14 February 2006 08:44 pm, David C. Thompson wrote:

> > Hi, I have an issue with contours of some multiresolution data. The data
> > is comprised of adjacent "boxes" that don't overlap represented using
> > vtkImageData. ... The
> > problem I'm having is that contours of the resulting dataset aren't
> > closed, and I can see that where they separate is where the grid spacing
> > changes. I think this is a result of less acurate interpolation in the
> > coarser spaced regions. even so shouldn't the contours be closed? Is this
> > an issue with the contouring algorithm in vtk or do I have to admit
> > defeat and forget about visualizing multi resolution datasets?
>
> This is not an error. It is a property of the interpolants you are
> using. If you have a large cell dx=3, it might have endpoint values of
> f=0 at x=0 and f=3 at x=3. But a neighboring region with dx=1 might have
> values of f=0 at x=0, f=2 at x=1, f=3 at x=2 and f=3 at x=3. If you ask
> for a contour showing where all cells take on the value x=1.5, this
> occurs in the large cell region at x=1.5. However, in the small cell
> region it occurs at x=0.75 (between nodes at x=0 and x=1). But why would
> discontinuities in your isocontours cause you to admit defeat and stop
> visualizing your solutions? The solutions weren't any better before you
> drew pictures of them. :-)
>
> David

--

Burlen Loring
Space Science Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
39 College Road, Durham, NH 03824
Phone: 603-862-1140
_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

Re: contour lines and scalar color plot issues with vtkUnstructuredGrid

Randall Hand


On 2/15/06, Burlen <[hidden email]> wrote:

It seems to me that the problem of open contours might be caused by the
algorithm(s) used with unstructuredGrids built with the append filter. Could
it have somehting to do with the fact that the boxes in my case are appended
in a "willy nilly" order? adjacent boxes aren't necessarily appended one
after the other.


I think this is the cause of your problem.  The vtkAppendFilter does not "stitch" neighboring datasets along their boundaries, it keeps each dataset as an individual piece.  So when you extract an isosurface from the combined dataset, there is no connectivity along those inter-dataset boundaries, leading to the "discontinuity" along the edges.  I've run into the same issue here doing similiar things (reading a multi-block Plot3d file & using AppendDataset to only have 1 vtkDataSet to pass around).

How to fix this?  I haven't the slightest, short of writing custom code to replace vtkAppendDataset and do the stitching.  You may be able to Resample the Data into a rectilinear form (use the ProbeFilter with an ImageData input), and then get the Isosurface you want, but you'll have to live with the resolution tradeoffs.  It'll also be sloooooow....


--
Randall Hand
Visualization Scientist,
ERDC-MSRC Vicksburg, MS
Homepage: http://www.yeraze.com
_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

RE: contour lines and scalar color plot issues with vtkUnstructuredGrid

Wylie, Brian
In reply to this post by santana
You can run 'CleanToGrid'. That filter will merge co-incident points, this may solve your problem... worth a try at least :)
 

Brian Wylie - Org 9227
Sandia National Laboratories
MS 0822 - Building 880/A1-J
(505)844-2238 FAX(505)845-0833                      
     ____                  _    __
    / __ \____  _________ | |  / (_)__ _      __
   / /_/ / __ `/ ___/ __ `/ | / / / _ \ | /| / /
  / ____/ /_/ / /  / /_/ /| |/ / /  __/ |/ |/ /
 /_/    \__,_/_/   \__,_/ |___/_/\___/|__/|__/                                       
                                    Unleash the Beast

 


From: vtk-developers-bounces+bnwylie=[hidden email] [mailto:vtk-developers-bounces+bnwylie=[hidden email]] On Behalf Of Randall Hand
Sent: Wednesday, February 15, 2006 8:59 AM
To: Burlen
Cc: John Dorelli; [hidden email]; [hidden email]; [hidden email]; Jimmy Raeder; Thompson, David C
Subject: Re: [vtk-developers] contour lines and scalar color plot issues with vtkUnstructuredGrid



On 2/15/06, Burlen <[hidden email]> wrote:

It seems to me that the problem of open contours might be caused by the
algorithm(s) used with unstructuredGrids built with the append filter. Could
it have somehting to do with the fact that the boxes in my case are appended
in a "willy nilly" order? adjacent boxes aren't necessarily appended one
after the other.


I think this is the cause of your problem.  The vtkAppendFilter does not "stitch" neighboring datasets along their boundaries, it keeps each dataset as an individual piece.  So when you extract an isosurface from the combined dataset, there is no connectivity along those inter-dataset boundaries, leading to the "discontinuity" along the edges.  I've run into the same issue here doing similiar things (reading a multi-block Plot3d file & using AppendDataset to only have 1 vtkDataSet to pass around).

How to fix this?  I haven't the slightest, short of writing custom code to replace vtkAppendDataset and do the stitching.  You may be able to Resample the Data into a rectilinear form (use the ProbeFilter with an ImageData input), and then get the Isosurface you want, but you'll have to live with the resolution tradeoffs.  It'll also be sloooooow....


--
Randall Hand
Visualization Scientist,
ERDC-MSRC Vicksburg, MS
Homepage: http://www.yeraze.com

_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

RE: contour lines and scalar color plot issues with vtkUnstructuredGrid

Wylie, Brian
In reply to this post by santana
(Sorry for resend...first one bounced)
 
You can run 'CleanToGrid'. That filter will merge co-incident points, not sure if it will solve your problem... but worth a try at least :)

Brian Wylie - Org 9227
Sandia National Laboratories
MS 0822 - Building 880/A1-J
(505)844-2238 FAX(505)845-0833                      
     ____                  _    __
    / __ \____  _________ | |  / (_)__ _      __
   / /_/ / __ `/ ___/ __ `/ | / / / _ \ | /| / /
  / ____/ /_/ / /  / /_/ /| |/ / /  __/ |/ |/ /
 /_/    \__,_/_/   \__,_/ |___/_/\___/|__/|__/                                       
                                    Unleash the Beast



From: vtk-developers-bounces+bnwylie=[hidden email] [mailto:vtk-developers-bounces+bnwylie=[hidden email]] On Behalf Of Randall Hand
Sent: Wednesday, February 15, 2006 8:59 AM
To: Burlen
Cc: John Dorelli; [hidden email]; [hidden email]; [hidden email]; Jimmy Raeder; Thompson, David C
Subject: Re: [vtk-developers] contour lines and scalar color plot issues with vtkUnstructuredGrid



On 2/15/06, Burlen <[hidden email]> wrote:

It seems to me that the problem of open contours might be caused by the
algorithm(s) used with unstructuredGrids built with the append filter. Could
it have somehting to do with the fact that the boxes in my case are appended
in a "willy nilly" order? adjacent boxes aren't necessarily appended one
after the other.


I think this is the cause of your problem.  The vtkAppendFilter does not "stitch" neighboring datasets along their boundaries, it keeps each dataset as an individual piece.  So when you extract an isosurface from the combined dataset, there is no connectivity along those inter-dataset boundaries, leading to the "discontinuity" along the edges.  I've run into the same issue here doing similiar things (reading a multi-block Plot3d file & using AppendDataset to only have 1 vtkDataSet to pass around).

How to fix this?  I haven't the slightest, short of writing custom code to replace vtkAppendDataset and do the stitching.  You may be able to Resample the Data into a rectilinear form (use the ProbeFilter with an ImageData input), and then get the Isosurface you want, but you'll have to live with the resolution tradeoffs.  It'll also be sloooooow....


--
Randall Hand
Visualization Scientist,
ERDC-MSRC Vicksburg, MS
Homepage: http://www.yeraze.com

_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

Re: contour lines and scalar color plot issues with vtkUnstructuredGrid

David Thompson
In reply to this post by santana
On Wed, 2006-02-15 at 07:50, Burlen wrote:

> There may be more to this problem than interpolation error. I say this because
> in the past we have used rectilinear grids with non constant grid spacing and
> experienced no such issues. If my present problem were caused by
> interpolation error I would expect the same problem when using the
> irregularly spaced rectilinear grids.
>
> It seems to me that the problem of open contours might be caused by the
> algorithm(s) used with unstructuredGrids built with the append filter. Could
> it have somehting to do with the fact that the boxes in my case are appended
> in a "willy nilly" order? adjacent boxes aren't necessarily appended one
> after the other.
>
> In the vtk text it says something to the effect that there are two ways for
> the contouring process to terminate, 1) when a contour closes on itself, 2)
> when the edge of the dataset is reached. Since in the example I sent, the
> contours aren't closed, the contour generation process must have reached the
> edge of the dataset. So Maybe even though I appeneded the original
> vtkImageData into one vtkUnstructuredGrid vtk sees them as mulitiple
> datasets?
To the best of my knowledge, the contour algorithms will never "stitch"
neighboring datasets; it is something you must do yourself if you want.
For instance, you could constrain "pendant" nodes on the boundary to
interpolate the same function as the lower-resolution neighbor. In the
example I gave previously, you might change the high-resolution point
values from

f=  0    2    3    3
    |    |    |    |
  --x----x----x----x--
    |              |
f=  0              3

to

f = 0    1    2    3
    |    |    |    |
  --x----x----x----x--
    |              |
    0              3

The output contours would then match up visually, but you would still
have to use vtkCleanPolyData or some such to stitch vertices on the
boundary. In 3D, this can still lead to trouble since there will be
triangles with pendant vertices in the output contours, but at least
there should not be large cracks.

You say in the past you used rectilinear grids with non-constant spacing
without problem. Do you mean multiple rectilinear grids with
discontinuities as shown in your picture? If so, is it possible that
whatever generated the function values properly constrained f as I've
shown above? If you mean a single rectilinear grid, then it is
impossible to have discontinuities like the ones above because of the
way the grid is defined, but it is also impossible to have local
refinement. Choose your poison: unacceptably large meshes or
unacceptably discontinuous function approximation.

        David

_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers
Reply | Threaded
Open this post in threaded view
|

Re: contour lines and scalar color plot issues with vtkUnstructuredGrid

santana
In reply to this post by Randall Hand
Wanted to thank you all for the input and comments. Since vtkAppendFilter
doesn't stitch the datasets that are appended(wouldn't it be nice if it
did?), I gave up on that avenue, and instead construct a dataset using the
Delaunay triangulation filter as shown on 143 of the user guide. The feedback
I got here was a big help.

thanks again
Burlen

On Wednesday 15 February 2006 10:59 am, Randall Hand wrote:

> On 2/15/06, Burlen <[hidden email]> wrote:
> > It seems to me that the problem of open contours might be caused by the
> > algorithm(s) used with unstructuredGrids built with the append filter.
> > Could
> > it have somehting to do with the fact that the boxes in my case are
> > appended
> > in a "willy nilly" order? adjacent boxes aren't necessarily appended one
> > after the other.
>
> I think this is the cause of your problem.  The vtkAppendFilter does not
> "stitch" neighboring datasets along their boundaries, it keeps each dataset
> as an individual piece.  So when you extract an isosurface from the
> combined dataset, there is no connectivity along those inter-dataset
> boundaries, leading to the "discontinuity" along the edges.  I've run into
> the same issue here doing similiar things (reading a multi-block Plot3d
> file & using AppendDataset to only have 1 vtkDataSet to pass around).
>
> How to fix this?  I haven't the slightest, short of writing custom code to
> replace vtkAppendDataset and do the stitching.  You may be able to Resample
> the Data into a rectilinear form (use the ProbeFilter with an ImageData
> input), and then get the Isosurface you want, but you'll have to live with
> the resolution tradeoffs.  It'll also be sloooooow....
>
>
> --
> Randall Hand
> Visualization Scientist,
> ERDC-MSRC Vicksburg, MS
> Homepage: http://www.yeraze.com

--

Burlen Loring
Space Science Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
39 College Road, Durham, NH 03824
Phone: 603-862-1140
_______________________________________________
vtk-developers mailing list
[hidden email]
http://www.vtk.org/mailman/listinfo/vtk-developers