[vtkusers] vtkUnsignedShortArray question

Matias Montroull matimontg at gmail.com
Tue Jan 28 13:03:20 EST 2014


yes, odd.. I haven't tested other dicom readers but I can't figure out why
vtk converts the 2 bytes to ushort this way.


On Mon, Jan 27, 2014 at 10:18 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

>  The value difference is 1024, implying that bit 10 is unset.  Odd.
>  ------------------------------
> *From:* vtkusers [vtkusers-bounces at vtk.org] on behalf of Matias Montroull
> [matimontg at gmail.com]
> *Sent:* Tuesday, 28 January 2014 2:05 p.m.
> *To:* David Gobbi
> *Cc:* vtkusers at vtk.org
> *Subject:* Re: [vtkusers] vtkUnsignedShortArray question
>
>   Well, the bottom if my image is this:
>
>   48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>  48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>  48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
> 48 248 48 248 48 248 48 248 48
>
>  I can't figure out, maybe is because some attribute the image has that
> vtk converts the bytes into ushort somewhat different?
> I've attached an image sample in my last email but didn't go through..
>
>  Thanks!
>
>
> On Mon, Jan 27, 2014 at 9:37 PM, Matias Montroull <matimontg at gmail.com>wrote:
>
>> Well, the bottom if my image is this:
>>
>>   48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>> 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>  48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>  48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>> 48 248 48 248 48 248 48 248 48
>>
>>  I attach a sample, I can't figure out, maybe is because some attribute
>> the image has that vtk converts the bytes into ushort somewhat different?
>>
>>  Thanks,
>>
>>
>> On Mon, Jan 27, 2014 at 8:55 PM, David Gobbi <david.gobbi at gmail.com>wrote:
>>
>>> Hi Matias,
>>>
>>> When the vtkDICOMImageReader reads an image, it reads the bottom
>>> row of the image first.  That might be the cause of the difference that
>>> you are seeing.
>>>
>>> As far as I'm aware, all of the VTK image readers store the images
>>> bottom-to-top in the data array.  They do it this way in order to be
>>> consistent with each other, and to be consistent with VTK's display
>>> coordinate system.
>>>
>>>   David
>>>
>>>
>>> On Mon, Jan 27, 2014 at 3:30 PM, Matias Montroull <matimontg at gmail.com>
>>> wrote:
>>> > Why the vtkUnsignedShortArray returns a different ushort value than
>>> the one
>>> > in the image?
>>> >
>>> > See the beginning of my image is: (2 bytes each pixel)
>>> >
>>> > 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>> > 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>> > 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>> > 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>> > 48 248 48 248 48 248 48 248 48 248 48 248 48 248 48 248
>>> > 48 248 48 248 48 248
>>> >
>>> > and vtk returns 62512 on every ushort when it should return 63536!
>>> >
>>> > Can you explain why is this or am I missing something?
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140128/84a3cbb0/attachment.html>


More information about the vtkusers mailing list