[vtkusers] Re: visuallize large image

Goodwin Lawlor goodwin.lawlor at ucd.ie
Fri Jun 17 10:16:51 EDT 2005

Hi Moti,

What values for shift and scale did you use? Here's a snippet from one of 
the examples...

You have to shift and scale the values so that min->0 and max->255

vtkVolume16Reader v16
  v16 SetDataDimensions 64 64
  v16 SetDataByteOrderToLittleEndian
  v16 SetImageRange 1 93
  v16 SetDataSpacing 3.2 3.2 1.5
  v16 SetFilePrefix "$VTK_DATA_ROOT/Data/headsq/quarter"
  v16 Update

  set range [[v16 GetOutput] GetScalarRange]
  set min [lindex $range 0]
  set max [lindex $range 1]
  set diff [expr $max - $min]
  set slope [expr 255.0/$diff]
  set inter [expr -$slope*$min]
  set shift [expr $inter/$slope]

vtkImageShiftScale shifter
  shifter SetShift $shift
  shifter SetScale $slope
  shifter SetOutputScalarTypeToUnsignedChar
  shifter SetInput [v16 GetOutput]
  shifter ReleaseDataFlagOff
  shifter Update



----- Original Message ----- 
From: "Moti Freiman" <freiman at cs.huji.ac.il>
To: "Goodwin Lawlor" <goodwin.lawlor at ucd.ie>
Cc: <vtkusers at vtk.org>
Sent: Friday, June 17, 2005 2:36 PM
Subject: Re: visuallize large image

> Hi!
> Thanks for your advise. however, my image scalar type is uint16 (16 bit 
> integer), and vtkimageactor should get just unsigned char (8 bit). when i 
> tried to change the scalar type using filters like vtkimagescaleshift and 
> so on, i got nothing?
> thanks
> moti
> Goodwin Lawlor wrote:
>>Hi Moti,
>>Use vtkImageActor
>>----- Original Message ----- 
>>From: "Moti Freiman" <freiman at cs.huji.ac.il>
>>Newsgroups: gmane.comp.lib.vtk.user
>>Sent: Friday, June 17, 2005 9:17 AM
>>Subject: visuallize large image
>>>I want to visuallize a large image (2000*3000 pixels) in window with
>>>normal size (600*800) using vtkImageViewer.
>>>one way to do it is to use vtkImageResample filter before set the input
>>>to the imageviewer. however i don't want to use resampling. instead of
>>>it yi want to zoom a camera or something like this.
>>>do someone have a code example that to something like this?
>>>Moti Freiman, Graduate Student.
>>>Medical Image Processing and Computer-Assisted Surgery Laboratory.
>>>School of Computer Science and Engineering.
>>>The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
>>>Phone: +(972)-2-658-5371 (laboratory)
>>>E-mail: freiman at cs.huji.ac.il
>>>WWW site: http://www.cs.huji.ac.il/~freiman
>>>This is the private VTK discussion list.
>>>Please keep messages on-topic. Check the FAQ at:
>>>Follow this link to subscribe/unsubscribe:
> -- 
> Moti Freiman, Graduate Student.
> Medical Image Processing and Computer-Assisted Surgery Laboratory.
> School of Computer Science and Engineering.
> The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel 
> Phone: +(972)-2-658-5371 (laboratory) E-mail: freiman at cs.huji.ac.il
> WWW site: http://www.cs.huji.ac.il/~freiman

More information about the vtkusers mailing list