<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Just read this thread. I happened to have same problem. I used vtkimagereader to read raw data and generated a surface, but found out it&nbsp;is in reverse direction.</DIV>
<DIV>&nbsp;</DIV>
<DIV>How could I reverse it?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks!</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luke&nbsp;<BR><BR><B><I>Mathieu Malaterre &lt;mathieu.malaterre@kitware.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Howard,<BR><BR>Ok that's what I wanted ! Where does your data comes from ? Did you <BR>know that VTK read the image data upside down ? Have a look at any image <BR>reader like png, jpeg, tiff. You'll see that we read starting from the <BR>bottom. So make sure your array is read starting from the bottom.<BR><BR>Or more generally use an already existing reader.<BR><BR>HTH,<BR>Mathieu<BR><BR>Howard Katz wrote:<BR>&gt; Also,<BR>&gt; just note that I input data using:<BR>&gt; <BR>&gt; VelocityVsTimeSampleFloatArray-&gt;SetVoidArray(array,TotalTimePoints*TotalCycles*NumBins, <BR>&gt; 1 );<BR>&gt; <BR>&gt; where array is a 1D float array whcih represents a 2D array through <BR>&gt; subscirpt arithemtic by doing:<BR>&gt; <BR>&gt; array [ row*TotalColumns + col ] = value;<BR>&gt; <BR>&gt; Thanks..!<BR>&gt; Howard<BR>&gt; <BR>&gt;&gt; From: "Howard Katz" <LOST_BITS1110@HOTMAIL.COM><BR>&gt;&gt;
 To: mathieu.malaterre@kitware.com<BR>&gt;&gt; CC: vtkusers@vtk.org<BR>&gt;&gt; Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>&gt;&gt; Date: Mon, 22 Mar 2004 23:11:20 +0000<BR>&gt;&gt;<BR>&gt;&gt; Hi,<BR>&gt;&gt;<BR>&gt;&gt; I called GetSpacing and it returns (1,1,1) just as I had specified..<BR>&gt;&gt; And I know the input values are correct i.e they're not negative or <BR>&gt;&gt; anything because I also outputted this..<BR>&gt;&gt; And I noticed that whenever I don't add a camera to my renderer, <BR>&gt;&gt; nothing happens when I change the spacing, is this normal?<BR>&gt;&gt; Okay below is some C++ code,<BR>&gt;&gt; So again its werid because the whole thing appears upside down only <BR>&gt;&gt; for some cases and not others..?<BR>&gt;&gt; Anyways here it is:<BR>&gt;&gt;<BR>&gt;&gt; VelocityVsTimeSampleFloatArray-&gt;SetNumberOfComponents(1);<BR>&gt;&gt; VelocityVsTimeSampleFloatArray-&gt;SetNumberOfTuples(TotalCycles*NumVelocityBins*TotalTimePoints
 <BR>&gt;&gt; );<BR>&gt;&gt; VelocityVsTimeSampleImageData-&gt;SetOrigin(-30, -85, 0);<BR>&gt;&gt; VelocityVsTimeSampleImageData-&gt;GetPointData()-&gt;SetScalars(VelocityVsTimeSampleFloatArray); <BR>&gt;&gt;<BR>&gt;&gt; VelocityVsTimeSampleImageData-&gt;SetDimensions(TotalCycles*TotalTimePoints,NumVelocityBins, <BR>&gt;&gt; 1);<BR>&gt;&gt; VelocityVsTimeSampleImageData-&gt;SetScalarType(VTK_FLOAT);<BR>&gt;&gt; VelocityVsTimeSampleImageData-&gt;SetSpacing(1, 1, 1);<BR>&gt;&gt;<BR>&gt;&gt; ImageCast-&gt;SetInput( VelocityVsTimeSampleImageData);<BR>&gt;&gt; ImageCast-&gt;SetOutputScalarTypeToUnsignedChar();<BR>&gt;&gt;<BR>&gt;&gt; ImageMapToColors-&gt;SetInput(ImageCast-&gt;GetOutput());<BR>&gt;&gt; ImageMapToColors-&gt;SetLookupTable(SpectLUT);<BR>&gt;&gt;<BR>&gt;&gt; SpectActor-&gt;SetInput(ImageMapToColors-&gt;GetOutput());<BR>&gt;&gt; SpectActor-&gt;SetDisplayExtent( 0, TotalCycles*TotalTimePoints-1, 0, <BR>&gt;&gt; NumVelocityBins-1, 0, 0 );<BR>&gt;&gt;<BR>&gt;&gt;
 Cam-&gt;SetPosition(0, 0, 325);<BR>&gt;&gt; Cam-&gt;SetFocalPoint(0,0,0);<BR>&gt;&gt;<BR>&gt;&gt; Ren1-&gt;SetBackground(0.3, 0.3, 0.3);<BR>&gt;&gt; Ren1-&gt;SetActiveCamera(Cam);<BR>&gt;&gt; Ren1-&gt;AddActor( SpectActor );<BR>&gt;&gt;<BR>&gt;&gt; RenWin-&gt;AddRenderer( Ren1 );<BR>&gt;&gt; RenWin-&gt;SetSize( 500, 500 );<BR>&gt;&gt; RenWin-&gt;SetInteractor(Iren);<BR>&gt;&gt; Iren-&gt;SetStillUpdateRate(1000);<BR>&gt;&gt; Iren-&gt;SetDesiredUpdateRate(1000);<BR>&gt;&gt; Iren-&gt;Initialize();<BR>&gt;&gt; Iren-&gt;Render();<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;&gt; From: Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM><BR>&gt;&gt;&gt; To: Howard Katz <LOST_BITS1110@HOTMAIL.COM><BR>&gt;&gt;&gt; CC: vtkusers@vtk.org<BR>&gt;&gt;&gt; Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>&gt;&gt;&gt; Date: Mon, 22 Mar 2004 17:34:30 -0500<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Howard,<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; What does
 :<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; //Call Update() before<BR>&gt;&gt;&gt; print imagedata.GetSpacing()<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; return ?<BR>&gt;&gt;&gt; Could you reproduce the bad behavior using a tests from VTK ? Or <BR>&gt;&gt;&gt; could you send us a python/c++/tcl code that shows this problem.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Thanks<BR>&gt;&gt;&gt; Mathieu<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Howard Katz wrote:<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Hi..<BR>&gt;&gt;&gt;&gt; What do you mean my spacing 'can' be negative...?<BR>&gt;&gt;&gt;&gt; :S<BR>&gt;&gt;&gt;&gt; Thanks again..!<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; From: Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM><BR>&gt;&gt;&gt;&gt;&gt; To: Howard Katz <LOST_BITS1110@HOTMAIL.COM><BR>&gt;&gt;&gt;&gt;&gt; CC: vtkusers@vtk.org<BR>&gt;&gt;&gt;&gt;&gt; Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>&gt;&gt;&gt;&gt;&gt; Date: Mon, 22 Mar 2004 13:13:18
 -0500<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; Howard Katz wrote:<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;&gt; Hi,<BR>&gt;&gt;&gt;&gt;&gt;&gt; so has anyone run into the problem where their vtkImageData looks <BR>&gt;&gt;&gt;&gt;&gt;&gt; upside down only sometiems depending on the input values..? i.e. <BR>&gt;&gt;&gt;&gt;&gt;&gt; I know I am inputting values 10, 20, 15 (for example) but these <BR>&gt;&gt;&gt;&gt;&gt;&gt; appear at rows -10, -20, -15 (..and this will happen for the <BR>&gt;&gt;&gt;&gt;&gt;&gt; entire image data)<BR>&gt;&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;&gt; Can anyoen guess what my problem might be?<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; You spacing can be negative, this happens typically in medical <BR>&gt;&gt;&gt;&gt;&gt; image data such a MINC or DICOM<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt; HTH<BR>&gt;&gt;&gt;&gt;&gt;
 Mathieu<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; _________________________________________________________________<BR>&gt;&gt;&gt;&gt; All the action. All the drama. Get NCAA hoops coverage at MSN Sports <BR>&gt;&gt;&gt;&gt; by ESPN. http://msn.espn.go.com/index.html?partnersite=espn<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; _______________________________________________<BR>&gt;&gt;&gt; This is the private VTK discussion list. Please keep messages <BR>&gt;&gt;&gt; on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<BR>&gt;&gt;&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; _________________________________________________________________<BR>&gt;&gt; Get tax tips, tools and access to IRS forms ?all in one place at MSN <BR>&gt;&gt; Money!
 http://moneycentral.msn.com/tax/home.asp<BR>&gt;&gt;<BR>&gt;&gt; _______________________________________________<BR>&gt;&gt; This is the private VTK discussion list. Please keep messages <BR>&gt;&gt; on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>&gt;&gt; Follow this link to subscribe/unsubscribe:<BR>&gt;&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; <BR>&gt; <BR>&gt; _________________________________________________________________<BR>&gt; Is your PC infected? Get a FREE online computer virus scan from McAfee?<BR>&gt; Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list. Please keep messages on-topic. <BR>&gt; Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt;
 <BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers</BLOCKQUOTE><p><font face=arial size=-1>Do you Yahoo!?<br>
<a href="http://taxes.yahoo.com/filing.html"><b>Yahoo! Finance Tax Center</a></b> - File online. File on time.