[vtkusers] orthogonal views through a volume

scsrsao at leeds.ac.uk scsrsao at leeds.ac.uk
Thu Jul 27 05:04:59 EDT 2006


Hi Luca,
 I'm attaching you a piece of code I'm using to generate slice views of a
volume, you should only modify the extent of the slice and create one for each
of the three orthogonal axis... just add to a typical rendering pipeline and it
should work... hope its useful for you... also, there are some medical examples
included in vtk, that should be also useful for you..

	timestepReader = vtkImageReader::New();
	  timestepReader->SetFileName("C:/ramos
ymas/PROY/data/TS21z_VEL_R2_008000.bin");
	  timestepReader->SetFileDimensionality(3);
	  timestepReader->SetDataScalarTypeToFloat();
	  timestepReader->SetDataByteOrderToBigEndian();
	  timestepReader->SetNumberOfScalarComponents(1);
 	  timestepReader->SetDataExtent(0,maxX,0,maxY,0,maxZ);
	  timestepReader->SetDataSpacing(spacing,spacing,spacing);
	  timestepReader->SetDataOrigin(-300000,-150000,-40000);

	timestepFlip = vtkImageFlip::New();
	  timestepFlip->SetInput((vtkDataObject*)timestepReader->GetOutput());
	  timestepFlip->SetFilteredAxis(1);

	//initialize Z slice stuff
	sliceZ = vtkImageDataGeometryFilter::New();
	  sliceZ->SetInput((vtkDataObject*)timestepFlip->GetOutput());
	  sliceZ->SetExtent(0,maxX,0,maxY,maxZ,maxZ);

	sliceZMapper = vtkPolyDataMapper::New();
	  sliceZMapper->SetInput(sliceZ->GetOutput());
	  sliceZMapper->SetLookupTable(scalarBar);
	  sliceZMapper->SetScalarRange(0.0000001, 3.1192195);
	  sliceZMapper->ScalarVisibilityOn();

	sliceZActor = vtkActor::New();
	  sliceZActor->SetMapper(sliceZMapper);

cheers,
Rodolfo

> Date: Tue, 25 Jul 2006 21:51:02 +0100
> From: "Luca Pamparana" <deluded.soul at gmail.com>
> Subject: [vtkusers] orthogonal views through a volume
> To: vtkusers at vtk.org
> Message-ID:
> 	<9779cb90607251351w2a19f1eaj18c47910270a41d5 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi everyone,
>
> I found out that the ITK Snap toolkit probably displays the three orthogonal
> views through the volume.
>
> I would like to know how I can do that with vtk. Do I have to use the
> vtkImageReslice or is there a better way...
>
> Any help would be greatly appreciated. Also, can anyone recommend a good
> medical image processing book that builds on these basics?
>
> Cheers and thanks,
>
> Luca
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
http://public.kitware.com/pipermail/vtkusers/attachments/20060725/34b575c2/attachment-0001.htm
>
> ------------------------------




More information about the vtkusers mailing list