[vtkusers] vtkTiffReader GetDataSpacing error

Kevin H. Hobbs kevin.hobbs.1 at ohiou.edu
Tue May 16 10:49:18 EDT 2006


On Tue, 2006-05-16 at 16:21 +0200, brizzi at deis.unibo.it wrote:
> 
> Dear vtkusers,
> 
> I'm using vtk 5.0.0. I read a serie af tiff slices using vtkTiffReader, but I
> can't get the righ spacing. In attach you could find my code.
> 

I do something like that below. I don't think tiff files know anything
about spacing.

int main( int argc, char * argv[] )
{
	// reader file pattern	argv[1]
	double	space_x = atof(	argv[2] );
	double	space_y = atof(	argv[3] );
	double	space_z = atof(	argv[4] );
	int	extent[6]; //	argv[5]
			   //	argv[6]
			   //	argv[7]
	double	level   = atof(	argv[8] );
	int	pieces	= atoi( argv[9] );
	// writer file name	argv[10]
	
	int piece;

	vtkTIFFReader * reader = vtkTIFFReader::New();
	reader->SetFilePattern( argv[1] );
	reader->SetFileNameSliceOffset( 0 );
	reader->SetDataSpacing( space_x, space_y, space_z );
	extent[0] = 0;
	extent[1] = atoi( argv[5] );
	extent[2] = 0;
	extent[3] = atoi( argv[6] );
	extent[4] = 0;
	extent[5] = atoi( argv[7] );
	reader->SetDataExtent( extent );
	.
	.
	.


> I have 2 different series of tiff slices. The first one has values only on the
> first channel (red), the second one only the second channel (green). Is it
> possible, with vtk, to create only a image (volume) with both components, red
> in 1st channel and green in 2nd channel?
> 

I think there's a collect components filter or something...

http://www.vtk.org/doc/nightly/html/classvtkImageAppendComponents.html


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060516/1aa2a920/attachment.pgp>


More information about the vtkusers mailing list