[vtkusers] Re: vtkusers Digest, Vol 27, Issue 17

Huang Pengfei herofay at gmail.com
Sun Jul 16 22:08:34 EDT 2006


For the sake of combining various codes, can I use different versions
of VTK at the same time in one operation system? Will the applications
belong to different VTK versions work properly?

How can I do that and will they have side effects on each other?

On 7/17/06, vtkusers-request at vtk.org <vtkusers-request at vtk.org> wrote:
> Send vtkusers mailing list submissions to
>        vtkusers at vtk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://www.vtk.org/mailman/listinfo/vtkusers
> or, via email, send a message with subject or body 'help' to
>        vtkusers-request at vtk.org
>
> You can reach the person managing the list at
>        vtkusers-owner at vtk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtkusers digest..."
>
>
> Today's Topics:
>
>   1. can I use normals to evaluate the gradients? (Dongqing Chen)
>   2. Re: can I use normals to evaluate the gradients?
>      (Dominik Szczerba)
>   3. PolyData to UnstructuredGrid? (Louis Desjardins)
>   4. Who can tell me how to display Chinese character in VTK?? (BoShi)
>   5. larger points (Kamran Iranpour)
>   6. Re: Delete problems (Dominik Szczerba)
>   7. Re: larger points (Dominik Szczerba)
>   8. vtkGlyph3D indexing problem ! (Sander Verhoeven)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 15 Jul 2006 14:02:40 -0400
> From: "Dongqing Chen" <dqchen at cvip.louisville.edu>
> Subject: [vtkusers] can I use normals to evaluate the gradients?
> To: <vtkusers at vtk.org>
> Message-ID: <002e01c6a838$dcdfd790$4e28a588 at rachidcvip>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear All:
>
>   I am trying to get the gradient vectors of all the vertices of triangle surface mesh. One of my friend gave me some advice list as below:
>
> *************************************************************************************************
> Triangle meshes are piece-wise linear approximation of smooth manifold.
> the so-called gradient is not well-defined. you can use any reasonable
> approximation from the gradient (normal) of the incident faces.
> **************************************************************************************************
>
>  Can I just simply use to vtkPolydataNormals to get all the normal vectors? Then how can I relate the normal vectors with the gradient vectors at the points?
>
> Best Wishes,
> -----------------------------------------------------------------
> Dongqing Chen
> Ph.D Research Assistant
> Rm. 07, Paul C. Lutz Hall
> Computer Vision & Image Processing (CVIP) Lab
> Department of Electrical & Computer Engineering
> Speed School of Engineering
> University of Louisville
> Louisville, KY. 40292
> U.S.A
> Email: dqchen at cvip.louisville.edu
> Phone:+1-502-852-2789 (Lab)
>            +1-502-852-6130 (Office)
> -----------------------------------------------------------------
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://public.kitware.com/pipermail/vtkusers/attachments/20060715/c3e34648/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Sat, 15 Jul 2006 21:08:03 +0200
> From: Dominik Szczerba <domi at vision.ee.ethz.ch>
> Subject: Re: [vtkusers] can I use normals to evaluate the gradients?
> To: vtkusers at vtk.org
> Message-ID: <44B93D13.9050901 at vision.ee.ethz.ch>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> gradient of what?
> --ds
>
> Dongqing Chen wrote:
> > Dear All:
> >
> >    I am trying to get the gradient vectors of all the vertices of
> > triangle surface mesh. One of my friend gave me some advice list as below:
> >
> > *************************************************************************************************
> > Triangle meshes are piece-wise linear approximation of smooth manifold.
> > the so-called gradient is not well-defined. you can use any reasonable
> > approximation from the gradient (normal) of the incident faces.
> > **************************************************************************************************
> >
> >   Can I just simply use to vtkPolydataNormals to get all the normal
> > vectors? Then how can I relate the normal vectors with the gradient
> > vectors at the points?
> >
> > Best Wishes,
> > -----------------------------------------------------------------
> > Dongqing Chen
> > Ph.D Research Assistant
> > Rm. 07, Paul C. Lutz Hall
> > Computer Vision & Image Processing (CVIP) Lab
> > Department of Electrical & Computer Engineering
> > Speed School of Engineering
> > University of Louisville
> > Louisville, KY. 40292
> > U.S.A
> > Email: dqchen at cvip.louisville.edu <mailto:dqchen at cvip.louisville.edu>
> > Phone:+1-502-852-2789 (Lab)
> >             +1-502-852-6130 (Office)
> > -----------------------------------------------------------------
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
>
> --
> Dominik Szczerba, Ph.D.
> Computer Vision Lab CH-8092 Zurich
> http://www.vision.ee.ethz.ch/~domi
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 16 Jul 2006 04:57:47 +0000
> From: "Louis Desjardins" <lost_bits1110 at hotmail.com>
> Subject: [vtkusers] PolyData to UnstructuredGrid?
> To: vtkusers at vtk.org
> Message-ID: <BAY119-F34075EEAB15241A53933FA996D0 at phx.gbl>
> Content-Type: text/plain; format=flowed
>
> Hi folks,
>
> I was wondering if anyone knew if there was a way to convert a PolyData to
> UnstructuredGrid?
>
> Thanks!
>
> LD
>
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar – get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 16 Jul 2006 13:28:30 +0800
> From: BoShi <chinaren.vtk at gmail.com>
> Subject: [vtkusers] Who can tell me how to display Chinese character
>        in VTK??
> To: vtkusers at vtk.org
> Message-ID: <44B9CE7E.7080707 at gmail.com>
> Content-Type: text/plain; charset=GB2312
>
> Thanks a lot!
>
> bhs
>
>
> ------------------------------
>
> Message: 5
> Date: Sun, 16 Jul 2006 09:53:49 +0200
> From: "Kamran Iranpour" <kamran.iranpour at gmail.com>
> Subject: [vtkusers] larger points
> To: vtkusers at vtk.org
> Message-ID:
>        <e4ad99290607160053w167a61fbj7f896e6b6120bdbf at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi
>
> I have used vtkPolyData to make a plot of a point cloud but having a
> poor eye sight I can hardly see the cloud. Is there any way of telling
> vtk to use larger points (cells).
>
> Thanks in advance
>
> Kamran
>
>
> ------------------------------
>
> Message: 6
> Date: Sun, 16 Jul 2006 10:55:30 +0200
> From: Dominik Szczerba <domi at vision.ee.ethz.ch>
> Subject: Re: [vtkusers] Delete problems
> To: Xiaofeng Zhao <xf10036 at hotmail.com>, vtkusers vtkusers
>        <vtkusers at vtk.org>
> Message-ID: <44B9FF02.6080200 at vision.ee.ethz.ch>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> That's smarter, thanks for a hint.
> --ds
>
> Xiaofeng Zhao wrote:
> > The following should also work:
> >
> >    //scope to use a lot of memory
> >    vtkSmartPointer<...> ptr = New();
> >    //huge dataset occupies memory only in this scope
> >    //do something with the dataset
> >    ptr = 0;
> >
> > I don't think it is a common practice to introduce a local scope just
> > for memory management.
> >
> >
> > ----- Original Message ----- From: "Dominik Szczerba"
> > <domi at vision.ee.ethz.ch>
> > Cc: "vtkusers vtkusers" <vtkusers at vtk.org>
> > Sent: Saturday, July 15, 2006 6:00 AM
> > Subject: Re: [vtkusers] Delete problems
> >
> >
> >> Mathieu, Amy, Utkarsh,
> >> Thank you all for your hint on smart pointers, I am now perfectly fine
> >> with them. However, as I understand now, I cannot explicitly free the
> >> memory occupied by a big dataset I am not going to use anymore, is
> >> that correct? I am thinking of a solution, is the below OK to use?
> >>
> >> {//scope to use a lot of memory
> >>   vtkSmartPointer<...> = New();
> >>   //huge dataset occupies memory only in this scope
> >>   //do something with the dataset
> >> }
> >> //memory automatically released without Delete()
> >>
> >> Or are there any better solutions?
> >> Thanks for any hints,
> >> regards,
> >> Dominik
> >>
> >> --
> >> Dominik Szczerba, Ph.D.
> >> Computer Vision Lab CH-8092 Zurich
> >> http://www.vision.ee.ethz.ch/~domi
> >> _______________________________________________
> >> 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
> >>
>
> --
> Dominik Szczerba, Ph.D.
> Computer Vision Lab CH-8092 Zurich
> http://www.vision.ee.ethz.ch/~domi
>
>
> ------------------------------
>
> Message: 7
> Date: Sun, 16 Jul 2006 10:57:37 +0200
> From: Dominik Szczerba <domi at vision.ee.ethz.ch>
> Subject: Re: [vtkusers] larger points
> To: Kamran Iranpour <kamran.iranpour at gmail.com>
> Cc: vtkusers at vtk.org
> Message-ID: <44B9FF81.3020308 at vision.ee.ethz.ch>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I think paraview doesnt support glPointSize... Use glyph filter instead.
> --ds
>
> Kamran Iranpour wrote:
> > Hi
> >
> > I have used vtkPolyData to make a plot of a point cloud but having a
> > poor eye sight I can hardly see the cloud. Is there any way of telling
> > vtk to use larger points (cells).
> >
> > Thanks in advance
> >
> > Kamran
> > _______________________________________________
> > 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
>
> --
> Dominik Szczerba, Ph.D.
> Computer Vision Lab CH-8092 Zurich
> http://www.vision.ee.ethz.ch/~domi
>
>
> ------------------------------
>
> Message: 8
> Date: Sun, 16 Jul 2006 15:44:42 +0200
> From: "Sander Verhoeven" <poepzweer at hotmail.com>
> Subject: [vtkusers] vtkGlyph3D indexing problem !
> To: <vtkusers at vtk.org>
> Message-ID: <BAY103-DAV404E47273FEF203929541BA6D0 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello, I'm working on my thesis with the VTK ToolKit and i have some
> problems...
>
> I want to put diffrent actors on some points of a mesh. I use vtkGlyph3D and
> set my sources in and setIndexModeToScalar();
> // CODE
>  glyph->SetSource(0, spheres->GetOutput());
>  glyph->SetSource(1, spheres->GetOutput());
>  glyph->SetSource(2, cubes->GetOutput());
>  glyph->SetSource(3, spheres->GetOutput());
>  glyph->SetSource(4, cubes->GetOutput());
>  glyph->SetSource(5, cubes->GetOutput());
>  glyph->SetSource(6, cones->GetOutput());
>  glyph->SetIndexModeToScalar();
> //
>
> ==> The problem is that only for the value 0 i see a sphere, the rest of the
> value's are all cones!!!  You can see it at the image :
> http://webs.hogent.be/~023174sv/BC2.jpg
>
> You can see a actor of the lookuptable where you can see that each value has
> a diffrent colour, but alle values 1 --> 6 are CONES , and only number 6
> should be a cone....
>
> Can anyone please help me ?
>
> Also i have a other question, the size of the actors should fit to the mesh,
> that means that when the points are further from eachother the actors should
> be bigger when there are lot's of point laying next to eachother....., is it
> possible in any way to get the maximum distance between points of a
> unstructured grid?? Or any option to solve this problem
>
> // HERE IS PART OF MY CODE:
>  vtkConeSource * cones = vtkConeSource::New();
>  cones->SetResolution(10);
>  cones->SetRadius(radius);
>  cones->SetHeight(radius*2);
>
>  vtkSphereSource *spheres = vtkSphereSource::New();
>   spheres->SetThetaResolution(10);
>   spheres->SetPhiResolution(10);
>   spheres->SetRadius(radius);
>
>  vtkCubeSource * cubes = vtkCubeSource::New();
>  cubes->SetXLength(radius);
>  cubes->SetYLength(radius);
>  cubes->SetZLength(radius);
>
> // MOET IN EEN KLASSE KOMEN VIA MAPPER vtkcolor["kleur"] return double*
> //
> // Setting up a color database: white, red, green, blue, yellow
> //                              cyan, magenta, sky blue, black
> //
>  double** vtkcolors = new double*[9];
>  for (int i=0; i<9; i++)
>  vtkcolors[i] = new double[4];
>
>  //white
>  vtkcolors[0][0]=1;
>  vtkcolors[0][1]=1;
>  vtkcolors[0][2]=1;
>  vtkcolors[0][3]=1;
>
>  //red
>  vtkcolors[1][0]=1;
>  vtkcolors[1][1]=0;
>  vtkcolors[1][2]=0;
>  vtkcolors[1][3]=1;
>
>  //green
>  vtkcolors[2][0]=0;
>  vtkcolors[2][1]=1;
>  vtkcolors[2][2]=0;
>  vtkcolors[2][3]=1;
>
>  //blue
>  vtkcolors[3][0]=0;
>  vtkcolors[3][1]=0;
>  vtkcolors[3][2]=1;
>  vtkcolors[3][3]=1;
>
>  //yellow
>  vtkcolors[4][0]=1;
>  vtkcolors[4][1]=1;
>  vtkcolors[4][2]=0;
>  vtkcolors[4][3]=1;
>
>  //cyan
>  vtkcolors[5][0]=0;
>  vtkcolors[5][1]=1;
>  vtkcolors[5][2]=1;
>  vtkcolors[5][3]=1;
>
>  //mangenta
>  vtkcolors[6][0]=1;
>  vtkcolors[6][1]=0;
>  vtkcolors[6][2]=1;
>  vtkcolors[6][3]=1;
>
>  //sky blue
>  vtkcolors[7][0]=0.5;
>  vtkcolors[7][1]=0.5;
>  vtkcolors[7][2]=1;
>  vtkcolors[7][3]=1;
>
>  //black
>  vtkcolors[8][0]=0;
>  vtkcolors[8][1]=0;
>  vtkcolors[8][2]=0;
>  vtkcolors[8][3]=1;
>
>
>  vtkLookupTable *glyphlut = vtkLookupTable::New();
>  glyphlut->SetRange(0,6);
>  glyphlut->SetNumberOfTableValues(7);
>  glyphlut->SetTableValue(0,vtkcolors[1]);
>  glyphlut->SetTableValue(1,vtkcolors[2]);
>  glyphlut->SetTableValue(2,vtkcolors[3]);
>  glyphlut->SetTableValue(3,vtkcolors[4]);
>  glyphlut->SetTableValue(4,vtkcolors[5]);
>  glyphlut->SetTableValue(5,vtkcolors[6]);
>  glyphlut->SetTableValue(6,vtkcolors[7]);
>  glyphlut->Build();
>
>  vtkGlyph3D *glyph = vtkGlyph3D::New();
>  glyph->SetInput(polydata);
>  glyph->ScalingOff();
>  glyph->SetNumberOfSources(7);
>  glyph->SetSource(0, spheres->GetOutput());
>  glyph->SetSource(1, spheres->GetOutput());
>  glyph->SetSource(2, cubes->GetOutput());
>  glyph->SetSource(3, spheres->GetOutput());
>  glyph->SetSource(4, cubes->GetOutput());
>  glyph->SetSource(5, cubes->GetOutput());
>  glyph->SetSource(6, cones->GetOutput());
>  glyph->SetIndexModeToScalar();
>  glyph->SetColorModeToColorByScalar();
>  glyph->Update();
>
>
>  //--- MAPPING AND RENDERING ---//
>  vtkPolyDataMapper *umap = vtkPolyDataMapper::New();
>  umap->SetInput(glyph->GetOutput());
>  umap->ScalarVisibilityOn();
>  umap->SetLookupTable(glyphlut);
>  umap->UseLookupTableScalarRangeOn();
>  umap->SetColorModeToMapScalars();
>
>  vtkDataSetMapper *gmap = vtkDataSetMapper::New();
>  gmap->SetInput(ugridreader->GetOutput());
>  gmap->ScalarVisibilityOff();
>
> //// MOET LEGENDE WORDEN / MAG WEG
>  loadBarActor();
>  baractor->SetLookupTable(umap->GetLookupTable());
>  baractor->SetTitle(toConstChar("Boundairy Conditions"));
>
>  vtkActor *uactor = vtkActor::New();
>  uactor->SetMapper(umap);
>
>  vtkActor *gactor = vtkActor::New();
>  gactor->SetMapper(gmap);
>  gactor->GetProperty()->SetColor(0.5,0.5,0.5);
>  gactor->GetProperty()->SetOpacity(0.1);
>  gactor->GetProperty()->SetRepresentationToWireframe();
>
>  ren->AddActor(gactor);
>  ren->AddActor(uactor);
>
>  //start clock
>  Stopwatch test;
>  test.start();
>
>  //render
>  renWin->Render();
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://public.kitware.com/pipermail/vtkusers/attachments/20060716/24fba374/attachment-0001.htm
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 27, Issue 17
> ****************************************
>


-- 
Yours Sincerely,

Huang Pengfei
Research Assistant & Graduate Candidate of M.Sc,
Image-Guided Surgery Laboratory, 5209 Software Building,
Shanghai Jiao Tong University, 800 Dongchuan Road, Shanghai, 200240, P.R.China
Email: herofay at gmail.com, herofay at sjtu.edu.cn Phone: +86 13816465208



More information about the vtkusers mailing list