[vtkusers] Scalar Type of vtkDICOMImageReader

Jothybasu K Selvaraj jothybasu at gmail.com
Tue Apr 13 15:17:29 EDT 2010


If you want to convert raw values to HU, you should use the formula

HU = PixelValue * RescaleSlope + RescaleIntercept

Jothy


On Tue, Apr 13, 2010 at 8:06 PM, Scott Johnson <Scott.Johnson at neuwave.com>wrote:

>  Hi Folks,
>
>
>
> I’m reading a series of DICOM files from a directory with code like this:
>
>
>
>     _reader=vtkDICOMImageReader::New();
>
>     _reader->SetDirectoryName(directory.c_str());
>
>     _reader->SetDataScalarTypeToUnsignedShort();
>
>     _reader->Update();
>
>
>
>     cerr << "Scalar Type: " << _reader->GetDataScalarType();
>
>
>
> How come the value of _*reader->GetDataScalarType is 4, which is VTK*
> _SHORT?
>
>
>
> The files are CT which should be 12 bit unsigned data.  When I access the
> data I get negative values, which I don’t want.  (I can’t find code
> converting to Hounsfield units which could be negative.)  How do I get
> Unsigned Short data from vtkDICOMImageReader?
>
>
>
> Thanks
>
>
>
>                                 -- Scott
>
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100413/600aa1ab/attachment.htm>


More information about the vtkusers mailing list