[vtkusers] Image Grid

Brian Gee Chacko hebrev at gmail.com
Fri Feb 22 00:07:59 EST 2008


Thanks Guys for replying, (Mark, Prashanth, Yuri, Frederic)

The issue is i don't want to create just any grid, its topology and
geometry should match any part of an imageGridSource. Is there a way
of select a region in real time?. Please see the code below

/***********Displaying landmarks**************************/
vtkImageGridSource *imGrid = vtkImageGridSource::New();
imGrid->SetGridSpacing(0.2,0.2,0.2);
imGrid->SetGridOrigin(0,0,0);
imGrid->SetDataExtent(ext[0],ext[1],ext[2],ext[3],ext[4],ext[5]);
   imGrid->SetDataScalarTypeToUnsignedChar();

vtkLookupTable *table = vtkLookupTable::New();
table->SetTableRange(0,1);
table->SetValueRange(1.0,0.0);
table->SetSaturationRange(0.0,0.0);
table->SetHueRange(0.0,0.0);
table->SetAlphaRange(0.0,1.0);
table->Build();

vtkImageMapToColors *alpha = vtkImageMapToColors::New();
   alpha->SetInputConnection(imGrid->GetOutputPort());
   alpha->SetLookupTable(table);

vtkImageBlend *blend = vtkImageBlend::New();
blend->AddInput(jpg->GetOutput());
blend->AddInput(alpha->GetOutput());

vtkDataSetMapper *imMap = vtkDataSetMapper::New();
imMap->SetInputConnection(blend->GetOutputPort());

imActor->SetMapper(imMap);

On Mon, Feb 18, 2008 at 10:31 AM, Mark Wyszomierski <markww at gmail.com> wrote:
> What do you want to do with it, render in 3D? Why don't you make one
>  using points and lines instead of vtkImageData?
>
>  Mark
>
>
>
>  On Feb 17, 2008 11:55 PM, Brian Gee Chacko <hebrev at gmail.com> wrote:
>  > Hi all,
>  >
>  > Could someone help me out in creating a simple rectangular grid. I
>  > tried to use an vtkImageData and a dataset mapper but failed in this
>  > pursuit.
>  >
>  > Regards
>  > Brian Gee Chacko
>  > _______________________________________________
>  > 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
>  >
>



More information about the vtkusers mailing list