[vtkusers] BMPReader --> Volume
Benoit Regrain
benoit.regrain at creatis.insa-lyon.fr
Wed Mar 30 01:54:05 EST 2005
Hi,
You may use a vtkImageClip to clip your volume and get only one slice.
With this, you will see each image loaded in your volume.
If an intermediate slice of your volume are black, it's when the BMPReader
hasn't found the image to your location. But in this case (I remember), you
may have a warning from your reader at the execution.
Cheers
Benoit
----- Original Message -----
From: "Michnay Balázs" <michnay at freemail.hu>
To: <vtkusers at vtk.org>
Sent: Tuesday, March 29, 2005 5:32 PM
Subject: [vtkusers] BMPReader --> Volume
> Dear VTK Users,
> I'm using a vtkBMPReader to read several images at once and to build
> a volume. The images are read because the Z-value is correct but only
> the first and the last slices can be seen. The whole volume looks like a
> black cube with the first image textured to the top and the last image
> textured to the bottom.
> To understand what I'm saying please take a look at the following
> image which demonstrates the problem:
>
> http://www.inf.u-szeged.hu/~michnay/volume.jpg
>
> The extent of the slices are not the same but reading images with
> equal extents provided the same result.
> What I'd like to do is to visualize all the slices in one volume (the
> middle
> ones as well) without the black cube...
>
> ---------------------------------
> What my C++ code does:
>
> vtkBMPReader *Reader = vtkBMPReader::New();
> Reader->SetNumberOfScalarComponents(3);
> Reader->SetFilePrefix("E:/kep/slice");
>
> Reader->SetFilePattern("%s.%d");
> Reader->SetFileNameSliceOffset(1);
> Reader->SetFileNameSliceSpacing(1);
>
> Reader->SetDataSpacing(1.0,1.0,0.1);
> Reader->SetDataOrigin(0,0,0);
> Reader->Update();
>
> vtkActor *VolumeActor = vtkActor::New();
> vtkDataSetMapper *VolumeMapper = vtkDataSetMapper::New();
>
> VolumeMapper->SetInput(Reader->GetOutput());
> VolumeActor->SetMapper(VolumeMapper);
>
> pDoc->renderer->AddActor(VolumeActor);
> pDoc->camera->Zoom(0.1);
> pDoc->renWin->Render();
> -----------------------------------
>
> What am I missing?
> Thanks for your help in advance!
> All the best,
>
> MB
> _______________________________________________
> 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