[vtkusers] 2's complement

David Gobbi david.gobbi at gmail.com
Fri Jul 16 12:44:13 EDT 2010


Yes, vtkImageShiftScale will work.  MONOCHROME2 just means that the
contrast is reversed, so a floating-point multiplication by "-1.0"
will reverse the reversal.  At the same time, apply a negative Shift
that is large enough to guarantee that the output values will all be
positive, because this will allow you to cast to UnsignedShort at the
same time.

   David


On Fri, Jul 16, 2010 at 10:33 AM, Raúl Ferriz <raul at torresyvalero.com> wrote:
> Thanks for your answer!
>
> What I'm trying to do is that all DICOM's that I have (with MONOCHROME2)
> could be displayed with black background and white foreground. Currently
> only dicoms with Pixel Representation = 0 are displayed as this way, and
> dicoms with Pixel Representation = 1(this means that values are stored in
> 2's complement)  are displayed with  white background and black foreground.
>
> Now I will try with vtkImageShiftScale, may be this is enought to get what I
> want.
>
> Many thanks again.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list