<DIV>Hi,</DIV>
<DIV> </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 is in reverse direction.</DIV>
<DIV> </DIV>
<DIV>How could I reverse it?</DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV> </DIV>
<DIV> Luke <BR><BR><B><I>Mathieu Malaterre <mathieu.malaterre@kitware.com></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>> Also,<BR>> just note that I input data using:<BR>> <BR>> VelocityVsTimeSampleFloatArray->SetVoidArray(array,TotalTimePoints*TotalCycles*NumBins, <BR>> 1 );<BR>> <BR>> where array is a 1D float array whcih represents a 2D array through <BR>> subscirpt arithemtic by doing:<BR>> <BR>> array [ row*TotalColumns + col ] = value;<BR>> <BR>> Thanks..!<BR>> Howard<BR>> <BR>>> From: "Howard Katz" <LOST_BITS1110@HOTMAIL.COM><BR>>>
To: mathieu.malaterre@kitware.com<BR>>> CC: vtkusers@vtk.org<BR>>> Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>>> Date: Mon, 22 Mar 2004 23:11:20 +0000<BR>>><BR>>> Hi,<BR>>><BR>>> I called GetSpacing and it returns (1,1,1) just as I had specified..<BR>>> And I know the input values are correct i.e they're not negative or <BR>>> anything because I also outputted this..<BR>>> And I noticed that whenever I don't add a camera to my renderer, <BR>>> nothing happens when I change the spacing, is this normal?<BR>>> Okay below is some C++ code,<BR>>> So again its werid because the whole thing appears upside down only <BR>>> for some cases and not others..?<BR>>> Anyways here it is:<BR>>><BR>>> VelocityVsTimeSampleFloatArray->SetNumberOfComponents(1);<BR>>> VelocityVsTimeSampleFloatArray->SetNumberOfTuples(TotalCycles*NumVelocityBins*TotalTimePoints
<BR>>> );<BR>>> VelocityVsTimeSampleImageData->SetOrigin(-30, -85, 0);<BR>>> VelocityVsTimeSampleImageData->GetPointData()->SetScalars(VelocityVsTimeSampleFloatArray); <BR>>><BR>>> VelocityVsTimeSampleImageData->SetDimensions(TotalCycles*TotalTimePoints,NumVelocityBins, <BR>>> 1);<BR>>> VelocityVsTimeSampleImageData->SetScalarType(VTK_FLOAT);<BR>>> VelocityVsTimeSampleImageData->SetSpacing(1, 1, 1);<BR>>><BR>>> ImageCast->SetInput( VelocityVsTimeSampleImageData);<BR>>> ImageCast->SetOutputScalarTypeToUnsignedChar();<BR>>><BR>>> ImageMapToColors->SetInput(ImageCast->GetOutput());<BR>>> ImageMapToColors->SetLookupTable(SpectLUT);<BR>>><BR>>> SpectActor->SetInput(ImageMapToColors->GetOutput());<BR>>> SpectActor->SetDisplayExtent( 0, TotalCycles*TotalTimePoints-1, 0, <BR>>> NumVelocityBins-1, 0, 0 );<BR>>><BR>>>
Cam->SetPosition(0, 0, 325);<BR>>> Cam->SetFocalPoint(0,0,0);<BR>>><BR>>> Ren1->SetBackground(0.3, 0.3, 0.3);<BR>>> Ren1->SetActiveCamera(Cam);<BR>>> Ren1->AddActor( SpectActor );<BR>>><BR>>> RenWin->AddRenderer( Ren1 );<BR>>> RenWin->SetSize( 500, 500 );<BR>>> RenWin->SetInteractor(Iren);<BR>>> Iren->SetStillUpdateRate(1000);<BR>>> Iren->SetDesiredUpdateRate(1000);<BR>>> Iren->Initialize();<BR>>> Iren->Render();<BR>>><BR>>><BR>>><BR>>><BR>>>> From: Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM><BR>>>> To: Howard Katz <LOST_BITS1110@HOTMAIL.COM><BR>>>> CC: vtkusers@vtk.org<BR>>>> Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>>>> Date: Mon, 22 Mar 2004 17:34:30 -0500<BR>>>><BR>>>> Howard,<BR>>>><BR>>>> What does
:<BR>>>><BR>>>> //Call Update() before<BR>>>> print imagedata.GetSpacing()<BR>>>><BR>>>> return ?<BR>>>> Could you reproduce the bad behavior using a tests from VTK ? Or <BR>>>> could you send us a python/c++/tcl code that shows this problem.<BR>>>><BR>>>> Thanks<BR>>>> Mathieu<BR>>>><BR>>>> Howard Katz wrote:<BR>>>><BR>>>>> Hi..<BR>>>>> What do you mean my spacing 'can' be negative...?<BR>>>>> :S<BR>>>>> Thanks again..!<BR>>>>><BR>>>>><BR>>>>><BR>>>>>> From: Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM><BR>>>>>> To: Howard Katz <LOST_BITS1110@HOTMAIL.COM><BR>>>>>> CC: vtkusers@vtk.org<BR>>>>>> Subject: Re: [vtkusers] imagedata appearing upside down (sometimes..?)<BR>>>>>> Date: Mon, 22 Mar 2004 13:13:18
-0500<BR>>>>>><BR>>>>>> Howard Katz wrote:<BR>>>>>><BR>>>>>>> Hi,<BR>>>>>>> so has anyone run into the problem where their vtkImageData looks <BR>>>>>>> upside down only sometiems depending on the input values..? i.e. <BR>>>>>>> I know I am inputting values 10, 20, 15 (for example) but these <BR>>>>>>> appear at rows -10, -20, -15 (..and this will happen for the <BR>>>>>>> entire image data)<BR>>>>>>><BR>>>>>>> Can anyoen guess what my problem might be?<BR>>>>>><BR>>>>>><BR>>>>>><BR>>>>>> You spacing can be negative, this happens typically in medical <BR>>>>>> image data such a MINC or DICOM<BR>>>>>><BR>>>>>> HTH<BR>>>>>>
Mathieu<BR>>>>>><BR>>>>>><BR>>>>><BR>>>>> _________________________________________________________________<BR>>>>> All the action. All the drama. Get NCAA hoops coverage at MSN Sports <BR>>>>> by ESPN. http://msn.espn.go.com/index.html?partnersite=espn<BR>>>>><BR>>>>><BR>>>><BR>>>><BR>>>><BR>>>> _______________________________________________<BR>>>> This is the private VTK discussion list. Please keep messages <BR>>>> 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<BR>>><BR>>><BR>>> _________________________________________________________________<BR>>> Get tax tips, tools and access to IRS forms ?all in one place at MSN <BR>>> Money!
http://moneycentral.msn.com/tax/home.asp<BR>>><BR>>> _______________________________________________<BR>>> This is the private VTK discussion list. Please keep messages <BR>>> 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<BR>> <BR>> <BR>> _________________________________________________________________<BR>> Is your PC infected? Get a FREE online computer virus scan from McAfee?<BR>> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963<BR>> <BR>> _______________________________________________<BR>> This is the private VTK discussion list. Please keep messages on-topic. <BR>> 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<BR>>
<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.