[vtkusers] Rendering raw X-ray problem

Deepa Shroff vtk_user at yahoo.com
Fri Oct 10 11:10:54 EDT 2003


Hi:

We use this formula to scale MRI raw image data
between 0-255.


( (data[i] - min) / (max - min) ) ) * 255


Hope this helps.

Deepa.



--- John Vard <jvard at tcd.ie> wrote:
> 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
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com



More information about the vtkusers mailing list