<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<BR>
&nbsp;<BR>
&nbsp;&nbsp; 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&nbsp;jpg images with vtkJPEGReader and it works fine.<BR>
&nbsp;<BR>
Thanks in advance for your help,<BR>
Pascale<BR>
&nbsp;<BR>
&nbsp;<BR><FONT size=2>
vtkTIFFReader * TIFFRead = vtkTIFFReader::New();<BR>
TIFFRead-&gt;SetFileName(</FONT><FONT color=#a31515 size=2>"D:\\Canyon.TIF"</FONT><FONT size=2>);<BR>
TIFFRead-&gt;Modified();<BR>
TIFFRead-&gt;Update();<BR>
&nbsp;<BR>
vtkImageData * TIFFImage = TIFFRead-&gt;GetOutput();<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> NumComponents = TIFFImage-&gt;GetNumberOfScalarComponents();<BR>
cout &lt;&lt; </FONT><FONT color=#a31515 size=2>"number of components = "</FONT><FONT size=2> &lt;&lt; NumComponents; // outputs 3<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> ImageDimensions[3]; <BR>
</FONT><FONT color=#008000 size=2>&nbsp;<BR></FONT><FONT size=2>
<BR>
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> * Extent; Extent = TIFFImage-&gt;GetExtent();<BR>
ImageDimensions[0] = Extent[1] - Extent[0];<BR>
ImageDimensions[1] = Extent[3] - Extent[2];<BR>
ImageDimensions[2] = Extent[5] - Extent[4];<BR>
cout &lt;&lt; </FONT><FONT color=#a31515 size=2>"Dimensions = ("</FONT><FONT size=2> &lt;&lt; ImageDimensions[0] &lt;&lt; </FONT><FONT color=#a31515 size=2>", "</FONT><FONT size=2> &lt;&lt; ImageDimensions[1] &lt;&lt; </FONT><FONT color=#a31515 size=2>", "</FONT><FONT size=2> &lt;&lt; ImageDimensions[2] &lt;&lt; </FONT><FONT color=#a31515 size=2>")"</FONT><FONT size=2> ; // outputs the correct image size<BR>
&nbsp;<BR>
vtkImageViewer * ImView = vtkImageViewer::New();<BR>
ImView-&gt;SetInput(TIFFImage);<BR>
ImView-&gt;Modified();<BR>
ImView-&gt;Render();<BR>
&nbsp;<BR>
vtkRenderWindowInteractor * Interactor = vtkRenderWindowInteractor::New();<BR>
ImView-&gt;GetRenderWindow()-&gt;SetInteractor(Interactor);<BR>
ImView-&gt;GetRenderWindow()-&gt;Render(); // outputs a black image (?)<BR>
Interactor-&gt;Start();<BR>
&nbsp;<BR>
&nbsp;<BR></FONT><RTE_TEXT></RTE_TEXT><br /><hr /> <a href='' target='_new'></a></body>
</html>