[vtkusers] Re: Texture mapping on a 3D surface.
Jens Ivar Jørdre
jensivar at fmri.no
Wed Jun 8 10:25:52 EDT 2005
Hi Goodwin.
I think this is the way to go, although I have some difficulty getting
the coloring right. The problem I face comes about when I want to
prepare the MR image volume as the source for vtkProbeFilter.
When I fill an instance of vtkImageData (called fTextureData) with MR
voxel values I guess I should this info as cell attributes, right? I
mean the voxel data corresponds to attributes of cells in vtkImage.
Hence I fill an instance of vtkFloatArray (called textureArray) with
voxel values and call
fTextureData->GetCellData()->SetScalars(textureArray);
However, the entities whose color I want to determine are points.
Therfoe I try to use vtkCellDataToPointData in order to determine the
point attributes in fTextureData. The output from this filter I then
pipe into vtkProbeFilter. This part of the pipe line looks like this:
vtkCellDataToPointData* ctp = vtkCellDataToPointData::New();
ctp->SetInput(fTextureData);
ctp->PassCellDataOn();
vtkProbeFilter* probe = vtkProbeFilter::New();
probe->SetInput(fPolyData); // My instance of vtkPolyData
probe->SetSource(ctp->GetPolyDataOutput());
The result of this is that probe complains about the source being empty.
Does anyone see what I'm doing wrong? It kind of looks as if I don't
use the vtkCellDataToPointData filter properly.
Kind regards
Jens Ivar Jørdre
Goodwin Lawlor skrev:
> Hi Jens,
>
> Use vtkProbeFilter with your (vtkPolyData) tessellated surface as the input
> and your (vtkImageData) MR image volume as the source. The output will be
> the same vtkPolyData as the input with some point scalar values sampled from
> the source.
>
> hth,
>
> Goodwin
>
>
> "Jens Ivar Jørdre" <jensivar at fmri.no> wrote in message
> news:42A6ADF7.60600 at fmri.no...
> Howdy.
>
> Here comes a question from someone who quite recently started using VTK
> 4.2 on Windows XP. So far I've used VTK to visualize a tessellated
> surface of the brain reconstructed from MR images.
>
> I then want to move on to color the surface in grey tones according to
> voxel intensities of the surface points. I first tried to use vtkTexture
> to load a (3D) vtkImageData filled with voxel intensities from the MR
> image volume. However, since vtkTexture only supports 2D texture maps I
> had to give up this effort.
>
> Then I've tried to assign texture coordinates to the points that define
> the tessellated surface, but I see no effect on the surface rendered.
> Does anyone have some example for me to look at? I don't find relevant
> suggestions in the examples shipped with VTK.
>
> Kind regards
> Jens Ivar Jørdre
>
> _______________________________________________
> 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
>
>
>
> _______________________________________________
> 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