how to connect between vtkDataObject and vtkunstructuredGrid?

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

how to connect between vtkDataObject and vtkunstructuredGrid?

LM-3
I would like to ask some small question..

I have the output of the threshold filter "unstructuredGrid"
and the MarchingCubes take input of type "vtkDataObject" which is a super class of the "vtkunstructuredGrid"
how to connect between them???
means.. that i want to get the output of the threshold filter.. and input it into the marchingCubes..
 
thanks in advance
LM


Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to connect between vtkDataObject and vtkunstructuredGrid?

Uriah Liggett
I'm not sure if this is the best way, but you can pull the point data
from the unstructured grid and populate your image with it.  It should
only contain the points that passed the threshold condition.  The code
snippet below illustrates this for 2D images where outArr is the
ScalarPointer to your data object

            vtkPoints * points = grid->GetPoints();

            for(int j=0; j < points->GetNumberOfPoints(); j++)
            {
                float point[3];
                points->GetPoint(j, point);
                outArr[int(point[1]) * dims[0] + int(point[0])] = color;
            }

LM wrote:

> I would like to ask some small question..
>
> I have the output of the threshold filter "unstructuredGrid"
> and the MarchingCubes take input of type "vtkDataObject" which is a
> super class of the "vtkunstructuredGrid"
> how to connect between them???
> means.. that i want to get the output of the threshold filter.. and
> input it into the marchingCubes..
>  
> thanks in advance
> LM
>
> ------------------------------------------------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars
> <http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines/photos/evt=38087/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=>.
> Add photos, events, holidays, whatever.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>  
>

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to connect between vtkDataObject and vtkunstructuredGrid?

Uriah Liggett
In reply to this post by LM-3
Actually, you shouldn't even need to do what I stated before.  Since
vtkUnstructuredGrid is a subclass of vtkDataObject, you can simply pass
the grid directly to the marching cubes (which will see it as a
vtkDataObject) without any problems.


LM wrote:

> I would like to ask some small question..
>
> I have the output of the threshold filter "unstructuredGrid"
> and the MarchingCubes take input of type "vtkDataObject" which is a
> super class of the "vtkunstructuredGrid"
> how to connect between them???
> means.. that i want to get the output of the threshold filter.. and
> input it into the marchingCubes..
>  
> thanks in advance
> LM
>
> ------------------------------------------------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars
> <http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines/photos/evt=38087/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=>.
> Add photos, events, holidays, whatever.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>  
>

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to connect between vtkDataObject and vtkunstructuredGrid?

LM-3
thanks a lot for ur replys..
When I connect them directly..by writing
mcubes->Getinput(threshold->GetOutput)
it gave me a runtime error..as followed 
 
"ERROR: In \project\VTK v5\VTK v5\Filtering\vtkDemandDrivenPipeline.cxx, line 777
vtkStreamingDemandDrivenPipeline (04520DA0): Input for connection index 0 on input port index 0 for algorithm vtkMarchingCubes(0451EEC0) is of type vtkUnstructuredGrid, but a vtkImageData is required."
 
any suggestion?
Uriah Liggett <[hidden email]> wrote:
Actually, you shouldn't even need to do what I stated before. Since
vtkUnstructuredGrid is a subclass of vtkDataObject, you can simply pass
the grid directly to the marching cubes (which will see it as a
vtkDataObject) without any problems.


LM wrote:

> I would like to ask some small question..
>
> I have the output of the threshold filter "unstructuredGrid"
> and the MarchingCubes take input of type "vtkDataObject" which is a
> super class of the "vtkunstructuredGrid"
> how to connect between them???
> means.. that i want to get the output of the threshold filter.. and
> input it into the marchingCubes..
>
> thanks in advance
> LM
>
> ------------------------------------------------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars
> .
> Add photos, events, holidays, whatever.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to connect between vtkDataObject and vtkunstructuredGrid?

LM-3
I used it .. because i want to make a surfaceRendering to some medical 3D Images..
And i have read that marchingCubes techniques do such a process via the triagls that it makes..
 
I had no idea if vtkContourFilter do the same.. so thanks a lot for this info.
 
Anyway I have discovered my error.. As I have to use A vtkImageThreshold instead of the vtkThreshold
 
thanks
regards..
 
Any particular reason why you're using vtkMArchingCubes? vtkContourFilter
will do the same thing (Isosurface/Contour line extraction) and it's faster
& works on more data types.

--- LM thanks
a lot for ur replys..
> When I connect them directly..by writing
> mcubes->Getinput(threshold->GetOutput)

> it gave me a runtime error..as followed
>
> "ERROR: In \project\VTK
v5\VTK v5\Filtering\vtkDemandDrivenPipeline.cxx, line 777
> vtkStreamingDemandDrivenPipeline
(04520DA0): Input for connection index 0 on input port index 0 for algorithm
vtkMarchingCubes(0451EEC0) is of type vtkUnstructuredGrid, but a vtkImageData
is required."
>
> any suggestion?
> Uriah Liggett
wrote:
> Actually, you shouldn't even need to do what I stated before.
Since
> vtkUnstructuredGrid is a subclass of vtkDataObject, you can simply
pass
> the grid directly to the marching cubes (which will see it as a

> vtkDataObject) without any problems.
>
>
> LM wrote:
>
> > I would
like to ask some small question..
> >
> > I have the output of the threshold
filter "unstructuredGrid"
> > and the MarchingCubes take input of type "vtkDataObject"
which is a
> > super class of the "vtkunstructuredGrid"
> > how to connect
between them???
> > means.. that i want to get the output of the threshold
filter.. and
> > input it into the marchingCubes..
> >
> > thanks in
advance
> > LM
> >
> > ------------------------------------------------------------------------

> > Yahoo! Photos
> > Ring in the New Year with Photo Calendars
> > .

> > Add photos, events, holidays, whatever.
> >
> >------------------------------------------------------------------------

> >
> >_______________________________________________
> >This is the private
VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
> >Follow this link to subscribe/unsubscribe:

> >http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
> _______________________________________________

> This is the private VTK discussion list.
> Please keep messages on-topic.
Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:

> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>
>
> ---------------------------------
> Yahoo! Photos
> Got holiday prints?
See all the ways to get quality prints in your hands ASAP.
>
>
> _______________________________________________

> This is the private VTK discussion list.
> Please keep messages on-topic.
Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:

> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>


<a href="http://us.rd.yahoo.com/evt=38381/ ylc=X3oDMTEzcGlrdGY5BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMWF1dG9z/*http://autos.yahoo.com/index.html ">Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers