<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Arial
}
LI.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Arial
}
DIV.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Arial
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>I have a suggestion. After reader.Update() call,
try reader.GetOutput().Update(). This is supposed to update bounds, extents, et
cetera.</FONT></DIV>
<DIV><FONT face=Arial size=2>HTH</FONT></DIV>
<DIV><FONT face=Arial size=2>Vidyadhar</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=evans@aps.anl.gov href="mailto:evans@aps.anl.gov">Kenneth Evans</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, May 21, 2008 1:48
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] How to make
vtkImagefrom vtkTIFFReader resize</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt">I am
reading and rereading TIFF images of different sizes (this is in Python, but
it should not matter):<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
reader = vtk.vtkTIFFReader()</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
reader.SetFileName(filename)</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
reader.Update()</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
actor = vtk.vtkImageActor()</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
actor.SetInput(reader.GetOutput())</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
actor.SetVisibility(</SPAN></FONT><FONT face="Courier New" color=maroon><SPAN
style="COLOR: maroon; FONT-FAMILY: 'Courier New'">1</SPAN></FONT><FONT
face="Courier New" color=black><SPAN
style="COLOR: black; FONT-FAMILY: 'Courier New'">)</SPAN></FONT><FONT
face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
ren.AddActor(actor)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt">I
want to read a new image:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
reader.SetFileName(filename)</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
reader.Update()<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt">This
works fine, except the output = reader.GetOutput() which is a vtkImage retains
the old size.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">output.GetExtent()
returns the original extent.</SPAN></FONT><FONT face="Courier New"><SPAN
style="FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">output.GetWholeExtent()
returns the new extent<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt">but<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">output.SetExtent(output.GetWholeExtent())
crashes.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">How to I reset the
vtkImage extent (without creating a new actor)?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black">
-Ken</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><o:p> </o:p></FONT></P></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>This is the private
VTK discussion list.<BR>Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></BODY></HTML>