<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<BR>
<BR>
I've been having trouble reading tiff files. I'm wondering if the file is corrupted (although I can visualize it with Paint). The output of vtk says : Problem reading the row: XX. My code is the following. Am I missing something? I've been reading jpg images with vtkJPEGReader and it works fine.<BR>
<BR>
Thanks in advance for your help,<BR>
Pascale<BR>
<BR>
<BR><FONT size=2>
vtkTIFFReader * TIFFRead = vtkTIFFReader::New();<BR>
TIFFRead->SetFileName(</FONT><FONT color=#a31515 size=2>"D:\\Canyon.TIF"</FONT><FONT size=2>);<BR>
TIFFRead->Modified();<BR>
TIFFRead->Update();<BR>
<BR>
vtkImageData * TIFFImage = TIFFRead->GetOutput();<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> NumComponents = TIFFImage->GetNumberOfScalarComponents();<BR>
cout << </FONT><FONT color=#a31515 size=2>"number of components = "</FONT><FONT size=2> << NumComponents; // outputs 3<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> ImageDimensions[3]; <BR>
</FONT><FONT color=#008000 size=2> <BR></FONT><FONT size=2>
<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> * Extent; Extent = TIFFImage->GetExtent();<BR>
ImageDimensions[0] = Extent[1] - Extent[0];<BR>
ImageDimensions[1] = Extent[3] - Extent[2];<BR>
ImageDimensions[2] = Extent[5] - Extent[4];<BR>
cout << </FONT><FONT color=#a31515 size=2>"Dimensions = ("</FONT><FONT size=2> << ImageDimensions[0] << </FONT><FONT color=#a31515 size=2>", "</FONT><FONT size=2> << ImageDimensions[1] << </FONT><FONT color=#a31515 size=2>", "</FONT><FONT size=2> << ImageDimensions[2] << </FONT><FONT color=#a31515 size=2>")"</FONT><FONT size=2> ; // outputs the correct image size<BR>
<BR>
vtkImageViewer * ImView = vtkImageViewer::New();<BR>
ImView->SetInput(TIFFImage);<BR>
ImView->Modified();<BR>
ImView->Render();<BR>
<BR>
vtkRenderWindowInteractor * Interactor = vtkRenderWindowInteractor::New();<BR>
ImView->GetRenderWindow()->SetInteractor(Interactor);<BR>
ImView->GetRenderWindow()->Render(); // outputs a black image (?)<BR>
Interactor->Start();<BR>
<BR>
<BR></FONT><RTE_TEXT></RTE_TEXT><br /><hr /> <a href='' target='_new'></a></body>
</html>