[vtkusers] Picking DICOM pixel (scalar) value

Manuel Corrales manuelcorrales at gmail.com
Tue Aug 20 09:55:42 EDT 2013


Thanks David, will try that.


On Tue, Aug 20, 2013 at 10:54 AM, David Doria <daviddoria at gmail.com> wrote:

> On Sun, Aug 18, 2013 at 1:12 PM, Manuel Corrales
> <manuelcorrales at gmail.com> wrote:
> > Hello,
> >
> > I am trying to pick a "pixel" value from a series of DICOM image. I am
> able
> > to pick a pixel using the mouse and the get the value using this:
> >
> > (short*)vtkImageData->GetScalarPointer(indices[0], indices[1],
> indices[2]);
> >
> >
> > Now I have to iterate trought all data of the image and I am attempting
> to
> > do that by getting the dataArray of the image like this:
> >
> > vtkDataArray* array = imageData->GetPointData()->GetScalars()
> >
> >
> > But the, when I try to fetch the information from the array, the
> > getTuple(index) method is returning a double* instead of short*. I have
> > probably a missunderstanding of some concept here, can you help me?
> >
> > Regards,
> > Manuel.
>
> I think you can just do:
>
>   vtkShortArray* array = vtkShortArray::SafeDownCast (
> imageData->GetPointData()->GetScalars() );
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130820/3eeb778e/attachment.htm>


More information about the vtkusers mailing list