Re: dataConvert() bug?

New Message Reply Date view Thread view Subject view Author view

Sean Spicer (spicer@bme.stanford.edu)
Tue, 9 Nov 1999 12:14:11 -0800 (PST)


Dave,

What you're seeing is completely expected.

(With the exception that voExternalFormat::INTENSITY probably shouldn't be
allowed as an external format)

Let's walk through an example case: Your data is in 8-bit intensity format
on disk, meaning that each 8-bit voxel has the same value for LUMINANCE
and ALPHA (RGB and A are all the same), and you'd like to get volumizer,
and more specifically the hardware, to recognize this fact and get it
right. grin.

For such a case here are the parameters that make sense on MXE
Impact (straight from the glTexImage3DEXT man page):

Parameter OpenGL Volumizer

Data type....GL_UNSIGNED_BYTE..........voDataType::UNSIGNED_BYTE
Data Format..GL_LUMINANCE..............voExternalFormatType::LUMINANCE
External.....GL_LUMINANCE_ALPHA........voExternalFormatType::LUMINANCE_ALPHA
Internal.....GL_LUMINANCE8_ALPHA8_EXT..voInternalFormatTypeLUMINANCE8_ALPHA8_EXT

The key point to note from this man page is that the format GL_INTENSITY
is actually *NOT* an external format, it is an internal one. To be honest
I don't know what the exact spec. is for it, but if you specify it as an
external format using glTexImage3DEXT(...) an error gets generated. Thus
the proper data format for what you're describing is GL_LUMINANCE.

What it looks like to me is that the voExternalFormat::GL_INTENSITY maps
to GL_LUMINANCE_ALPHA when specified as the disk data format. This would
certainly reproduce the image that you demonstrate as getBestParameters
will list voExternalFormat::LUMINANCE_ALPHA as the desired external
format and each L-A pair will be generated from successive data pairs in
memory.

Probably this parameter should be removed from the voExternalFormat enum,
unless someone can explain why it's there. At the very least, it should
map to GL_LUMINANCE.

Hope that helps!

sean

On Mon, 8 Nov 1999, Dave Ahn wrote:

> Hello,
>
> I've perused the archive and found no mention of this, so here I go...
>
> I believe I may have uncovered a bug with voAppearanceActions::dataConvert().
> In the case where I'm using UNSIGNED_SHORT data type in INTENSITY format,
> if I specify an external format of LUMINANCE_ALPHA (as returned by
> getBestParameters() for Impact & MXE), then dataConvert() fails to convert
> the voxels from i1i2i3i4 to i1i1i2i2i3i3i4i4. This also occurs on an Onyx
> IR if I force the external format to LUMINANCE_ALPHA. In order to get
> correct behavior, I had to convert the data manually. Below are links to
> two snapshots and a stripped down program to illustrate the apparent bug.
>
> http://www.vec.wfubmc.edu/volumizer_bug/vo_auto_cvt.gif
> http://www.vec.wfubmc.edu/volumizer_bug/vo_manual_cvt.gif
> http://www.vec.wfubmc.edu/volumizer_bug/volumize_bug.cc
>
> Of course, I could be doing something so obviously wrong that it's
> escaping me!
>
> I have not tested dataConvert() in other format and datatype pairs.
>
> My platforms are:
> Onyx IR 4xR10K, IRIX 6.2, Volumizer 1.1 + 3696
> Octane MXE R12K, IRIX 6.5.5m, Volumizer 1.1 + 3696
> Indigo2 Max Impact/TRAM R10K, IRIX 6.5.5m, Volumizer 1.1 + 3696
>
> Regards,
> Dave
>
> --
> Dave Ahn <ahn@vec.wfubmc.edu> | "When you were born, you cried and the
> | world rejoiced. Try to live your life
> Virtual Endoscopy Center | so that when you die, you will rejoice
> Wake Forest Univ. School of Medicine | and the world will cry." -1/2 jj^2
>

___________________________________________________________________________
Sean Spicer Stanford University Medical Center
Biomechanical Engineering Division of Vascular Surgery, Suite H3642
Cardiovascular Biomechanics Lab Stanford CA, 94305
                                  Telephone...650.723.1695
                                    Fax.........650.723.8762

            http://solvedeath.stanford.edu/~spicer
  


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Nov 09 1999 - 14:34:12 PST