[vtkusers] Rendering raw X-ray problem

John Vard jvard at tcd.ie
Fri Oct 10 11:04:43 EDT 2003


Thanks for that Jens.. That solution never occurred to me. I take it the 
method GetScalarRange() could be used to determine the original [min,max] 
however I'm intrigued as to how you went about replacing the scalar values.. 

On Friday 10 October 2003 15:05, you wrote:
> Hi John,
>
> > I'm having difficulty displaying X-rays in raw file format. To display
> > the image in the render window vtkImageActor demands that the scalar type
> > of the image be set to Unsigned Character. Yet this appears to alter the
> > display colouring. Firstly can anybody explain why the image is being
> > altered and how can I overcome this?? Really would appreciate some help
> > on this. It's doing my head.. Ta
>
> I ran into the same problem during my first attempts with VTK some time
> ago. The scalar values of your raw image probably contain values greater
> than 255, the maximum value an unsigned char can represent. So the
> higher bits of some pixels get truncated and you get color distortions.
>
> My solution to this problem was to find the maximum scalar value and to
> scale the interval [0,max] to the interval [0,255]. But perhaps someone
> has a better solution?
>
> 	Jens

-- 

Trinity Centre for Bioengineering
Mechanical Engineering Dept.
Trinity College
Dublin 2
Ireland

e-mail: jvard at tcd.ie
www.biomechanics.ie




More information about the vtkusers mailing list