Display of an SLC file

M.Schrijver at el.utwente.nl M.Schrijver at el.utwente.nl
Wed May 10 08:04:19 EDT 2000


Hi,

since you're in a hurry, I'll give you a quick answer ;-)

My first suggestion is to have a look at the samples in the several
examplesTcl directories, especially the patented/examplesTcl. If you
have Tcl installed, I'd say you're best off modifying one of them for
your purposes. If not, it should not be too hard to convert them to C++
code.

Second, since you say you get run-time errors it appears that the
program compiled and linked succesfully. And thus your makefile does not
really matter anymore.

Third, it would be a great help of you'd mention the specific run-time
errors you get .....

Fourth, you should start with a very basic pipeline, default camera's
etc. So, loose all the other ^%$&^@. When you get that to work, add the
other features again.
Then you have something like:

> --- cut ---
> #include <vtk.h>
> #include <vtkMarchingCubes.h>
> #include <iostream>
> 
> int main(int argc, char **argv){
> 
>         vtkRenderer *aRenderer = vtkRenderer::New();
>         vtkRenderWindow *renWin = vtkRenderWindow::New();
>         vtkRenderWindowInteractor *iren =
> vtkRenderWindowInteractor::New();
>         renWin->AddRenderer(aRenderer);
>         iren->SetRenderWindow(renWin);
> 
>         vtkSLCReader *inFile = vtkSLCReader::New();
>         inFile->SetFileName("brainbig.vis");
> 
>         vtkMarchingCubes *skinExtractor = vtkMarchingCubes::New();
>         skinExtractor->SetInput(inFile->GetOutput());
> 
>         vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
>         skinMapper->SetInput(skinExtractor->GetOutput());
>         skinMapper->ScalarVisibilityOff();
> 
>         vtkActor *skin = vtkActor::New();
>         skin->SetMapper(skinMapper);
> 
>         aRenderer->AddActor(skin);
>         iren->Start();
> }
Just have a look at the numerous examples to make sure I made no
mistakes .....

Fifth, I guess you should do something like "skinExtractor->SetValue 0
128" to generate an iso-surface at level 128 (or whichever value you
desire).

Sixth, I think that vtkMarchingContourFilter is more appropriate than
vtkMarchingCubes; it will dispatch to the correct (read, the fastest)
contour algorithm available for your type of data.


I wish you good luck with your project.

Marc Schrijver




--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list