[vtkusers] Montege 4X4 of some 3D Volume's slices
Darshan Pai
darshanpai at gmail.com
Sat Jun 5 13:53:43 EDT 2010
Say you have a 120x120x60 volume image (vtkImageData) and you want 4 slices
in the z direction .
The code will look like this :
vtkImageDataGeometryFilter *filter1 = vtkImageDataGeometryFilter::New();
filter1->SetInput(vtkImageData)
filter1->SetExtent(0,119,0,119,30,30) ; /// This is for vieweing the 29th
slice
vtkPolyData *ax1 = filter1->GetOutput();
brightness = *(imageData->GetScalarRange()+1);
vtkPolyDataMapper *axialMapper->SetInput(ax1);
axialMapper->ScalarVisibilityOn();
axialMapper->SetScalarRange(0, brightness);
axialMapper->SetLookupTable(bwLut);
axialActor->SetMapper(axialMapper);
####bwlut is vtkLookupTable which can be initialized as follows
bwLut = vtkLookupTable::New();
bwLut->SetTableRange(0, brightness ); // Brightness can be replaced by
any suitable value
bwLut->SetSaturationRange(0, 0);
bwLut->SetHueRange(0, 0);
bwLut->SetValueRange(0, 1);
////////////////////////////////////////////////
On Sat, Jun 5, 2010 at 10:23 AM, Daniela Sacchetto <danysunflower at hotmail.it
> wrote:
> Hi Eric
> I'm trying to follow also your suggestion to value if it is better or no
> than Darshan's one... But I have a first problem: how can I modify that
> code to use it with my Image set? Because now I'm able to run it only with
> /usr/local/vtk/VTKData/Data/headsq/quarter and I don't understand what
> quarter.1-quarter.93 are...
>
> Could you explain me?
> Thanks
> Daniela
>
> ------------------------------
> Subject: Re: [vtkusers] Montege 4X4 of some 3D Volume's slices
> From: emonson at cs.duke.edu
> Date: Thu, 3 Jun 2010 14:08:18 -0400
> CC: danysunflower at hotmail.it; vtkusers at vtk.org
> To: darshanpai at gmail.com
>
>
> Hey Daniela,
>
> I guess I would suggest a different possibility. For each slice, you could
> set up a vtkImageReslice filter, and each one can go through a
> vtkImageMapToColors and then to a vtkImageActor. For each actor you can then
> use the SetPosition() method to arrange them in the 4x4 grid of images.
> Then, if you want to change the slices that are displayed, you just change
> the matrix that sets the "reslice axes" for that particular image.
>
> This method is taken directly from the ImageSlicing.cxx example in
> [vtk_source]/Examples/ImageProcessing/Cxx (or there are Python and Tcl
> examples of the same code in their respective subdirectories).
>
> Talk to you later,
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> On Jun 3, 2010, at 1:57 PM, Darshan Pai wrote:
>
> Yes You can definately do that .
> You can start with vtkImageDataGeometryFilter and set the extent depending
> on what slice you want. The resulting polyData can be connected to the
> mapper . also add a lookuptable to the mapper and render.
>
> Regards
> Darshan
>
> On Thu, Jun 3, 2010 at 1:06 PM, Daniela Sacchetto <
> danysunflower at hotmail.it> wrote:
>
> Hi everyone
>
> I have a question for you.
> I'm working with a 3D rendered volume and I would like to do a ''montage''
> 4x4 of some significative slices (as CT o RM traditional images...) in my
> vtkRenderWindow...
> Is it possible? Is there any vtk method to do something similar?
>
> Thank to everyone who will help me
> Daniela
>
> ------------------------------
> Un mondo di personalizzazioni per Messenger, PC e cellulare, scaricale
> gratis!
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> ------------------------------
> Il tuo mondo MSN a portata di clic. Scarica IE8 per MSN<http://events.it.msn.com/internet-explorer-8>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100605/f5e25bad/attachment.htm>
More information about the vtkusers
mailing list