<div>Hi,</div>
<div> </div>
<div>I'm new to VTK. I have a set of 24-bit RGB images (without a header) and I want to display them in a volume. What is the suitable approach? I tried in several ways but none of them seem to be right.</div>
<div> </div>
<div>Initially I read R, G, B components seperately into three vtkImageReader objects, append them together using vtkImageAppendComponents object and used a vtkImageActor. When I used GetWholeZMin() and GetWholeZMax methods of vtkImageActor, it shows that all images have been entered into vtkImageActor. But only the 1st image is displayed. Then I found that vtkImageActor seems to be able to show only one slice. </div>
<div> </div>
<div>Then I tried to display using vtkVolumeRayCastMapper and vtkVolume. It generates a set of parrelel planes, but it is in grey scale and only part of the image is shown. I want to display in original colouring.</div>
<div> </div>
<div>In the 1st method, if I use a vtkActor insead of vtkImageActor, I think I would need a mapper object. Is there a suitable mapper object?</div>
<div> </div>
<div>I also found that vtkVolumeReader can be used to read images and if more than one image is read results in a 3D volume. I tried that also, but when I compile it, it gives an error like this. I'm using VTK5.2.1. Why does this happen?</div>
<div> </div>
<div>
<div><font color="#6633ff">error C2440: 'initializing' : cannot convert from 'class vtkAlgorithm *' to 'class vtkVolumeReader *'<br> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br>
</font></div></div>
<div> </div>
<div>#include "vtkVolumeReader.h"</div>
<div><br>int main(int argc, char **argv)<br>{<br> int numCol=2048;<br> int numRow=1216;<br> int startSlice=0;<br> int endslice=10;</div>
<div> <br> vtkVolumeReader *reader=vtkVolumeReader::New();<br> reader->SetFilePrefix(argv[1]);<br> reader->SetImageRange(startSlice,endslice);<br> reader->SetFilePattern("%s%d.raw");<br> reader->SetDataSpacing(0.33, 0.33, 1);//voxel size<br>
reader->UpdateWholeExtent();<br><br> return 0;<br>}</div>
<div> </div>
<div> Thanks a lot.</div>
<div>Chamanthi</div>
<div> </div>