[vtkusers] Constructing a volume....

Michnay Balázs michnay at freemail.hu
Wed Oct 19 10:01:07 EDT 2005


Dear VTK Users,

I read all the posts about constructing a volume from individual images 
but I still can't get my program working. I think I don't miss very much, 
because the volume extent is OK.
Hopefully some of you succeeded constructing a volume from images 
and can tell me what's wrong with this code.

Here's my code:
----------------------------
vtkImageAppend *outputBCF = vtkImageAppend::New();
outputBCF->SetAppendAxis(2);

for (int i=0; i<10; i++){
  median.SetInput(getNthFrame(volume,i)); //This sets the input of a 
filter (this works well).
  outputBCF->AddInput(median.execute()); //medin.execute() returns 
the filtered image (no problem with image).
}	

outputBCF->UpdateWholeExtent();
outputBCF->Update();

-----------------------------
I use outputBCF->GetOutput() to access the volume.

Here, the extent is OK and when I take a look at the slices, all the 
frames contain the same image (the last one) as if I added the same 
image at all iterations of the for loop. The AddInput() method gets the 
right images for sure and still don't know why the slices are identical to 
the last one.

Here's how I look at the slices:
-----------------------------
vtkImageViewer *v = vtkImageViewer::New();
v->SetInput(outputBCF->GetOutput());
v->SetColorLevel(127.5);
v->SetColorWindow(255.0);
v->SetZSlice(5);
v->Render();
-----------------------------

No matter what the ZSlice is, all the frames are the same...

Any ideas what the problem is?

If you have a different solution and don't mind sharing your ideas about 
this, please let me know how to do this. I don't stick to this, any 
working version would be very helpful.

Thanks a lot.

Bye,

  Michnay

_________________________________________________________________________
Töltsd le Caramel első saját szerzeményét, és nyerj egy
közös vacsorát vagy VIP-jegyeket a lemezbemutató koncertre!
http://zenearuhaz.t-online.hu/index.php?m=info&albumid=14517&sp=74&sty=78





More information about the vtkusers mailing list